Skip to content

Conversation

@axilleastr
Copy link
Contributor

@axilleastr axilleastr commented Jan 28, 2026

fix: migrations: Fix database URL parsing in migrations CLI by URL-encoding credentials

Passwords containing special characters (/, @, :, #, etc.) were breaking
database URL parsing in the migrations CLI, causing connection failures
with errors like "invalid literal for int() with base 10".

Added quote_plus() encoding for username and password when constructing
tenant database URLs, matching the pattern already used in
src/steward/postgres.py and src/dormant/deletion.py.


Note

Low Risk
Small, localized change to connection-string building; primary risk is behavior change for previously-working edge cases, but it should only improve correctness for special characters.

Overview
Fixes tenant DB URL construction in the migrations CLI by introducing build_tenant_db_url() that URL-encodes usernames/passwords via quote_plus, preventing failures when credentials contain special characters.

All tenant operations (migrate/status/mark/reset, including parallel all-tenant runs) now use this helper instead of manual postgresql://user:pass@host:port/db string interpolation.

Written by Cursor Bugbot for commit f426478. This will update automatically on new commits. Configure here.

…coding credentials

Passwords containing special characters (/, @, :, #, etc.) were breaking
database URL parsing in the migrations CLI, causing connection failures
with errors like "invalid literal for int() with base 10".

Added quote_plus() encoding for username and password when constructing
tenant database URLs, matching the pattern already used in
src/steward/postgres.py and src/dormant/deletion.py.
@axilleastr axilleastr force-pushed the INFRA-2581-fix-db-url-parsing-for-tenant-dbs branch from e2ed8d7 to f426478 Compare January 28, 2026 23:38
@theonlyjohnny theonlyjohnny merged commit b8c6046 into main Jan 29, 2026
18 checks passed
@theonlyjohnny theonlyjohnny deleted the INFRA-2581-fix-db-url-parsing-for-tenant-dbs branch January 29, 2026 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants