-
Notifications
You must be signed in to change notification settings - Fork 615
[BUG]: Reactivating gateway logs warning due to dict as Pydantic model #28
Copy link
Copy link
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededpythonPython / backend development (FastAPI)Python / backend development (FastAPI)
Milestone
Description
🐞 Bug Summary
When reactivating a previously deactivated gateway from the Admin UI, the backend logs the following warning:
WARNING - Failed to initialize reactivated gateway: 'dict' object has no attribute 'dict'
Despite the warning, the reactivation succeeds — the gateway is re-enabled and all associated tools are reactivated correctly.
🧩 Affected Component
-
mcpgateway– Backend (gateway reactivation logic) - Admin UI (HTMX)
- Federation or Transports
- CLI, Makefiles, or shell scripts
- Container setup (Docker/Podman/Compose)
🔁 Steps to Reproduce
- Go to Admin > Gateways
- Deactivate a gateway
- Enable "Show Inactive"
- Click "Activate" on the previously deactivated gateway
- Check logs
🤔 Expected Behavior
Reactivation should complete cleanly, and logs should not show any warnings or exceptions. If the code expects a Pydantic model (.dict()), it should validate or convert the input accordingly.
📓 Logs / Error Output
2025-06-02 15:11:18,459 - mcpgateway.services.gateway_service - WARNING - Failed to initialize reactivated gateway: 'dict' object has no attribute 'dict'
2025-06-02 15:11:18,471 - mcpgateway.services.tool_service - INFO - Tool echo activated
2025-06-02 15:11:18,477 - mcpgateway.services.tool_service - INFO - Tool get_current_time activated
🧩 Additional Context (optional)
The issue likely originates from this logic in gateway_service.toggle_gateway_status:
gateway.capabilities = capabilities.dict()…but capabilities is already a dictionary in this context. A simple type check or explicit model conversion should resolve this cleanly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfrontendFrontend development (HTML, CSS, JavaScript)Frontend development (HTML, CSS, JavaScript)good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededpythonPython / backend development (FastAPI)Python / backend development (FastAPI)