Skip to content

Conversation

@ESnark
Copy link
Contributor

@ESnark ESnark commented Dec 2, 2025

πŸ› Bug-fix PR

Before opening this PR please:

  1. make lint - passes ruff, mypy, pylint
  2. make test - all unit + integration tests green
  3. make coverage - β‰₯ 90 %
  4. make docker docker-run-ssl or make podman podman-run-ssl
  5. Update relevant documentation.
  6. Tested with sqlite and postgres + redis.
  7. Manual regression no longer fails. Ensure the UI and /version work correctly.

πŸ“Œ Summary

Bootstrap script fails if DATABASE_URL contains % characters. #1533

πŸ” Reproduction Steps

  1. Set DATABASE_URL with a password containing %.
  2. Run the bootstrap script or start the application:
    python3 -m mcpgateway.bootstrap_db or python3 -m mcpgateway.

🐞 Root Cause

Alembic's Config.set_main_option() uses Python's configparser, which interprets % as interpolation syntax and raises InterpolationSyntaxError for URL-encoded characters like %40.

πŸ’‘ Fix Description

Escape % to %% before passing the URL to configparser.

πŸ§ͺ Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage β‰₯ 90 % make coverage
Manual regression no longer fails steps / screenshots

πŸ“ MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

βœ… Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

Signed-off-by: ESnark <31977180+ESnark@users.noreply.github.com>
@ESnark ESnark requested a review from crivetimihai as a code owner December 2, 2025 05:05
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.

1 participant