different-ai/openwork · error · Error
OpenWork server is unavailable. Reconnect the server before
Error message
OpenWork server is unavailable. Reconnect the server before exporting workspace config.
What it means
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.
Source
Thrown at apps/app/src/react-app/shell/session-route.tsx:1979
const handleSaveShareRemoteAccess = useCallback(
async (enabled: boolean) => {
if (!isDesktopRuntime()) return;
await remoteAccessRestart.save(enabled);
},
[remoteAccessRestart],
);
const handleExportWorkspaceConfig = useCallback(
async (workspaceId: string) => {
const workspace = workspaces.find((item) => item.id === workspaceId) ?? null;
if (!workspace) return;
const endpoint = endpointForWorkspace(workspace);
if (endpoint) {
const payload = await endpoint.client.exportWorkspace(endpoint.workspaceId);
downloadWorkspaceJson(workspaceExportFilename(workspace), payload);
return;
}
throw new Error("OpenWork server is unavailable. Reconnect the server before exporting workspace config.");
},
[endpointForWorkspace, workspaces],
);
const handleForgetWorkspace = useCallback(
async (workspaceId: string) => {
if (typeof window !== "undefined") {
const message =
t("workspace_list.remove_confirm") ||
"Remove this workspace from the sidebar?";
if (!window.confirm(message)) return;
}
// Remove from both stores so the next refresh can't resurrect the row
// from whichever list wins the merge.
if (client) {
await client.deleteWorkspace(workspaceId).catch(() => undefined);
}
if (isDesktopRuntime()) {View on GitHub (pinned to 2b7df46e8a)
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
Defensive patterns
Strategy: validation
Validate before calling
const endpoint = endpointForWorkspace(workspace);
if (!endpoint) {
notify("Reconnect the server before exporting workspace config.");
return;
} Type guard
const hasEndpoint = (w: Workspace | undefined): boolean => !!endpointForWorkspace(w);
Try / catch
try {
await exportWorkspace(workspace.id);
} catch (e) {
if (String(e.message).includes("server is unavailable")) {
openConnectionDialog(workspace.id);
}
} Prevention
- Enable the export action only when the endpoint is live
- Reconnect servers automatically on app focus
- Verify connection state before file-export flows
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Workspace runtime is not connected.
- OpenWork server unavailable.
- app.error_connect_first
- app.error_connect_first
- OpenWork server has no workspace matching ${directory}.
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/b229264101c4ffbc.
Report an issue: GitHub.