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/schema.py", line 327, in run
main_schema.check(main_store)
File "/usr/lib/python3/dist-packages/storm/schema/schema.py", 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/exceptions.py", line 165, in wrap_exceptions
yield
File "/usr/lib/python3/dist-packages/storm/database.py", line 187, in wrapper
return attr(*args, **kwargs)
psycopg2.errors.ObjectNotInPrerequisiteState: database "landscape-resource-1" is not currently accepting connections
CONTEXT: parallel worker
if is_charm_deployment():
try:
ensure_no_other_connections(zstorm)
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
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): /landscape/ canonical/ landscape/ scripts/ schema. py", line 327, in run schema. check(main_ store) python3/ dist-packages/ storm/schema/ schema. py", line 143, in check sError( unapplied_ versions) schema. UnappliedPatche sError: [477, 478, 479, 480, 481, 482, 483]
File "/opt/canonical
main_
File "/usr/lib/
raise UnappliedPatche
storm.schema.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): python3/ dist-packages/ storm/exception s.py", line 165, in wrap_exceptions python3/ dist-packages/ storm/database. py", line 187, in wrapper errors. ObjectNotInPrer equisiteState: database "landscape- resource- 1" is not currently accepting connections
File "/usr/lib/
yield
File "/usr/lib/
return attr(*args, **kwargs)
psycopg2.
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 https:/ /git.launchpad. net/landscape/ tree/canonical/ landscape/ scripts/ schema. py?h=23. 03#n333
if is_charm_ deployment( ): no_other_ connections( zstorm)
try:
ensure_
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
https:/ /git.launchpad. net/landscape/ tree/canonical/ landscape/ schema/ connections. py?h=23. 03#n53