bahmni-lab installation error

I had installed Bahmni 0.90 with OpenERP without bahmni-lab. Now I changed /opt/bahmni-installer/bahmni-playbooks/local file and kept localhost only for [bahmni-lab] and [bahmni-lab-db] and run bahmni -i local install.

It gives me error:

 TASK [installer-config : add bahmni configuration file] ************************ task path: 
 /opt/bahmni-installer/bahmni-playbooks/roles/installer-config/tasks/installer-config.yml:16

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": 
"AnsibleUndefinedVariable: list object has no element 0"}
1 Like

Hi @nawazshaikh, can you check you have bahmni.conf.j2 file in /opt/bahmni-installer/bahmni-playbooks/roles/installer-config/templates path in your Bahmni instance and it has all the key-value pairs mentioned in this file.

Yes, the file is in the specified path with all the required key-value pairs.

Traceback (most recent call last):
 File "/usr/bin/bahmni", line 9, in <module> load_entry_point('bahmni==0.1', 'console_scripts', 'bahmni')()
 File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 722, in __call__
 return self.main(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 1066, in  invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 895, in invoke
  return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/lib/python2.6/site-packages/bahmni-0.1-py2.6.egg/bahmni.py", line 91, in install
File "/usr/lib64/python2.6/subprocess.py", line 505, 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' -t  bahmni-lab' returned non-zero exit status 2

This is the rest of the error that I see on the screen

When I run bahmni version I see this

bahmni-emr.noarch 0.90-496
bahmni-erp.noarch 0.90-39
bahmni-erp-connect.noarch 0.90-39
bahmni-event-log-service.noarch 0.90-32
bahmni-implementer-interface.noarch 0.90-91
bahmni-installer.noarch 0.90-302
bahmni-lab.noarch 0.90-36
bahmni-lab-connect.noarch 0.90-496
bahmni-offline.noarch 0.90-161
bahmni-openmrs.noarch 0.90-46
bahmni-reports.noarch 0.90-40
bahmni-web.noarch 0.90-496

Surprisingly it is listing bahmni-lab So I checked service bahmni-lab status and it shows that also running. But psql -Uclinlims clinlims fails.

Does it mean it got halfway installed ie without database?

but when I check URL ip/openelis it throws 404

I tried yum remove -y bahmni-lab and then reinstalled but still the same error

yes…that might be the reason. Then you have to drop the elis database, remove bahmni-lab and then trigger the installer.

I tried that pl check my replies

can you please confirm that you have dropped elis database before running yum remove bahmni-lab command ??

As mentioned earlier clinlims database was not installed at all.

This is what I did finally, kept localhost for emr, erp along with lab and it run the installation. It installed bahmni-lab but now it fails at

TASK [pgbackrest-install : Creating postgres stanza] ***************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "sudo -u postgres pgbackrest --stanza=bahmni-postgres --log-level-console=info stanza-create", "delta": "0:00:03.355167", "end": "2018-05-03 12:10:05.286192", "failed": true, "rc": 101, "start": "2018-05-03 12:10:01.931025", "stderr": "", "stdout": "2018-05-03 12:10:03.849 P00   INFO: stanza-create command begin 1.12: --db-path=/var/lib/pgsql/9.2/data --log-level-console=info --repo-path=/var/lib/pgbackrest --stanza=bahmni-postgres\n2018-05-03 12:10:04.762 P00  ERROR: [101]: /var/lib/pgbackrest/archive/bahmni-postgres/archive.info checksum is invalid, should be 80df185eb931c88f66125d68c0d22aeba5a4a0f5 but found af0d8393952932ce94bc8897feff8d1a4ad55666\n2018-05-03 12:10:04.800 P00   INFO: stanza-create command end: aborted with exception [101]", "stdout_lines": ["2018-05-03 12:10:03.849 P00   INFO: stanza-create command begin 1.12: --db-path=/var/lib/pgsql/9.2/data --log-level-console=info --repo-path=/var/lib/pgbackrest --stanza=bahmni-postgres", "2018-05-03 12:10:04.762 P00  ERROR: [101]: /var/lib/pgbackrest/archive/bahmni-postgres/archive.info checksum is invalid, should be 80df185eb931c88f66125d68c0d22aeba5a4a0f5 but found af0d8393952932ce94bc8897feff8d1a4ad55666", "2018-05-03 12:10:04.800 P00   INFO: stanza-create command end: aborted with exception [101]"], "warnings": ["Consider using 'become', 'become_method', and 'become_user' rather than running sudo"]}
    to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

but I think it can be fixed by matching the checksum in backup.info

Do you think the complete installation overwrites all my files/databases (EMR and ERP)?

Also does it mean that there is a bug that if keep localhost entry only for one app then it fails?

no… complete installation doesn’t change database but it overwrites the config parameters.

No…i don’t see that. You can have each module installed on a separate machine.