Installing Bahmni 0.92 Failed on postgres installation

postgres_repo_rpm_name: pgdg-redhat-repo-latest.noarch.rpm postgres_repo_download_url:{{postgres_repo_rpm_name}} postgres_repo_rpm_location: “{{download_folder}}/{{ postgres_repo_rpm_name}}”

@aldrin19 previously i got downloading postgresql error and i did the steps you said to change open the file “local” in /opt/bahmni-installer/bahmni-playbooks/group_vars and edit the value of these:

  1. postgres_repo_rpm_name:
  2. postgres_repo_download_url:

the value in default of that is no longer available so you have to change it to this:

  1. postgres_repo_rpm_name: pgdg-redhat-repo-latest.noarch.rpm
  2. postgres_repo_download_url: Index of /pub/repos/yum/reporpms/EL-7-x86_64/

after doing that i rerun the installation and not i am getting another error TASK [postgres : Install postgresql yum repository] **************************** task path: /opt/bahmni-installer/bahmni-playbooks/roles/postgres/tasks/main.yml: 9 An exception occurred during task execution. To see the full traceback, use -vvv . The error was: _rpm.error: error reading package header fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, "module_stderr ": “Traceback (most recent call last):\n File “/tmp/ansible_zcDE8U/ansible_mod”, line 1358, in \n main()\n File “/tmp/ansible_zcDE8U/a”, line 1349, in main\n skip_broken, security, params[‘i nstallroot’], allow_downgrade)\n File “/tmp/ansible_zcDE8U/ansible_module_yum. py”, line 1241, in ensure\n res = install(module, pkgs, repoq, yum_basecmd, conf_file, en_repos, dis_repos, installroot=installroot, allow_downgrade=allow_d owngrade)\n File “/tmp/ansible_zcDE8U/”, line 744, in in stall\n envra = local_envra(module, package)\n File “/tmp/ansible_zcDE8U/an”, line 610, in local_envra\n header = ts.hdrFromFdno(fd) \n File “/usr/lib64/python2.7/site-packages/rpm/”, line 170, in hdrFromFdno\n raise rpm.error(“error reading package header”)\n_rpm.error: error reading package header\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE”, “rc”: 0} to retry, use: --limit @/opt/bahmni-installer/bahmni-playbooks/all.retry

PLAY RECAP ********************************************************************* localhost : ok=159 changed=59 unreachable=0 failed=1

Please help me to solve the issues.

Did you solve the issue?

I’m getting the same error

@drss not yet :frowning:

postgres_repo_rpm_name: pgdg-redhat-repo-latest.noarch.rpm


postgres_repo_rpm_name: pgdg-redhat-repo-42.0-18.noarch.rpm

Basically, it tries to download the postgres rpm from there. You can manually. download the rpm and try installling as well.

  • Are you trying on a. fresh clean machine or an existing one? What. distribution of CentOS are you using? We typically start. from minimal distro.

  • Also, can you put the entire install log on a gist please?

  • Also check /bahmni_temp/logs/bahmni_deploy.log

  • What components are installed, have you checked whether EMR, Lab components are installed? -. if lab is installed, then postgres download and install is not the issue. Something else is.

  • And once installation fails, you may even try selectively trying out 1 component at a time. for example:

bahmni -i local --only bahmni-lab install


bahmni -i local --only bahmni-erp,bahmni-erp-connect install

I investigated on some of the issues reported, and this is what you can try

  1. For what @ghimirey is facing, its probably due to the variables set. Note the variables (either in setup.yml or in /opt/bahmni-installer/bahmni-playbooks/group_vars/local ) should be as follows:
postgrpostgres_repo_rpm_name: pgdg-redhat-repo-latest.noarch.rpm

  1. It seems like there is some reported signature check error as reported here. Which depending on commands/steps you take, can have different resolutions. But as of now, consider this:
  • Have the right variables as above in the file.
  • Check the directory /opt/ for pgdg repo rpm and delete any repo rpm files

ls -al /opt/*.rpm

rm /opt/pgdg-redhat-repo-latest.noarch.rpm

  • Clean up
yum remove pgdg-redhat-repo
yum clean metadata
  • Run the installer (you may want to use --only option to save you time). For example

bahmni -i local --only bahmni-lab install

basically, any component that requires postgres and its packages

Now, if the above command fails with error like "signature could not be verified for pgdg-common … ", then you can do couple of things

try to install any dependent package

yum install python-psycopg2

The above, may ask you to accept a bunch of gpg keys, accept.

  • If the above succeeds, proceed with the regular installation process

bahmni -i local --only bahmni-lab install

Alternaate option is as @rubailly said, edit the yum repo file for postges and disable gpgcheck

vi /etc/yum.repos.d/pgdg-redhat-all.repo

and under relevant group (e.g. [pgdg-common]), disable gpgcheck

repo_gpgcheck = 0

and then run bahmni installation. (I wouldn’t advise the alternative. And even if you do, turn them back on when you have managed to finish installation)

I will try to see if I can automate accepting the gpg keys. manually accepting the keys once seem to have worked for me.

If you are trying out the above, please post any other relevant findings here.

1 Like

in case, anyone facing this (signature check) on 0.92 or 0.93 … do the following

  1. Follow the above reply, ie. do things manually.

  2. or edit the file /opt/bahmni-installer/bahmni-playbooks/roles/postgres/tasks/main.yml. Find the line “yum: name=python-psycopg2 state=present” and replace like below

- name: Install python-psycopg2
  command: yum -y install python-psycopg2

1 Like

try this; go to /opt folder and delete the redhat rpms present download the repo manualy place the downloaded rpm in /opt folder re-run the installation command

1 Like

This has been resolved / fixed. Please see this post by @mohant: [FIX] Resolving Postgres Installation Errors

Documentation on wiki has also been updated. thanks!