Red Hat Satellite 5.7 to 5.8 upgrade failing on database migration step

Solution Verified - Updated -

Environment

  • Red Hat Satellite 5.7
  • Embedded PostgreSQL database

Issue

  • Red Hat Satellite 5.7 to 5.8 upgrade failing with below error:
** Upgrading embedded database.
There was a problem during embedded database upgrade.
  Exit value: 1.
Please examine /var/log/rhn/rhn_installation.log for more information

This is from the installation.log
Complete!
/etc/init.d/rh-postgresql95-postgresql: line 43: /opt/rh/rh-postgresql95/root/usr/share/postgresql-setup/library.sh: No such file or directory
/usr/bin/scl_source: line 63: /opt/rh/rh-postgresql95/enable: No such file or directory
Can't source enable, skipping.
Stopping rh-postgresql95-postgresql service: [  OK  ]
Starting postgresql92-postgresql service: [  OK  ]
Stopping postgresql92-postgresql service: [  OK  ]
warning: /opt/rh/rh-postgresql95//enable scriptlet does not exist!
  • The spacewalk-upgrade-postgresql command fails with similar error.

Resolution

NOTE: Take a backup/snapshot of the satellite server.

  • Make sure the satellite is still on postgresql92:
# rpm -qa | grep postgresql92  --> should list 92 packages
# spacewalk-sql -i             --> should list server version 9.2
  • Reinstall all rh-postgresql95 packages:
# yum reinstall rh-postgresql95-postgresql rh-postgresql95-runtime rh-postgresql95-postgresql-pltcl rh-postgresql95-postgresql-server rh-postgresql95-postgresql-libs rh-postgresql95-postgresql-contrib
  • Re-run the upgrade command.

Diagnostic Steps

  • Complete traceback:
# spacewalk-upgrade-postgresql 
/etc/init.d/rh-postgresql95-postgresql: line 43: /opt/rh/rh-postgresql95/root/usr/share/postgresql-setup/library.sh: No such file or directory
/usr/bin/scl_source: line 63: /opt/rh/rh-postgresql95/enable: No such file or directory
Can't source enable, skipping.
Stopping rh-postgresql95-postgresql service:               [  OK  ]
Starting postgresql92-postgresql service:                  [  OK  ]
Stopping postgresql92-postgresql service:                  [  OK  ]
warning: /opt/rh/rh-postgresql95//enable scriptlet does not exist!
  • Database check:
# spacewalk-sql -i
psql (8.4.20, server 9.2.10)
WARNING: psql version 8.4, server version 9.2.
         Some psql features might not work.
Type "help" for help.

# rpm -qa | grep postgresql92
postgresql92-postgresql-9.2.10-2.el6.x86_64
postgresql92-postgresql-pltcl-9.2.10-2.el6.x86_64
postgresql92-postgresql-contrib-9.2.10-2.el6.x86_64
postgresql92-postgresql-libs-9.2.10-2.el6.x86_64
postgresql92-postgresql-server-9.2.10-2.el6.x86_64
postgresql92-runtime-1.1-21.el6.x86_64

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.