20.04: Various problems with python scripts

Use this forum to report bugs and to check for bugfixes and new releases of OpenEMM

Moderator: moderator

svewap
Posts: 8
Joined: Wed Jun 10, 2020 12:55 pm
Contact:

20.04: Various problems with python scripts

Post by svewap »

Hello, everyone,
I don't know if it's partly because of the Python version or not. Anyway, I'm using python 3.8.5 and have to make some modifications, otherwise the backend didn't work. All calls of the shell scripts and the direct calls of the python scripts were finished without output.

Problem 1: rpc suppresses all output
I had to comment out the import in the file daemon.py.

Code: Select all

#from .rpc import XMLRPC
Problem 2: py3required() function in config.sh returns wrong result
Although all checks in the function py3available() are executed correctly (because they are fulfilled), the function terminates in the 'die'.
Possibly a logical error.
I have modified the function:

Code: Select all

py3required() {
	#py3available || the "Please install a python3 version 3.8 or later to ${softwarebase}/python3"
	return 0
}
Problem 3: __relink in sanity3.py does not work correctly
After a modification it worked.

Code: Select all

	def __relink (self, r: Report) -> None:
		#relink (os.path.join (base, 'release', 'backend', 'current', 'bin'), os.path.join (base, 'bin'))
		pass
Afterwards the backend started again and mails could be sent.
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Re: 20.04: Various problems with python scripts

Post by ud »

Hello svewap,

thank you for the bug report. First, the python programs are generally designed to run in background and, in general, do not write any output to stdout (if not invoked explicit with verbose mode on.) They are writing the information to logfiles which can be found in /home/openemm/var/log.

And it is generally a bad idea to just comment out code, that does not work in the first place and expect, that then the rest of the system runs correct. So to your specific problems:

concerning Problem 1:

I can't see any reason, why and where the module "rpc" will switch off the output. Do you have some further information how you identified this module to be origin of the problem?

concerning Problem 2:

I can't reproduce this behavior, could you please try these commands to isolate the reason?

Code: Select all

# login as user openemm or as root:
su - openemm
which python3
source scripts/config.sh
which python3
py3available
echo $?
concerning Problem 3:

Can you provide some more details on this problem, what does not work correctly?

And could you please provide some information of the used operation system and its version?
-- ud
svewap
Posts: 8
Joined: Wed Jun 10, 2020 12:55 pm
Contact:

Re: 20.04: Various problems with python scripts

Post by svewap »

ud wrote: Mon Aug 24, 2020 7:40 am
concerning Problem 1:

I can't see any reason, why and where the module "rpc" will switch off the output. Do you have some further information how you identified this module to be origin of the problem?
The problem was and is, that if I execute ./backend.sh status nothing is printed out. No error message or anything else. But I needed to know the reason why this call doesn't function. Then I got the error of problem 3:

Code: Select all

*** Error report for sanity check ***
Check: <bound method OpenEMM.__relink of <sanity3.OpenEMM object at 0x7f38ea829940>> failed: (17, 'File exists')
Failed in sanity check
Suppressing error messages makes error analysis more difficult.
ud wrote: Mon Aug 24, 2020 7:40 am
concerning Problem 2:

Code: Select all

# login as user openemm or as root:
su - openemm
which python3
source scripts/config.sh
which python3
py3available
echo $?

Code: Select all

/home/openemm/bin/python3  # symlink to /home/linuxbrew/.linuxbrew/opt/python3/bin/python3  version 3.8.5
/home/openemm/.venv.3.8.5.final.0/bin/python3  # symlink to /usr/bin/python3
1
Thank you very much for this hint. This symlink led to the default system python 3.6.x.
I changed the symlink and now it worked. Maybe you can improve your scripts to use the python from the openemm bin by default. I had to install a special python 3.8 because many system dependencies need 3.6.
ud wrote: Mon Aug 24, 2020 7:40 am
concerning Problem 3:

Can you provide some more details on this problem, what does not work correctly?

And could you please provide some information of the used operation system and its version?
-- ud
OpenSuse 15.2

Kind regards, Sven
Post Reply