Description
When generating an MCP URL via the Composio SDK using a valid API key and server ID, the API
returns a 401 Unauthorized error. The actual root cause is an internal Redis Cluster slot
allocation error, not an authentication failure.
Request Details
- Server ID: b55dbc24-9e19-42f9-8906-8dd999d57dd0
- Service: google_calendar
- Operation: composio.mcp.generate(userId, serverId, { connectedAccountIds })
Error Response
{
"error": {
"message": "Redis error: All keys in the pipeline should belong to the same slots
allocation group",
"code": 10401,
"slug": "HTTP_Unauthorized",
"status": 401,
"request_id": "ce95f922-9185-4a6a-b2d7-e375525e3367",
"suggested_fix": "Please check you are using a valid API key."
}
}
Issues
1. Incorrect HTTP status code — A Redis infrastructure error is being returned as 401
Unauthorized. This should be a 500 Internal Server Error or 503 Service Unavailable.
2. Misleading error message — "Please check you are using a valid API key" sends developers on
a wild goose chase when the API key is valid. The actual problem is server-side Redis key
routing.
3. Redis Cluster misconfiguration — The error "All keys in the pipeline should belong to the
same slots allocation group" indicates that a Redis pipeline operation is targeting keys that
hash to different cluster slots. This typically means multi-key operations need {hash_tag}
prefixes to co-locate keys on the same shard.
Expected Behavior
- Internal infrastructure errors should return 5xx status codes, not 401
- The error message should not suggest API key issues when the root cause is server-side
- Redis pipeline operations should use hash tags to ensure slot co-location
Impact
- Intermittent failures on MCP URL generation for connected services
- Breaks agent tool loading at chat time for affected users
- Misleading error makes debugging difficult on the integrator side