{"record":{"id":"ed153018422546a3","repo":"windmill-labs/windmill","slug":"export-res-status-text","errorCode":null,"errorMessage":"export ${res.status}: ${text}","messagePattern":"export (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/importWizard/execution.svelte.ts","lineNumber":320,"sourceCode":"\t\tthis.#set('create', 'done')\n\t\treturn d.id\n\t}\n\n\tasync #ensureExport(workspace: string): Promise<ProjectExport | undefined> {\n\t\tif (this.#export) {\n\t\t\tthis.#set('fetch', 'done')\n\t\t\treturn this.#export\n\t\t}\n\t\tthis.#set('fetch', 'running')\n\t\ttry {\n\t\t\t// Workspace-scoped on purpose: this is the same proxy the rest of the app\n\t\t\t// uses, so a private hub reachable only from the server still works.\n\t\t\tconst res = await fetch(\n\t\t\t\t`/api/w/${encodeURIComponent(workspace)}/hub/projects/${encodeURIComponent(this.#plan.slug)}/export`,\n\t\t\t\t{ credentials: 'include', headers: { accept: 'application/json' } }\n\t\t\t)\n\t\t\tconst text = await res.text()\n\t\t\tif (!res.ok) throw new Error(`export ${res.status}: ${text}`)\n\t\t\tthis.#export = JSON.parse(text) as ProjectExport\n\t\t\tthis.#set('fetch', 'done', `${itemCount(this.#export)} items`)\n\t\t\treturn this.#export\n\t\t} catch (e: any) {\n\t\t\tconst detail = e?.message ?? String(e)\n\t\t\tthis.#set('fetch', 'failed', detail)\n\t\t\tthis.error = `Could not read the project: ${detail}`\n\t\t\treturn undefined\n\t\t}\n\t}\n\n\t/**\n\t * Leave the checklist saying what actually happened, from wherever the run stopped.\n\t *\n\t * Reached from every point after `import` goes `running`, so nothing is left spinning on a\n\t * run that has ended. A partial import is failed rather than done: calling it done reports\n\t * a clean import over items that never started, and the resumed step offers Continue where\n\t * it should offer Retry.","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/importWizard/execution.svelte.ts#L302-L338","documentation":"#ensureExport in the import wizard's execution store fetches the full project export through the server-side proxy endpoint `/api/w/<workspace>/hub/projects/<slug>/export` (credentials included, so a private hub reachable from the server works). On a non-OK response it throws `export <status>: <body text>` and marks the fetch step 'failed'. The embedded body text is the server's own error detail.","triggerScenarios":"exportData drives the wizard; the backend proxy to the hub returns non-200 — hub project missing (404), hub unreachable from the server (502/500), auth issue on the workspace endpoint (401/403), or hub 5xx.","commonSituations":"Private hub reachable only from the server but misconfigured (wrong hub URL on the backend); slug exists in the UI but not on the hub the server talks to; expired session (401) if credentials aren't sent; hub rate limiting.","solutions":["Read the body text appended to the message — it contains the server's upstream error detail.","Confirm the hub project slug exists and the backend's hub configuration points at the right hub.","Re-login if the status is 401/403 so the cookie credentials are valid.","Retry on 5xx; check hub availability and backend logs for the proxy error."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const ping = await fetch(`/api/w/${workspace}/hub/projects/${slug}/export`, { method: 'HEAD', credentials: 'include' })\nif (ping.status === 401) redirectLogin()\nif (ping.status === 404) alert('project not found on the hub configured for this server')","typeGuard":null,"tryCatchPattern":"try {\n  await wizard.exportData()\n} catch (e) {\n  wizard.set('fetch', 'failed', e.message) // message already includes status + body\n  const status = /^export (\\d+)/.exec(e.message)?.[1]\n  if (status === '401') promptReLogin()\n  else if (status?.startsWith('5')) offerRetry()\n}","preventionTips":["Keep the session cookie fresh during long wizard sessions.","Confirm the backend hub configuration matches the hub the UI browses.","Prefer server-proxied export (as implemented) when the hub is private."],"tags":["http","proxy","hub","export"],"backgroundTag":"http-request-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}