Comment 0 for bug 2019828

Revision history for this message
Diko Parvanov (dparv) wrote :

Running a migration from 19.10, bionic, pgsql 10 to 23.03, pgsql 12, focal trying to run the /usr/bin/landscape-schema script fails with exceptions that all dbs are "not currently accepting connections", as in:

Traceback (most recent call last):
  File "/opt/canonical/landscape/canonical/landscape/scripts/", line 327, in run
  File "/usr/lib/python3/dist-packages/storm/schema/", line 143, in check
    raise UnappliedPatchesError(unapplied_versions)
storm.schema.schema.UnappliedPatchesError: [477, 478, 479, 480, 481, 482, 483]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/storm/", line 165, in wrap_exceptions
  File "/usr/lib/python3/dist-packages/storm/", line 187, in wrapper
    return attr(*args, **kwargs)
psycopg2.errors.ObjectNotInPrerequisiteState: database "landscape-resource-1" is not currently accepting connections
CONTEXT: parallel worker

seems that if it's charm installed (and in my case it is), the following code is ran locking all dbs in

if is_charm_deployment():

but because there are no connections made to any db prior to that (my testing indicates that with SELECT * FROM pg_stat_activity), next part of the code never gets executed: allow_further_connections(zstorm), as activity_result.rowcount is always 0