Closed
Description
CKAN version
Master 713716b (2.9.something)
Describe the bug
DB usernames with non alphanum chars will terminate in error the command ckan db init
.
Steps to reproduce
Create a pg user with for instance a "@
" in it, then update ckan.ini
with the proper URL,
e.g.: user ckan@ckan
:
sqlalchemy.url = postgresql://ckan@ckan:ckan@localhost/ckan_at
Running ckan run
will not raise connection error (it won't find table, eventually).
Running ckan db init
will terminate with the error:
invalid interpolation syntax in 'postgresql://ckan%40ckan:ckan@localhost/ckan_at' at position 17
Expected behavior
The command should connect to the db without errors.
Additional details
At
Lines 268 to 270 in 713716b
self.metadata.bind.url
contains postgresql://ckan%40ckan:ckan@localhost/ckan_at
We could replace the line with
alembic_config.set_main_option(
"sqlalchemy.url", config.get("sqlalchemy.url")
)
Metadata
Assignees
Labels
No labels