Error in installing bahmni 0.92 in vagrant box

Hi @sohel,

It looks like an issue with integration of openmrs service with systemd of centos 7.7 (systemd - 219-67.el7_7.1) - as mentioned here ( as pointed out by angshu in one of the threads)

I dint face this while installing bahmni in on centos 7.6 which comes with older version of systemd (It is the recommended OS verion in Bahmni wiki as well). I would suggest you to use the same if possible.

It might need some analysis and fixing in product to get openmrs working for newer versions of systemd.

If you really want to go ahead with 7.7 - you could try downgrading systemd by running -

yum downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64.

This will downgrade systemd to 219-67.el7. I tried it on my vagrant - it works.

3 Likes

@bhiravabhatla,

Thanks you very much. Exactly that was the issue,

stopped openmrs service

removed bhamni-emr

run bahmni install that works for me in AWS. But I am getting similar error for erp-connect,

fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Unable to start service bahmni-erp-connect: Job for bahmni-erp-connect.service failed because a configured resource limit was exceeded. See “systemctl status bahmni-erp-connect.service” and “journalctl -xe” for details.\n”}

is it needed another down gradation?

Thats odd! this gets handled by OpenMRS platform stratight away, however the logs seem to suggest something hitting a Bahmni endpoint

org.bahmni.module.referencedata.web.controller.PanelController

You can try to do the same for bahmni-erp

yum remove bahmni-erp

yum remove bahmni-erp-connect

What I have discovered is that, its very inconsistent. (btw, I couldn’t downgrade because of dependency for libgudev1 - and didn’t want to downgrade with skip broken option).

So here’s what I did

  • I installed Bahmni components one at a time. Will probably update the community tomorrow, after I have done another round of testing


bahmin -i local --only bahmni-erp install

interesting enough, the installation goes perfectly alright.

Hi @angshuonline,

While downgrading systemd - did you do yum downgrade systemd or yum downgrade systemd.x86_64 systemd-libs.x86_64 systemd-sysv.x86_64

Also, had a question regarding the service configuration while installing for centos 7. Why are we still using /etc/init.d to configure our services - instead of service UNITS in /etc/systemd/system. Any specific reason why we chose not to move out from init.d.

Hi @angshuonline, I found the installation problem is not following a pattern. In fact tried to install bahmni .92 in centos 7.6 and still fetching the same issue. I tried to install it by component still getting the same error.

rpm -q centos-release

centos-release-7-6.1810.2.el7.centos.x86_64

Error,

fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “Unable to start service openmrs: Job for openmrs.service failed because a configured resource limit was exceeded. See “systemctl status openmrs.service” and “journalctl -xe” for details.\n”}

Can you please let me what I am missing?

@bhiravabhatla - no I didn’t.

  • regarding init.d/functions: till recently provisioning and startup issue as this was never experienced and LSB scripts were working perfectly fine. We are yet to ascertain if higher version of systemd is the issue.

@sohel - I also have the exact same version. Even full Installation working for me (with zlib upgraded before installing bahmni-installer). Others have reported the same on CentOS7.6.

On CentOS7.7, this seems to be due to the PID file issue that I reported in the other thread. We are trying to see whats the least unobstructive way to support without making a patch release if the same issue creeps up on CentoS 7.6.

Can you please let us know the following?

  • Can you run “journalctl -xe” and

In the meantime?

  • What centos distro are you using? e.g. Everything, liveGNOME/KDE, Minimal, NetInstall?
  • What is the systemd version that you have?
  • When you are running bahmni installer, are you using running as a “root” user?

@angshuonline

here is “journalctl -xe” output respectively for bahmni-erp and bahmni-lab process start up fail

https://pastebin.com/SxvtBj5L

My CentOS distro: Optimized AWS CentOS 7.6.2 (X86, 64bit) image This is an AWS optimized CentOS 7.6 image, built by Faro Source

more on distro version: https://aws.amazon.com/marketplace/pp/B07ZDKQ31X?ref=cns_1clkPro

Systemd Version: [root@ip-10-10-10-10 home]# systemctl --version systemd 219 +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN

Yes I am running bahmni installer as a root user.

Though I have some improvement now, after component wise installation failed. Manually I start and stop the process now I able to run and browse, bahmni-emr and bahmi-lab

still fetching problem with bahmni-erp and bahmni-lab-connect from odoo log file I am getting this error while start process manually by running command

sudo service odoo stop

sudo service odoo start

Error:

Permission denied" while parsing /opt/bahmni-erp/odoo/addons/base/base_menu.xml:4, near

2019-10-29 09:14:50,412 15065 ERROR ? werkzeug: 182.160.100.201 - - [29/Oct/2019 09:14:50] code 400, message Bad request syntax

@sohel - yes the old “service” which uses SysVinit is fine. The issue is that during provisioning and installation, we use “systemd”.

1 Like

Thanks @angshuonline finally I able to set up all bahmni components successfully. Lastly I was getting error with odoo,

Error OSError: [Errno 13] Permission denied: ‘/var/lib/odoo’

For this I had to manually create directory inside /var/lib and had given ownership to odoo user that resolve the problem.

I have again started to install bahmni 0.92 in vagrant & got the same error. The bellow code is the vagrant file.

Vagrant.configure(2) do |config|
  config.vm.box = "centos/7"
  config.vm.box_check_update = true
  config.ssh.insert_key = false
  config.vm.network "private_network", ip: "192.168.33.10"

  config.vm.synced_folder "..", "/bahmni", :owner => "vagrant"

Host PC: Window 10 64bit. After executing vagrant up i have checked the centos version whish is centos-release-7-6.1810.2.el7.centos.x86_64. I have checked list of installed modules by executing yum list installed | grep bahmni & found the bellow list:

bahmni-emr.noarch                    0.92-183                   @bahmni
bahmni-erp.noarch                    0.92-133                   @bahmni
bahmni-implementer-interface.noarch  0.92-30                    @bahmni
bahmni-installer.noarch              0.92-142                   installed
bahmni-lab.noarch                    0.92-54                    @bahmni
bahmni-lab-connect.noarch            0.92-183                   @bahmni
bahmni-reports.noarch                0.92-25                    @bahmni
bahmni-web.noarch                    0.92-183                   @bahmni

Version of systemctl: 219

systemctl --version
systemd 219
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 -SECCOMP +BLKID +ELFUTILS +KMOD +IDN

Virtualbox version: 6.00

Vagrant version: 2.2.5

Again get the bellow error in the fresh installation in vagrant:

TASK [bahmni-emr : Start openmrs] **********************************************
task path: /opt/bahmni-installer/bahmni-playbooks/roles/bahmni-emr/tasks/main.yml:218
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Unable to start service openmrs: Job for openmrs.service failed because a configured resource limit was exceeded. See \"systemctl status openmrs.service\" and \"journalctl -xe\" for details.\n"}
        to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

PLAY RECAP *********************************************************************
localhost                  : ok=127  changed=86   unreachable=0    failed=1

Odoo is running well. OpenMRS & OpenElis is not running well. @angshuonline @laxman @binduak @ramashish @mksrom can you please help me. I am still stucked in this point. Thank you in advance.

Though CenOS is 7.6 as mentioned here the conflict is due to

So you may want to check specifically

yum list installed | grep systemd*

If you see the version mentioned above then you have 2 options

OR

I used option 2.

Hi, I have created a patch on the startup script and “comply” to systemd security issue

Refusing to accept PID outside of service control group, acquired through unsafe symlink chain

cd /

git apply patch_centos76_bahmni092.patch.txt

patch_centos76_bahmni092.patch.txt Patch Content

diff --git a/opt/bahmni-erp-connect/bin/bahmni-erp-connect b/opt/bahmni-erp-connect/bin/bahmni-erp-connect
index 5d06bfb..d0f2f2c 100644
--- a/opt/bahmni-erp-connect/bin/bahmni-erp-connect
+++ b/opt/bahmni-erp-connect/bin/bahmni-erp-connect
@@ -5,7 +5,7 @@
 # chkconfig: - 64 36
 # processname: bahmni-erp-connect
 # config: /etc/default/bahmni-erp-connect
-# pidfile: /var/run/bahmni-erp-connect/bahmni-erp-connect.pid
+# pidfile: /var/run/bahmni-erp-connect.pid
 
 export BAHMNI_ERP_CONNECT_USER=bahmni
 export BAHMNI_ERP_CONNECT_RUN=/opt/bahmni-erp-connect/bin/start.sh
@@ -47,6 +47,7 @@ start(){
         else
                 sh $BAHMNI_ERP_CONNECT_RUN
         fi
+	cp /var/run/bahmni-erp-connect/bahmni-erp-connect.pid /var/run/bahmni-erp-connect.pid
   fi
   exit 0
 }
@@ -81,7 +82,7 @@ status(){
 stop() {
 	echo -e "\e[00;31mTerminating bahmni-erp-connect\e[00m"
 	kill -9 $(bahmni_erp_connect_pid)
-	rm -f /var/run/bahmni-erp-connect/bahmni-erp-connect.pid
+	rm -f /var/run/bahmni-erp-connect.pid
     return
 }
 user_exists(){
diff --git a/opt/bahmni-lab/bin/bahmni-lab b/opt/bahmni-lab/bin/bahmni-lab
index 6efb163..0de82fe 100644
--- a/opt/bahmni-lab/bin/bahmni-lab
+++ b/opt/bahmni-lab/bin/bahmni-lab
@@ -5,7 +5,7 @@
 # chkconfig: - 64 36
 # processname: bahmni-lab
 # config: /etc/default/bahmni-lab
-# pidfile: /var/run/bahmni-lab/bahmni-lab.pid
+# pidfile: /var/run/bahmni-lab.pid
 
 export BAHMNI_LAB_SERVER_USER=bahmni
 export BAHMNI_LAB_SERVER_RUN=/opt/bahmni-lab/bin/start.sh
@@ -47,6 +47,7 @@ start(){
         else
                 sh $BAHMNI_LAB_SERVER_RUN
         fi
+	cp /var/run/bahmni-lab/bahmni-lab.pid /var/run/bahmni-lab.pid
   fi
   exit 0
 }
@@ -81,7 +82,7 @@ status(){
 stop() {
 	echo -e "\e[00;31mTerminating bahmni-lab\e[00m"
 	kill -9 $(bahmni_lab_pid)
-	rm -f /var/run/bahmni-lab/bahmni-lab.pid
+	rm -f /var/run/bahmni-lab.pid
     return
 }
 user_exists(){
diff --git a/opt/bahmni-reports/bin/bahmni-reports b/opt/bahmni-reports/bin/bahmni-reports
index 2daec6e..0f4301f 100644
--- a/opt/bahmni-reports/bin/bahmni-reports
+++ b/opt/bahmni-reports/bin/bahmni-reports
@@ -5,7 +5,7 @@
 # chkconfig: - 64 36
 # processname: bahmni-reports
 # config: /etc/default/bahmni-reports
-# pidfile: /var/run/bahmni-reports/bahmni-reports.pid
+# pidfile: /var/run/bahmni-reports.pid
 
 export BAHMNI_REPORTS_USER=bahmni
 export BAHMNI_REPORTS_RUN=/opt/bahmni-reports/bin/start.sh
@@ -51,6 +51,7 @@ start(){
         else
                 sh $BAHMNI_REPORTS_RUN
         fi
+	cp /var/run/bahmni-reports/bahmni-reports.pid /var/run/bahmni-reports.pid
   fi
   exit 0
 }
@@ -70,6 +71,7 @@ debug(){
         else
                 sh $BAHMNI_REPORTS_DEBUG
         fi
+	cp /var/run/bahmni-reports/bahmni-reports.pid /var/run/bahmni-reports.pid
   fi
   exit 0
 }
@@ -85,7 +87,7 @@ status(){
 stop() {
 	echo -e "\e[00;31mTerminating bahmni-reports\e[00m"
 	kill -9 $(bahmni_reports_pid)
-	rm -f /var/run/bahmni-reports/bahmni-reports.pid
+	rm -f /var/run/bahmni-reports.pid
     return
 }
 user_exists(){
diff --git a/opt/openmrs/bin/openmrs b/opt/openmrs/bin/openmrs
index 2120807..36fb6db 100644
--- a/opt/openmrs/bin/openmrs
+++ b/opt/openmrs/bin/openmrs
@@ -6,7 +6,7 @@
 # description: openmrs - Open Medical Record System
 # processname: openmrs
 # config: /etc/default/openmrs
-# pidfile: /var/run/openmrs/openmrs.pid
+# pidfile: /var/run/openmrs.pid
 ### BEGIN INIT INFO
 # Provides: openmrs
 # Required-Start: $local_fs $remote_fs $network $named $syslog $time
@@ -81,6 +81,7 @@ start(){
         else
                 sh $OPENMRS_SERVER_RUN
         fi
+	cp /var/run/openmrs/openmrs.pid /var/run/openmrs.pid
   fi
   exit 0
 }
@@ -102,6 +103,7 @@ debug(){
         else
                 sh $OPENMRS_SERVER_DEBUG
         fi
+	cp /var/run/openmrs/openmrs.pid /var/run/openmrs.pid
   fi
   exit 0
 }
@@ -117,7 +119,7 @@ status(){
 stop() {
 	echo -e "\e[00;31mTerminating openmrs\e[00m"
 	kill -9 $(openmrs_pid)
-	rm -rf /var/run/openmrs/openmrs.pid
+	rm -rf /var/run/openmrs.pid
 	return
 }
 user_exists(){

Hi, I have created a patch on the startup script and “comply” to systemd security issue

Refusing to accept PID outside of service control group, acquired through unsafe symlink chain

cd /

git apply patch_centos76_bahmni092.patch.txt

patch_centos76_bahmni092_patch.txt (3.9 KB)

I am also getting this PID issue and the provided patch above does not seem to be making a difference to my install. Bahmni 0.92 Install on CentOS 7.6 Minimal Fails

Replied on another thread with same discussion.