{"record":{"id":"c1cad985f947896c","repo":"different-ai/openwork","slug":"openwork-server-unavailable-connect-to-manage-imp","errorCode":null,"errorMessage":"OpenWork server unavailable. Connect to manage imported cloud marketplaces.","messagePattern":"OpenWork server unavailable\\. Connect to manage imported cloud marketplaces\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/state/extensions-store.ts","lineNumber":642,"sourceCode":"    } catch {\n      setStateField(\"importedCloudMarketplaces\", {});\n      setStateField(\"importedCloudPlugins\", {});\n      setStateField(\"pendingCloudPluginChanges\", {});\n      return {};\n    }\n  };\n\n  const persistImportedCloudMarketplaces = async (nextMarketplaces: Record<string, CloudImportedMarketplace>) => {\n    const config = await readWorkspaceOpenworkConfigRecord();\n    const cloudImports = readWorkspaceCloudImports(config);\n    const nextCloudImports = {\n      ...cloudImports,\n      marketplaces: nextMarketplaces,\n    };\n    const nextConfig = withWorkspaceCloudImports(config, nextCloudImports);\n    const persisted = await writeWorkspaceOpenworkConfigRecord(nextConfig);\n    if (!persisted) {\n      throw new Error(\"OpenWork server unavailable. Connect to manage imported cloud marketplaces.\");\n    }\n    setStateField(\"importedCloudMarketplaces\", nextMarketplaces);\n    void refreshPendingCloudPluginChanges();\n  };\n\n  const persistImportedCloudPlugins = async (nextPlugins: Record<string, CloudImportedPlugin>) => {\n    const config = await readWorkspaceOpenworkConfigRecord();\n    const cloudImports = readWorkspaceCloudImports(config);\n    const nextCloudImports = {\n      ...cloudImports,\n      plugins: nextPlugins,\n    };\n    const nextConfig = withWorkspaceCloudImports(config, nextCloudImports);\n    const persisted = await writeWorkspaceOpenworkConfigRecord(nextConfig);\n    if (!persisted) {\n      throw new Error(\"OpenWork server unavailable. Connect to manage imported cloud plugins.\");\n    }\n    setStateField(\"importedCloudPlugins\", nextPlugins);","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/state/extensions-store.ts#L624-L660","documentation":"When saving imported cloud marketplaces, createExtensionsStore persists the updated workspace config via writeWorkspaceOpenworkConfigRecord. That helper returns false when persistence is impossible (no desktop bridge for a local workspace and no OpenWork server connection). The store throws to prevent in-memory state from diverging from what would be lost on restart, telling the user to connect to the server.","triggerScenarios":"Adding/updating imported cloud marketplaces while writeWorkspaceOpenworkConfigRecord returns falsy: the workspace has an OpenWork target but the server is unreachable/not signed in, and the desktop local-write path doesn't apply (non-desktop runtime or no root).","commonSituations":"User signed out of OpenWork server/Den; server process stopped; network down; operating on a remote workspace without an active server connection; trying to manage cloud imports purely from web/mobile runtime.","solutions":["Connect to the OpenWork server (Account/Settings → sign in) and retry the marketplace import.","Verify network connectivity to the server endpoint.","If on desktop with a local workspace, ensure the desktop runtime and workspace root are detected so the local file write path is used.","Restart the app if the server connection state is stale."],"exampleFix":"// before\nconst persisted = await writeWorkspaceOpenworkConfigRecord(nextConfig);\nif (!persisted) {\n  throw new Error(\"OpenWork server unavailable. Connect to manage imported cloud marketplaces.\");\n}\n// after\nconst persisted = await writeWorkspaceOpenworkConfigRecord(nextConfig);\nif (!persisted) {\n  await requestServerConnection(); // prompt sign-in instead of a bare throw\n  return;\n}","handlingStrategy":"validation","validationCode":"const canPersist = isDesktopRuntime() && !!workspaceRoot;\nconst serverOk = canUseOpenworkServer && !!openworkClient;\nif (!canPersist && !serverOk) {\n  // show 'connect to server' prompt before attempting the import\n}","typeGuard":null,"tryCatchPattern":"try {\n  await importCloudMarketplace(id);\n} catch (err) {\n  if (err.message.includes(\"server unavailable\")) openServerConnectDialog();\n  else throw err;\n}","preventionTips":["Check server connection state before enabling cloud-import UI","Re-authenticate proactively when tokens near expiry","Disable import actions while offline with a visible reason"],"tags":["server-connection","cloud-marketplace","persistence","network"],"backgroundTag":"server-unavailable","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}