vCenter upgrade from 7.0 update 2 to update 3.0 fails with could not find function "archive_build_segment_list" in file "/opt/vmware/vpostgres/13/lib/pg_addons.so"
search cancel

vCenter upgrade from 7.0 update 2 to update 3.0 fails with could not find function "archive_build_segment_list" in file "/opt/vmware/vpostgres/13/lib/pg_addons.so"

book

Article ID: 318189

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

Symptoms:
  • While upgrading vCenter Server from 7.0 Update 3 you receive the following error in the VAMI UI
Exception ocurred in postinstallHook
  • Using the CLI to attempt the upgrade, the following error is seen

PostgreSQL failed to run upgrade command

  • The following error is seen in the /var/log/vmware/vpostgres/upgrade/pg_upgrade_server.log
ERROR:  could not find function "archive_build_segment_list" in file "/opt/vmware/vpostgres/13/lib/pg_addons.so"
STATEMENT:  CREATE FUNCTION "public"."archive_build_segment_list"("origin_tli" integer, "origin_lsn" "pg_lsn", "target_tli" integer, "target_lsn" "pg_lsn", "history_data" "text", OUT "wal_segs" "text") RETURNS SETOF "text"
            LANGUAGE "c"
            AS '$libdir/pg_addons', 'archive_build_segment_list';

 


Environment

VMware vCenter Server 7.0.3

Cause

This problem is caused by a faulty vpostgres extension which needs to be removed prior to upgrading.

Resolution

This issue is resolved in vCenter Server 7.0 Update 3c.

Workaround:
To workaround this issue, the pg_addons extension must be manually removed from the vCenter vPostgres instance.

Warning: This procedure makes changes to the vCenter Database. VMware highly recommends contacting VMware Support to execute these steps. Ensure you have working backups or powered-off snapshots of the vCenter (or ALL vCenters if in ELM mode) before continuing.
 
  1. Connect to the vCenter vPostgres instanace
/opt/vmware/vpostgres/current/bin/psql -U postgres
  1. Show all of the databases which reside in vPostgres
postgres=# SELECT datname FROM pg_database WHERE datallowconn ;
  datname
-----------
 postgres
 template1
 VCDB
(3 rows)
  1. Connect to each database and check if the extension exists. For example,the postgres db:
postgres=# \c "postgres"
You are now connected to database "VCDB" as user "postgres".
postgres=# \dx
                      List of installed extensions
   Name | Version | Schema | Description
-----------+---------+------------+-------------------------------------
 pg_addons | 0.2 | public | Set of extra utilities for Postgres
 plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
(2 rows)
  1. If the extension exists in the \dx output, remove it:
postgres=# DROP EXTENSION pg_addons ;
DROP EXTENSION
  1. Once the db_addons extension is removed from each database, retry the upgrade