Error in installing bahmni 0.92 in vagrant box

When We are installing bahmni 0.92 in vagrant box we get openmrs starting error. The step what We are following:

Vagrant file:

    VAGRANTFILE_API_VERSION = "2"
    Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
      config.vm.define "client" do |client|
        client.vm.box = "bento/centos-7.6"
        client.vm.network :private_network, ip: "192.168.33.20"
        client.vm.provider :virtualbox do |vb|
            vb.customize ["modifyvm", :id, "--memory", 8072, "--cpus", "3"]
        end
      end
    end

After vagrant up we have execute the bellow command:

sudo su
yum install -y python-setuptools
yum install -y https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.92-142.noarch.rpm
curl -L https://tinyurl.com/yyoj98df >> /etc/bahmni-installer/setup.yml
bahmni -i local install

And get the bellow error:

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

And after execute the systemctl status openmrs.service command we get the bellow message:

● openmrs.service - LSB: start and stop openmrs system,
   Loaded: loaded (/etc/rc.d/init.d/openmrs; bad; vendor preset: disabled)
   Active: failed (Result: resources) since Sat 2019-09-28 09:38:46 IST; 8h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15413 ExecStop=/etc/rc.d/init.d/openmrs stop (code=exited, status=0/SUCCESS)
  Process: 15938 ExecStart=/etc/rc.d/init.d/openmrs start (code=exited, status=0/SUCCESS)
 Main PID: 26863 (code=killed, signal=KILL)

Sep 28 09:38:46 localhost.localdomain systemd[1]: Starting LSB: start and stop openmrs system,...
Sep 28 09:38:46 localhost.localdomain openmrs[15938]: Starting openmrs
Sep 28 09:38:46 localhost.localdomain su[15952]: (to bahmni) root on none
Sep 28 09:38:46 localhost.localdomain systemd[1]: Refusing to accept PID outside of service control group....pid
Sep 28 09:38:46 localhost.localdomain systemd[1]: Refusing to accept PID outside of service control group....pid
Sep 28 09:38:46 localhost.localdomain systemd[1]: Failed to start LSB: start and stop openmrs system,.
Sep 28 09:38:46 localhost.localdomain systemd[1]: Unit openmrs.service entered failed state.
Sep 28 09:38:46 localhost.localdomain systemd[1]: openmrs.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

But we are successfully installed in bahmni 0.92 in a centos 7.6 pc by using the above installation commands. but can not in vagrant box. Is it my vagrant box configuration problem. I am not expert in linux. is it the access right problem? Please help me what can i do. Thank you in advance.

@angshuonline @snehabagri @binduak @ruchikab @vmalini @rmkanda @mksrom

I think @laxman got the same error (Announcing Bahmni 0.92 Release Candidate).

@laxman were you able to solve this?

Yes error was same, in my case there was no openmrs.pid file generated so I manually created openmrs.pid and then restarted , it worked but this error happened to my colleagues machine too but same approach didn’t worked for him. Please try this once, otherwise i think this is the blocker issue for any new implementation.

I have created openmrs.pid, give file access to bahmni user, restart openmrs & also restart vagrant device. But unfortunately not working. Interesting things is that bahmni 0.92 is installed successfully in centos 7.6 pc but not in vagrant box. I & my two colleagues try in vagrant but we are stucked at the same point. Please try anyone & resolve this issue. Thanks in advance.

Can you provide information like - what Host OS you are using, version of Vagrant and Virtual box etc? I never had to install setup tools etc (as my dev machine). and I just use the default centos7 community box to start with.

https://app.vagrantup.com/centos/boxes/7 - check the release notes as well. and check for your respective host OS.

this is the simple Vagrantfile that I use. once provisioned, i just download and install the installer, configure inventory and run install command. never had a problem.

My vagrant version is 2.1.5 (slightly old) and virtualbox as 6.0.

My host pc is Windows 10. Virtualbox version is 6.00 & vagrant version is 2.2.5. I have tried with vagrantFile But unfortunately get bellow error:

TASK [mysql-users : ensure anonymous users are not in the database] ************
task path: /opt/bahmni-installer/bahmni-playbooks/roles/mysql-users/tasks/main.yml:1
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: zlib.error: Error -2 while preparing to decompress data: inconsistent stream state
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible_7p2RD9/ansible_module_mysql_user.py\", line 218, in <module>\n    from ansible.module_utils.basic import AnsibleModule\nzlib.error: Error -2 while preparing to decompress data: inconsistent stream state\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}
        to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

Please kindly help me. Thank you in advance.

Could you please confirm this in your setup?

Thank you @ramashish for your reply. I have checked my /opt/bahmni-installer/bahmni-playbooks/roles/mysql-users/defaults/main.yml & it is like bellow:

openmrs_db_username: openmrs-user
openmrs_db_password: P@ssw0rd
reports_db_username: reports-user
reports_db_password: P@ssw0rd
mysql_root_user: root
mysql_root_password: P@ssw0rd
mysql_replication_username: replication-user
mysql_replication_password: P@ssw0rd

Have any other reasons to show that error? Please kindly see this. I am stuck in this part.

Hi,

We are also facing this issue from last two days. We were not seeing this before. Issue is mysql_user ansible module is failing due to dependency on zlib 1.2.11+ and Centos 7 comes with zlib 1.2.7. Its a reported ansible issue - https://github.com/ansible/ansible/issues/47927.

Also I could see that there was mysql minor version release on 14th oct 5.7.28. Last week when we used the installer we would get mysql 5.7.27 and we dint get above issue.

3 Likes

For now, we followed the steps mentioned in https://github.com/ansible/ansible/issues/47927 to compile zlib 1.2.11 from source. It solved the problem. But this is not a solution, just a work around.

1 Like

I got error on installation of bahmni 92 on my physical server @angshuonline can you please help on this issue. I try on my virtual box too and got the same error with OS centos 7.6 TASK [mysql : Update mysql root password] ****************************************************************************** task path: /opt/bahmni-installer/bahmni-playbooks/roles/mysql/tasks/main.yml:60 fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: “mysql -e “UPDATE mysql.user SET authentication_string=PASSWORD(‘P@ssw0rd’) WHERE User=‘root’; FLUSH PRIVILEGES;” -u root -i -p’P@ssw0rd’”, “delta”: “0:00:00.012060”, “end”: “2019-10-16 15:26:03.268424”, “failed”: true, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-10-16 15:26:03.256364”, “stderr”: “mysql: [Warning] Using a password on the command line interface can be insecure.\nERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)”, “stderr_lines”: [“mysql: [Warning] Using a password on the command line interface can be insecure.”, “ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)”], “stdout”: “”, “stdout_lines”: []} to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

I am installing Bahmni 0.92-142 on AWS Centos 7 and I also faced the same issue. Last successful Bahmni installation on Centos 7 is with 0.92-120. Got this error

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: zlib.error: Error -2 while preparing to decompress data: inconsistent stream state fatal: [localhost]: FAILED! => {“changed”: false, “module_stderr”: “Traceback (most recent call last):\n File “/tmp/ansible_SJV09V/ansible_module_mysql_user.py”, line 218, in \n from ansible.module_utils.basic import AnsibleModule\nzlib.error: Error -2 while preparing to decompress data: inconsistent stream state\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0} to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

PLAY RECAP ************************************************************************************************************************************************************* localhost : ok=61 changed=22 unreachable=0 failed=1

Traceback (most recent call last): File “/bin/bahmni”, line 9, in load_entry_point(‘bahmni==0.1’, ‘console_scripts’, ‘bahmni’)() File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py”, line 764, in call return self.main(*args, **kwargs) File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py”, line 717, in main rv = self.invoke(ctx) File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py”, line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py”, line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/core.py”, line 555, in invoke return callback(*args, **kwargs) File “/usr/lib/python2.7/site-packages/Click-7.0-py2.7.egg/click/decorators.py”, line 17, in new_func return f(get_current_context(), *args, **kwargs) File “/usr/lib/python2.7/site-packages/bahmni-0.1-py2.7.egg/bahmni.py”, line 79, in install File “/usr/lib64/python2.7/subprocess.py”, line 542, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command ‘ansible-playbook -i /etc/bahmni-installer/local all.yml -vv --extra-vars ‘@/etc/bahmni-installer/rpm_versions.yml’ --extra-vars ‘@/etc/bahmni-backrest.conf’ --extra-vars ‘@/etc/bahmni-installer/setup.yml’’ returned non-zero exit status 2 @ramashish
I have checked my /opt/bahmni-installer/bahmni-playbooks/roles/mysql-users/defaults/main.yml & it is like bellow:

openmrs_db_username: openmrs-user
openmrs_db_password: P@ssw0rd
reports_db_username: reports-user
reports_db_password: P@ssw0rd
mysql_root_user: root
mysql_root_password: P@ssw0rd
mysql_replication_username: replication-user
mysql_replication_password: P@ssw0rd

Looks like this was discussed during today’s PAT call and most likely it is the zlib version mismatch - Check notes so try updating zlib to >=1.2.11

Thank you @bhiravabhatla for your reply. I have fixed the zlib miss-match error. But another error is remaining:

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

My host pc is Windows 10. Virtualbox version is 6.00 & vagrant version is 2.2.5. I have tried with vagrantFile & followed the wiki installation steps. And surprising things is that successfully installed in centos7.6 pc by the same process , But show the above error in vagrant box. Please kindly see this issue. Thanks in advance. @angshuonline @laxman @mksrom Please kindly see this.

Hi all,

@angshuonline @binduak @snehabagri @mksrom @rakib.hasan @akshaybirajdar

We have fixed the mysql_user ansible error issue by installing zlib 1.2.11 manually.

Centos 7 does not have an official release for zlib 1.2.11 yet - maximum version we get for centos 7 is 1.2.7. We downloaded zlib 1.2.11 fedora rpm and installed it manually before installing bahmni.

yum install https://rpmfind.net/linux/fedora/linux/updates/30/Everything/x86_64/Packages/z/zlib-1.2.11-18.fc30.x86_64.rpm

This is a publicly available rpm - I cant guarantee the authenticity of the same. You could download the rpm from official fedora repo from here - https://apps.fedoraproject.org/packages/zlib

yum install https://kojipkgs.fedoraproject.org//packages/zlib/1.2.11/18.fc30/x86_64/zlib-1.2.11-18.fc30.x86_64.rpm

After proper testing above steps would be added the bahmni wiki.

3 Likes

Check if openMRS is already running

service openmrs status

If so, see if you can access bahmni from browser and check which components got installed

@angshuonline I installed Bahmni using the installer version 0.92-142 and upgraded zlib. Bahmni and ODOO works fine but /openmrs throws the following error

20-10-2019 04:42:01 [ERROR] PanelController - No panel concept found with uuid 552b32c8-13fa-459e-8757-992935ccde93
org.openmrs.module.emrapi.encounter.exception.ConceptNotFoundException: No panel concept found with uuid 552b32c8-13fa-459e-8757-992935ccde93
	at org.bahmni.module.referencedata.web.controller.PanelController.getPanel(PanelController.java:33)
	at sun.reflect.GeneratedMethodAccessor610.invoke(Unknown Source)

Has anyone seen this? Does it mean the default installation has some orders for which the concepts are not in the database?

@ramashish when do you get this error?

I get it on https://<ip>/openmrs

@ramashish,

My centos version: CentOS Linux release 7.7.1908 (Core) tying to install bahmni .92

Fixed zlib error by running command, yum install https://rpmfind.net/linux/fedora/linux/updates/30/Everything/x86_64/Packages/z/zlib-1.2.11-18.fc30.x86_64.rpm

but getting error,

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”}

command

service openmrs status

showing process running

Service openmrs is running with pid: 27456

but could not browse it.

Tried re-installation by running command

service openmrs stop

even tried by removing bahmni-emr

but could not proceed set up further still getting the same error.

can you please help me to understand what I am missing?