langflow-ai/langflow · error · Error
Failed to load models. Please check your provider credential
Error message
Failed to load models. Please check your provider credentials.
What it means
Catch-all 500 from the Streamable HTTP transport handler for a project MCP server. Any non-HTTPException raised by project_server.session_manager.handle_request is logged (with traceback) and replaced by this opaque message, so the real cause only exists in the logs.
Source
Thrown at src/frontend/src/controllers/API/queries/deployments/use-get-deployment-llms.ts:30
interface GetDeploymentLlmsParams {
providerId: string;
}
const STALE_TIME = 1000 * 60 * 1; // 1 minute
export const useGetDeploymentLlms: useQueryFunctionType<
GetDeploymentLlmsParams,
DeploymentLlmListResponse
> = ({ providerId }, options) => {
const { query } = UseRequestProcessor();
const getDeploymentLlmsFn = async (): Promise<DeploymentLlmListResponse> => {
const response = await api.get<DeploymentLlmListResponse>(
`${getURL("DEPLOYMENTS")}/llms`,
{ params: { provider_id: providerId } },
);
if (!response) {
throw new Error(
"Failed to load models. Please check your provider credentials.",
);
}
return response.data;
};
return query(["useGetDeploymentLlms", { providerId }], getDeploymentLlmsFn, {
...options,
retry: false,
staleTime: STALE_TIME,
});
};
View on GitHub (pinned to 976ec789d2)
Solutions
- Grep server logs for 'Error handling Streamable HTTP request for project' — the original traceback is there.
- Have the client re-initialize (new session) instead of resuming an old Mcp-Session-Id.
- Verify client and server MCP SDK versions are compatible (mcp_sdk_constraint_args pins the server side).
- If the body is hand-rolled, ensure it is valid JSON-RPC 2.0 with a known method.
Defensive patterns
Strategy: try-catch
Try / catch
try:
resp = await client.request(method, streamable_url, json=body)
except httpx.HTTPStatusError as e:
if e.response.status_code == 500:
drop_session_id_and_reinitialize() # the log has the cause; client must re-init Prevention
- Drop the stored Mcp-Session-Id whenever the server restarts (watch for shutdown events).
- Keep MCP client SDK version aligned with the server's pinned SDK constraints.
- Never reuse initialize handshake payloads across sessions.
When it happens
Trigger: GET/POST/DELETE on the project streamable-HTTP MCP route when the session manager rejects an unknown/expired session id, the request body is malformed JSON-RPC, or the transport state for that project was reset (restart, composer recycle).
Common situations: MCP client resumes a session after a backend restart; concurrent connections racing the transport; malformed initialize request from a client speaking a different MCP revision.
Related errors
- Internal server error in Streamable HTTP transport
- HTTP error! status: ${response.status}
- Failed to reload bundle
- Failed to download files: ${response.statusText}
- Failed to download flows: ${response.statusText}
AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14).
Data as JSON: /api/errors/ede8bb798fd6b2f9.
Report an issue: GitHub.