{"record":{"id":"edacee59fd0e9cad","repo":"langflow-ai/langflow","slug":"restored-version-contains-no-flow-data","errorCode":null,"errorMessage":"Restored version contains no flow data","messagePattern":"Restored version contains no flow data","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/frontend/src/hooks/flows/use-restore-version.ts","lineNumber":37,"sourceCode":"  const restore = useCallback(\n    async (\n      versionId: string,\n      options?: { saveDraft?: boolean; onSuccess?: () => void },\n    ) => {\n      const saveDraft = options?.saveDraft ?? true;\n      setIsRestoring(true);\n      try {\n        // --- Phase 1: API call + canvas application ---\n        // Errors here are shown to the user and abort the restore.\n        const response = await api.post(\n          `${getURL(\"FLOWS\")}/${flowId}/versions/${versionId}/activate`,\n          null,\n          { params: { save_draft: saveDraft } },\n        );\n        const updatedFlow = response.data;\n\n        if (!updatedFlow.data) {\n          throw new Error(\"Restored version contains no flow data\");\n        }\n\n        queryClient.invalidateQueries({ queryKey: [\"useGetFlowVersions\"] });\n        applyFlowToCanvas(updatedFlow);\n        // biome-ignore lint/suspicious/noExplicitAny: legacy\n      } catch (err: any) {\n        const apiDetail = err?.response?.data?.detail;\n        const message = apiDetail ?? err?.message ?? \"Unknown error\";\n        setErrorData({\n          title: t(\"errors.failedToRestoreVersion\"),\n          list: [message],\n        });\n        setIsRestoring(false);\n        return;\n      }\n\n      // --- Phase 2: Post-restore cleanup ---\n      // The restore succeeded. Errors here are logged but should not","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/src/frontend/src/hooks/flows/use-restore-version.ts#L19-L55","documentation":"Catch-all 500 at the end of the is-installed check: any exception outside the per-client inner try (which degrades gracefully to available:false) is logged ('Error checking MCP configuration') and wrapped. It usually means the failure happened at URL building or the project access step rather than in per-client config inspection.","triggerScenarios":"GET the install-check route when get_composer_streamable_http_url/get_composer_sse_url raise (e.g. missing oauth_host/oauth_port — see the composer URL ValueError), or verify_project_access fails with a non-HTTP exception.","commonSituations":"Project has OAuth auth_type but composer host/port were never populated in auth settings; partially written auth settings after a failed PATCH.","solutions":["Read the logged traceback under 'Error checking MCP configuration'.","If it is the composer URL error, complete the OAuth settings (host/port) via PATCH and retry.","Re-save the project's MCP auth settings so URL builders have all required fields."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"auth = project.auth_settings or {}\nif auth.get(\"auth_type\") == \"oauth\" and not (auth.get(\"oauth_host\") and auth.get(\"oauth_port\")):\n    print(\"complete OAuth host/port before checking install status\")","typeGuard":null,"tryCatchPattern":"except httpx.HTTPStatusError as e:\n    if e.response.status_code == 500 and \"checking MCP\" in e.response.json().get(\"detail\", \"\"):\n        verify_oauth_settings_complete(); retry_after_fix()","preventionTips":["Fully populate OAuth settings before using install-status endpoints.","After any failed settings PATCH, re-verify auth_settings completeness."],"tags":["mcp","install","http-500","catch-all"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}