Skip to content

incorrect use of PGADMIN_CONFIG_CONFIG_DATABASE_URI in entrypoint.sh #9984

Description

@domfe

Please note that security bugs or issues should be reported to security@pgadmin.org.

Describe the bug

I have an error when starting pgadmin container (dpage/pgadmin:9.15.0).

`
Traceback (most recent call last):
File "", line 1, in
from check_external_config_db import check_external_config_db; val = check_external_config_db("'postgresql+psycopg://user:pass@localhost:5432/pgadmin'"); print(val)

File "/pgadmin4/pgadmin/utils/check_external_config_db.py", line 18, in check_external_config_db
engine = create_engine(database_uri)
File "", line 2, in create_engine
File "/venv/lib/python3.14/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned
return fn(*args, **kwargs) # type: ignore[no-any-return]
File "/venv/lib/python3.14/site-packages/sqlalchemy/engine/create.py", line 564, in create_engine
u = _url.make_url(url)
File "/venv/lib/python3.14/site-packages/sqlalchemy/engine/url.py", line 856, in make_url
return _parse_url(name_or_url)
File "/venv/lib/python3.14/site-packages/sqlalchemy/engine/url.py", line 922, in _parse_url
raise exc.ArgumentError(
"Could not parse SQLAlchemy URL from given URL string"
)
sqlalchemy.exc.ArgumentError: Could not parse SQLAlchemy URL from given URL string
`

The check for PGADMIN_CONFIG_CONFIG_DATABASE_URI in entrypoint.sh is incorrect.
The line 153 put double quotes around environment variable but the var should be specified with single quotes for correct generation of config_distro.py.

external_config_db_exists=$(cd /pgadmin4/pgadmin/utils && $SU_EXEC /venv/bin/python3 -c "from check_external_config_db import check_external_config_db; val = check_external_config_db(\"${PGADMIN_CONFIG_CONFIG_DATABASE_URI}\"); print(val)")

The error doesn't prevent the start of pgadmin.

To Reproduce

Steps to reproduce the behavior:

  1. configure PGADMIN_CONFIG_CONFIG_DATABASE_URI
  2. start container
  3. check container log

Expected behavior

No error reported

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions