Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/en_US/release_notes_9_16.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ Bug fixes
| `Issue #9939 <https://github.com/pgadmin-org/pgadmin4/issues/9939>`_ - Fix saving a newly-added row in the Query Tool failing when the result set includes expression or alias columns that are not real columns of the underlying table.
| `Issue #9976 <https://github.com/pgadmin-org/pgadmin4/issues/9976>`_ - Fix a startup migration crash (NoSuchTableError) when an old configuration database contains a stale foreign-key reference.
| `Issue #9984 <https://github.com/pgadmin-org/pgadmin4/issues/9984>`_ - Fix the Docker entrypoint mishandling a quoted PGADMIN_CONFIG_CONFIG_DATABASE_URI, which caused a SQLAlchemy parse error and silently skipped PGADMIN_DEFAULT_EMAIL/PASSWORD setup.
| `Issue #10052 <https://github.com/pgadmin-org/pgadmin4/issues/10052>`_ - Fix a crash when checking an unreachable external configuration database, so first-launch setup proceeds instead of erroring.
12 changes: 7 additions & 5 deletions web/pgadmin/utils/check_external_config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ def check_external_config_db(database_uri):
"""
engine = create_engine(database_uri)
try:
connection = engine.connect()
if inspect(engine).has_table("server"):
return True
return False
# The context manager closes the connection on every path. The
# previous "finally: connection.close()" raised NameError when
# engine.connect() itself failed (e.g. an unreachable database),
# masking the intended "return False".
Comment on lines +20 to +23
with engine.connect():
return inspect(engine).has_table("server")
Comment on lines +24 to +25
except Exception:
return False
finally:
connection.close()
engine.dispose()
Loading