{"record":{"id":"b229264101c4ffbc","repo":"different-ai/openwork","slug":"openwork-server-is-unavailable-reconnect-the-serv","errorCode":null,"errorMessage":"OpenWork server is unavailable. Reconnect the server before exporting workspace config.","messagePattern":"OpenWork server is unavailable\\. Reconnect the server before exporting workspace config\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/shell/session-route.tsx","lineNumber":1979,"sourceCode":"  const handleSaveShareRemoteAccess = useCallback(\n    async (enabled: boolean) => {\n      if (!isDesktopRuntime()) return;\n      await remoteAccessRestart.save(enabled);\n    },\n    [remoteAccessRestart],\n  );\n\n  const handleExportWorkspaceConfig = useCallback(\n    async (workspaceId: string) => {\n      const workspace = workspaces.find((item) => item.id === workspaceId) ?? null;\n      if (!workspace) return;\n      const endpoint = endpointForWorkspace(workspace);\n      if (endpoint) {\n        const payload = await endpoint.client.exportWorkspace(endpoint.workspaceId);\n        downloadWorkspaceJson(workspaceExportFilename(workspace), payload);\n        return;\n      }\n      throw new Error(\"OpenWork server is unavailable. Reconnect the server before exporting workspace config.\");\n    },\n    [endpointForWorkspace, workspaces],\n  );\n\n  const handleForgetWorkspace = useCallback(\n    async (workspaceId: string) => {\n      if (typeof window !== \"undefined\") {\n        const message =\n          t(\"workspace_list.remove_confirm\") ||\n          \"Remove this workspace from the sidebar?\";\n        if (!window.confirm(message)) return;\n      }\n      // Remove from both stores so the next refresh can't resurrect the row\n      // from whichever list wins the merge.\n      if (client) {\n        await client.deleteWorkspace(workspaceId).catch(() => undefined);\n      }\n      if (isDesktopRuntime()) {","sourceCodeStart":1961,"sourceCodeEnd":1997,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/shell/session-route.tsx#L1961-L1997","documentation":"handleExportWorkspace finds the endpoint for the chosen workspace and, only if one exists, exports the workspace JSON from the server and downloads it. When endpointForWorkspace returns null — no live server connection for that workspace — the export is aborted with this descriptive error instead of writing an empty/invalid file.","triggerScenarios":"Invoking workspace export (Share/Export workspace config) when endpointForWorkspace(workspace) yields null: the workspace runtime is disconnected, the server is stopped, or the workspace has no endpoint mapping.","commonSituations":"Exporting a workspace whose server was shut down; exporting right after app start before connection is established; remote workspace whose host is offline; exporting a cloud workspace while signed out.","solutions":["Reconnect the workspace's server (or start the local openwork-server) and retry the export","Verify the workspace entry in the workspaces list has a valid host/endpoint configuration","Export after the connection indicator shows connected; refresh the workspace list if it is stale"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const endpoint = endpointForWorkspace(workspace);\nif (!endpoint) {\n  notify(\"Reconnect the server before exporting workspace config.\");\n  return;\n}","typeGuard":"const hasEndpoint = (w: Workspace | undefined): boolean => !!endpointForWorkspace(w);","tryCatchPattern":"try {\n  await exportWorkspace(workspace.id);\n} catch (e) {\n  if (String(e.message).includes(\"server is unavailable\")) {\n    openConnectionDialog(workspace.id);\n  }\n}","preventionTips":["Enable the export action only when the endpoint is live","Reconnect servers automatically on app focus","Verify connection state before file-export flows"],"tags":["export","connection","workspace","server"],"backgroundTag":"server-not-connected","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}