Cannot run odoo while Openmrs is running

Hi all, I installed Bahmni 0.92 sucessfully on CentOS 7.7 in vagrant machine without error, but I get error “mkdir: cannot create directory ‘odoo’: File exists odoo-server is stopped” while OpenMRS and OpenElis is running fine. Can someone help me finding the solution?

Can you post the result of this command

journalctl -u odoo

[root@localhost vagrant]# journalctl -u odoo – Logs begin at आइत 2020-01-26 16:00:22 +0545, end at सोम 2020-01-27 09:52:12 +0545. – जनवरी 26 16:00:25 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:12] Failed to add dependency on <%=.service, ign जनवरी 26 16:00:25 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:13] Failed to add dependency on @postgresService जनवरी 26 16:00:25 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:14] Failed to add dependency on %>.service, igno जनवरी 26 16:00:31 localhost.localdomain systemd[1]: Starting LSB: Launches the Odoo server… जनवरी 26 16:00:31 localhost.localdomain runuser[1232]: pam_unix(runuser:session): session opened for user odoo by (uid=0) जनवरी 26 16:00:31 localhost.localdomain runuser[1232]: pam_unix(runuser:session): session closed for user odoo जनवरी 26 16:00:31 localhost.localdomain odoo[1182]: Starting Odoo Server Daemon (odoo-server): [ OK ] जनवरी 26 16:00:31 localhost.localdomain systemd[1]: Can’t open PID file /var/run/odoo/odoo-server.pid (yet?) after start: No such file or dire जनवरी 26 16:00:31 localhost.localdomain systemd[1]: Started LSB: Launches the Odoo server… जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: Traceback (most recent call last): जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/bin/odoo”, line 4, in जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: import(‘pkg_resources’).run_script(‘odoo==10.0.post20190619’, ‘odoo’) जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3098, in जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: @_call_aside जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3082, in _call_asi जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: f(*args, **kwargs) जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 3111, in _initiali जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: working_set = WorkingSet._build_master() जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 573, in _build_mas जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: ws.require(requires) जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 891, in require जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: needed = self.resolve(parse_requirements(requirements)) जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 777, in resolve जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: raise DistributionNotFound(req, requirers) जनवरी 26 16:00:33 localhost.localdomain odoo[1182]: pkg_resources.DistributionNotFound: The ‘xlwt’ distribution was not found and is required जनवरी 26 16:00:33 localhost.localdomain odoo[1448]: mkdir: cannot create directory ‘odoo’: File exists जनवरी 26 16:00:33 localhost.localdomain odoo[1448]: Odoo Server Daemon already stopped. जनवरी 26 16:15:47 localhost.localdomain systemd[1]: Starting LSB: Launches the Odoo server… जनवरी 26 16:15:47 localhost.localdomain odoo[6938]: mkdir: cannot create directory ‘odoo’: File exists जनवरी 26 16:15:47 localhost.localdomain runuser[6947]: pam_unix(runuser:session): session opened for user odoo by (uid=0) जनवरी 26 16:15:47 localhost.localdomain odoo[6938]: Starting Odoo Server Daemon (odoo-server): [ OK ] जनवरी 26 16:15:47 localhost.localdomain systemd[1]: Can’t open PID file /var/run/odoo/odoo-server.pid (yet?) after start: No such file or dire जनवरी 26 16:15:47 localhost.localdomain systemd[1]: Started LSB: Launches the Odoo server… जनवरी 26 16:15:48 localhost.localdomain odoo[6938]: Traceback (most recent call last): जनवरी 26 16:15:48 localhost.localdomain odoo[6938]: File “/usr/bin/odoo”, line 4, in जनवरी 26 16:15:48 localhost.localdomain odoo[6938]: import(‘pkg_resources’).run_script(‘odoo==10.0.post20190619’, ‘odoo’) lines 1-37

we are about to release a patch for 0.92 that should take care of the systemd issues. You can give it a try with this one. installer-rpm link

Please note, since the binaries are not uploaded to our release artefactory, that you must have the following configuration in /etc/bahmni-installer/setup.yml file, so that the installer knows to pull binaries from our internal S3 repo

bahmni_repo_url: http://repo.mybahmni.org/rpm/bahmni

For anything else, please follow WIKI documentation for installation https://bahmni.atlassian.net/wiki/spaces/BAH/pages/33128505/Install+Bahmni+on+CentOS

Those output doesn’t quietly complete until the bottom of it, you have to press space or enter until it show “END” at the bottom. And usually, python error’s will give usefull hint at the end of the error message.

Hi Angshumar,

I think systemd issue only affect openmrs, bahmni-report, and bahmni-erp-connect(issue about using ‘su’ instead uf ‘run as’), but not odoo. Correctly me if I am wrong, odoo service error usually because python package version missmatch (at least that’s what I found), I have to use a specific version of some pip package (like 2.7.7 of psycopg2, 0.23 of MarkUpSafe) otherwhise odoo will throw some errors. But the errors log help most of the time to find the problems.

Thats correct. The systemd fixes are not for Odoo. However, with extensive installation try-outs on CentOS 7.6, 7.7 revealed no such problems for us. What version of CentOS and distro are you using? Have you tried to use CentOS minimal? Let us know.

Curently on production, I am using lxc template from proxmox, it was marked as “Centos7-default_20190926_amd64”, having hard time installing odoo. I manage to export anything from gcp instances that was running for testing, and import them to the production vm (dump odoo db, and copy a whole /opt/bahmni-erp directory).

On gcp instance, it was default template from google, it’s always latest centos from version 7 (at the time development env was deployed, it was 7.7). Facing “normal” systemd issue.

On local virtualbox with, deployed with centos 7.6 minimal iso, it work fine (only systemd issue)

I am having the similar issues for my case openmrs and openelis running but tried different way of running odoo but without sucess,

Here is my output of “journalctl -u odoo” command

import pkg_resources

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 3007, in working_set.require(requires)

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 728, in require needed = self.resolve(parse_requirements(requirements))

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 631, in resolve requirements.extend(dist.requires(req.extras)[::-1])

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2489, in requires dm = self._dep_map

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2700, in _dep_map self.__dep_map = self._compute_dependencies()

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2722, in _compute_dependencies for req in self._parsed_pkg_info.get_all(‘Requires-Dist’) or []:

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 2692, in _parsed_pkg_info self._pkg_info = Parser().parsestr(self.get_metadata(self.PKG_INFO))

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 1421, in get_metadata return self._get(self._fn(self.egg_info,name))

File “/usr/lib/python2.7/site-packages/pkg_resources.py”, line 1536, in _get stream = open(path, ‘rb’)

IOError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/pyusb-1.1.1.dist-info/

Apr 16 19:19:29 ip-10-170-2-137.ap-south-1.compute.internal systemd[1]: Daemon never wrote its PID file. Failing.

Hi, Were you able to get the odoo running locally?

I am experiencing a problem with Odoo after a fresh installation of Bahmni. All other modules work without any issues. I need help. I have looked at and tried several fixes from the forums but none worked for me. @angshuonline @eddyprasetyo @dkayiwa @bhiravabhatla any ideas?

Feb 23 12:37:06 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:12] Failed to add dependency on <%=.service, ignoring:
Feb 23 12:37:06 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:13] Failed to add dependency on @postgresServiceName.se
Feb 23 12:37:06 localhost.localdomain systemd[1]: [/run/systemd/generator.late/odoo.service:14] Failed to add dependency on %>.service, ignoring: I
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: Starting LSB: Launches the Odoo server....
Feb 23 12:37:09 CLINICUPGRADE runuser[3868]: pam_unix(runuser:session): session opened for user odoo by (uid=0)
Feb 23 12:37:09 CLINICUPGRADE odoo[3808]: Starting Odoo Server Daemon (odoo-server): [  OK  ]
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: Can't open PID file /var/run/odoo/odoo-server.pid (yet?) after start: No such file or directory
Feb 23 12:37:09 CLINICUPGRADE odoo[3808]: Traceback (most recent call last):
Feb 23 12:37:09 CLINICUPGRADE odoo[3808]: File "/usr/bin/odoo", line 4, in <module>
Feb 23 12:37:09 CLINICUPGRADE odoo[3808]: __import__('pkg_resources').run_script('odoo==10.0.post20190619', 'odoo')
Feb 23 12:37:09 CLINICUPGRADE odoo[3808]: ImportError: No module named pkg_resources
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: Daemon never wrote its PID file. Failing.
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: Failed to start LSB: Launches the Odoo server..
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: Unit odoo.service entered failed state.
Feb 23 12:37:09 CLINICUPGRADE systemd[1]: odoo.service failed.
Feb 23 14:41:49 CLINICUPGRADE systemd[1]: [/run/systemd/generator.late/odoo.service:12] Failed to add dependency on <%=.service, ignoring
Feb 23 14:41:49 CLINICUPGRADE systemd[1]: [/run/systemd/generator.late/odoo.service:13] Failed to add dependency on @postgresServiceName.
Feb 23 14:41:49 CLINICUPGRADE systemd[1]: [/run/systemd/generator.late/odoo.service:14] Failed to add dependency on %>.service, ignoring:
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: Starting LSB: Launches the Odoo server....
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: mkdir: cannot create directory ‘odoo’: File exists
Feb 23 14:52:42 CLINICUPGRADE runuser[19932]: pam_unix(runuser:session): session opened for user odoo by (uid=0)
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: Starting Odoo Server Daemon (odoo-server): [  OK  ]
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: Can't open PID file /var/run/odoo/odoo-server.pid (yet?) after start: No such file or directory
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: Traceback (most recent call last):
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: File "/usr/bin/odoo", line 4, in <module>
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: __import__('pkg_resources').run_script('odoo==10.0.post20190619', 'odoo')
Feb 23 14:52:42 CLINICUPGRADE odoo[19923]: ImportError: No module named pkg_resources
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: Daemon never wrote its PID file. Failing.
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: Failed to start LSB: Launches the Odoo server..
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: Unit odoo.service entered failed state.
Feb 23 14:52:42 CLINICUPGRADE systemd[1]: odoo.service failed.
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: Starting LSB: Launches the Odoo server....
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: mkdir: cannot create directory ‘odoo’: File exists
Feb 23 16:18:13 CLINICUPGRADE runuser[27968]: pam_unix(runuser:session): session opened for user odoo by (uid=0)
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: Starting Odoo Server Daemon (odoo-server): [  OK  ]
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: Can't open PID file /var/run/odoo/odoo-server.pid (yet?) after start: No such file or directory
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: Traceback (most recent call last):
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: File "/usr/bin/odoo", line 4, in <module>
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: __import__('pkg_resources').run_script('odoo==10.0.post20190619', 'odoo')
Feb 23 16:18:13 CLINICUPGRADE odoo[27959]: ImportError: No module named pkg_resources
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: Daemon never wrote its PID file. Failing.
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: Failed to start LSB: Launches the Odoo server..
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: Unit odoo.service entered failed state.
Feb 23 16:18:13 CLINICUPGRADE systemd[1]: odoo.service failed.

Try to solve this line first, and then let see if another problem occurs.

I looked up this error but all suggested fixes did not work.

I have tried upgrading setuptools with pip install --upgrade setuptools I have uninstalled and reinstalled setuptools pip uninstall -y setuptools and pip install setuptools

I don’t know what else I need to do to fix this issue

Sometimes, it’s not the latest that works. You need to check requiremetns.txt on odoo root directory, what module and what version are needed.

Also, bahmni use the old version of odoo, far away from the latest odoo, so I’ll expect some of the pip module that needed, was not the latest one.

Thanks for your help and insights. Unfortunately I am still struggling with this error :cold_sweat:

I have installed all the specified versions in the requirements.txt file but this problem still persists. I also checked if the said module pkg_resources is available in the site-modules directory and it was there with the following contents.

drwxr-x--- 2 root root 45 Feb 28 08:40 extern
-rw-r----- 1 root root 108349 Feb 28 08:40 __init__.py
-rw-r----- 1 root root 120534 Feb 28 08:40 __init__.pyc
-rw-r----- 1 root root 558 Feb 28 08:40 py31compat.py
-rw-r----- 1 root root 758 Feb 28 08:40 py31compat.pyc
drwxr-x--- 3 root root 169 Feb 28 08:40 _vendor

I just don’t know where to look now.