PostgreSQL upgrade fails when moving to 4.17.09

There are specific conditions which can arise when upgrading PostgreSQL from 4.16.xx to 4.17.09 which can cause the database update to fail

i.e the command

/opt/apigee/apigee-setup/bin/update.sh -c ps -f <filename>

The PG upgrade elents fails due to the fact that 'sudo' is used

The database migration fails causing a newly updated PG 9.4 server trying to startup with a database still on version 9.3. This will not work

Typically you'll see this error at the end of the output

lrwxrwxrwx 1 apigee apigee 46 Nov 9 05:35 pg_hba.conf -> /opt/apigee/apigee-postgresql/conf/pg_hba.conf lrwxrwxrwx 1 apigee apigee 50 
Nov 9 05:35 postgresql.conf -> /opt/apigee/apigee-postgresql/conf/postgresql.conf lrwxrwxrwx 1 apigee apigee 52 
Nov 6 21:00 recovery_conf.txt -> /opt/apigee/apigee-postgresql/conf/recovery_conf.txt apigee-configutil: apigee-postgresql: # OK apigee-service: apigee-postgresql: Not running (NO_LOCKFILE) apigee-service: apigee-postgresql: status=2, continuing apigee-service: apigee-postgresql: Not running (DEAD)
 apigee-service: apigee-postgresql: status=3, continuing apigee-service: apigee-postgresql: Not running (DEAD) 
apigee-service: apigee-postgresql: apigee-postgresql is dead Waiting for postgres to finish start psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/opt/apigee/var/run/apigee-postgresql/.s.PGSQL.5432"? Retrying in 5 sec (1)
 psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/opt/apigee/var/run/apigee-postgresql/.s.PGSQL.5432"? Retrying in 5 sec (2) psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/opt/apigee/var/run

This failure to start is preceded by

sudo: no tty present and no askpass program specified

As the script has no way of getting the password required (and the automated askpass program is not setup) a command is missed and upgrade of the DB files fails.

To recover

1. rollback the install using the backup made prior to the upgrade

2. Inline with the document link:https://docs.apigee.com/private-cloud/latest/installation-overview modify the /etc/sudoers file.

(see: Line "Creating a user with full sudo access to "apigee" user)

installUser      ALL=(apigee)      NOPASSWD: ALL

Usually the install user is 'apigee' but you may have your own username. Change as required.

3. Re-run the upgrade of the PG server.

Note: you can remove the entry from the sudoers file after the upgrade has completed.

Version history
Last update:
‎11-20-2017 04:45 AM
Updated by: