langflow-ai/langflow · error · Error

Failed to load models. Please check your provider…

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.

Solutions

  1. Grep server logs for 'Error handling Streamable HTTP request for project' — the original traceback is there.
  2. Have the client re-initialize (new session) instead of resuming an old Mcp-Session-Id.
  3. Verify client and server MCP SDK versions are compatible (mcp_sdk_constraint_args pins the server side).
  4. 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

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


AI-assisted analysis of langflow-ai/langflow@976ec789d2 (2026-08-14). Data as JSON: /api/errors/ede8bb798fd6b2f9. Report an issue: GitHub.

Appendix: 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)