jmaitrehenry opened a new issue, #40423:
URL: https://github.com/apache/superset/issues/40423
### Bug description
Error:
DetachedInstanceError: Parent instance <PermissionView at 0x...>
is not bound to a Session; lazy load of 'permission' cannot proceed
Also: DBEventLogger.log() missing 3 required positional arguments
Context:
- tool=list_dashboards
- user_id=None (possible auth/session issue)
- mcp_service/middleware logs the error but secondary logger also fails
### Screenshots/recordings
❯ export SUPERSET_MCP_TOKEN='xxxx'
❯ SESSION_ID=$(
curl -sS -D - \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-H "Authorization: Bearer $SUPERSET_MCP_TOKEN" \
-X POST 'https://xxxx/mcp' \
--data
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"clientInfo":{"name":"curl","version":"1.0.0"}}}'
\
| awk '/^Mcp-Session-Id:/ {print $2}' | tr -d '\r'
)
❯ curl -sS \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'MCP-Protocol-Version: 2025-06-18' \
-H "Authorization: Bearer $SUPERSET_MCP_TOKEN" \
-H "Mcp-Session-Id: $SESSION_ID" \
-X POST 'https://xxxx/mcp' \
--data
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_dashboards","arguments":{"request":{"page":1}}}}'
event: message
data:
{"method":"notifications/message","params":{"level":"info","data":{"msg":"Listing
dashboards: page=1, page_size=10, search=None","extra":null}},"jsonrpc":"2.0"}
event: message
data:
{"method":"notifications/message","params":{"level":"debug","data":{"msg":"Dashboard
listing filters: filters=0, order_column=None,
order_direction=asc","extra":null}},"jsonrpc":"2.0"}
event: message
data:
{"jsonrpc":"2.0","id":2,"result":{"content":[{"type":"text","text":"Error:
Internal error in list_dashboards: An unexpected error occurred. Error ID:
err_1779738544. Please contact support if this persists."}],"isError":false}}
### Superset version
master / latest-dev
### Python version
3.9
### Node version
Not applicable
### Browser
Not applicable
### Additional context
Docker image:
```
FROM apache/superset:6.1.0
USER root
RUN apt update && apt install -y gcc libpq-dev python3-dev pkg-config
default-libmysqlclient-dev && apt clean && rm -rf /var/lib/apt/lists/*
RUN uv pip install psycopg2-binary mysqlclient clickhouse-connect fastmcp
```
mcp_config:
import os
MCP_SERVICE_HOST = "0.0.0.0"
MCP_SERVICE_PORT = 5008
MCP_SERVICE_URL = "https://xxxxx"
MCP_AUTH_ENABLED = True
MCP_JWT_ALGORITHM = "HS256"
MCP_JWT_SECRET = os.environ.get("MCP_JWT_SECRET")
MCP_JWT_ISSUER = "xxx"
MCP_JWT_AUDIENCE = "superset-mcp"
MCP_DEV_USERNAME = os.environ.get("MCP_DEV_USERNAME")
MCP_STORE_CONFIG = {
"enabled": True,
"CACHE_REDIS_URL": "redis://superset-redis-headless:6379/1",
"event_store_max_events": 100,
"event_store_ttl": 3600,
}
Logs:
```
[superset-mcp-7d5d9894c4-dlljf] 2026-05-25T19:32:10.650358183Z 2026-05-25
19:32:10,650:ERROR:superset.mcp_service.middleware:Unexpected error
[err_1779737530] in list_dashboards: Parent instance <PermissionView at
0x7fbe85ffa350> is not bound to a Session; lazy load operation of attribute
'permission' cannot proceed (Background on this error at:
https://sqlalche.me/e/14/bhk3)
[superset-mcp-7d5d9894c4-dlljf] 2026-05-25T19:32:10.665464304Z 2026-05-25
19:32:10,665:INFO:superset.mcp_service.middleware:MCP tool call:
tool=list_dashboards, agent_id=None, user_id=None, method=tools/call,
dashboard_id=None, slice_id=None, dataset_id=None, duration_ms=70, success=False
```
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [x] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]