Running 'raas upgrade' results in an internal error "psycopg2.errors.DependentObjectsStillExist"
search cancel

Running 'raas upgrade' results in an internal error "psycopg2.errors.DependentObjectsStillExist"

book

Article ID: 369440

calendar_today

Updated On:

Products

VCF Operations/Automation (formerly VMware Aria Suite)

Issue/Introduction

Following an upgrade or Aria Config to v8.12.2 (el7 rpm), the OS was upgraded from RHEL7 to RHEL8.  The installer tarball for Aria Config 8.17 (el8 rpm) was used as an upgrade to match the OS version.  It's dependencies were installed and the configuration files restored as noted in the upgrade documentation.  When running 'raas upgrade' it encountered an internal error like"

[ERROR   ] An un-handled exception was caught by raas's global exception handler:
InternalError: (psycopg2.errors.DependentObjectsStillExist) cannot drop extension pgcrypto because other objects depend on it
DETAIL:  default value for column uuid of table commands_track depends on function public.gen_random_uuid()
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
CONTEXT:  SQL statement "DROP EXTENSION IF EXISTS pgcrypto"
PL/pgSQL function inline_code_block line 4 at SQL statement

Environment

Aria Automation Config v8.17, manually installed on separate servers on upgraded RHEL8 servers.  

Cause

As described in the error, the postgresql DB still had some objects in a table extension, which needed to be removed

Resolution

The table extension is safe to delete since the entries will be recreated post-upgrade.  Follow these steps to drop the objects:

  1. Log into the server hosting the postgresql DB as root, then switch user to postgres, 'su - postgres'
  2. Connect to the database with '\c raas_<TAB>' (The TAB button should automatically fill in the full name of the DB)
  3. Check the table for currently installed extensions: 'select * from pg_extension;'
  4. If there are extensions, use 'DROP EXTENSION IF EXISTS pgcrypto CASCADE;' to delete them (this is what the upgrade is trying to accomplish)
  5. Exit the database with '\q'
  6. Log out of the postgres account
  7. Run the 'raas upgrade' again