{"record":{"id":"f4420cc409e18ebe","repo":"windmill-labs/windmill","slug":"the-hub-proxy-answered-res-status","errorCode":null,"errorMessage":"the hub proxy answered ${res.status}","messagePattern":"the hub proxy answered (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/ImportSetupStep.svelte","lineNumber":267,"sourceCode":"\t\tabsent: boolean,\n\t\tprev: Row | undefined\n\t): Promise<Row['status']> {\n\t\tif (absent) return 'unconfigured'\n\t\tconst applied = await probeMigrationsApplied(workspace, name, ms)\n\t\tif (applied === true) return 'done'\n\t\tif (applied === false) return prev?.status === 'failed' ? 'failed' : 'unconfigured'\n\t\treturn prev?.status === 'failed' ? 'failed' : 'unknown'\n\t}\n\n\t/** Which data tables the project needs that the destination does not have yet. */\n\tasync function load() {\n\t\tloading = true\n\t\tloadError = undefined\n\t\ttry {\n\t\t\tconst res = await fetch(\n\t\t\t\t`/api/w/${encodeURIComponent(workspace)}/hub/projects/${encodeURIComponent(slug)}/export`\n\t\t\t)\n\t\t\tif (!res.ok) throw new Error(`the hub proxy answered ${res.status}`)\n\t\t\tconst exportData = (await res.json()) as ProjectExport\n\t\t\tconst enabled = (exportData.migrations ?? []).filter(\n\t\t\t\t(m) => m.enabled && (m.sql ?? '').trim() !== ''\n\t\t\t)\n\t\t\t// Kept, not just counted: which data tables the destination has decides whether a\n\t\t\t// row can retry its migrations or has to go back through the wizard, and after a\n\t\t\t// reload this call is the only thing that knows. Drop it and such a row offers the\n\t\t\t// wizard, which then refuses the name it created itself.\n\t\t\tconst tables = await WorkspaceService.listDataTables({ workspace })\n\t\t\tconfiguredNames = tables.map((t) => ({ name: t.name, resourcePath: t.resource_path }))\n\t\t\tconst present = new Set(tables.map((d) => d.name))\n\t\t\tconst missing = [...new Set(enabled.map((m) => m.datatable_name))].filter(\n\t\t\t\t(n) => !present.has(n)\n\t\t\t)\n\t\t\tconst previous = new Map(rows.map((r) => [r.name, r]))\n\t\t\trows = await Promise.all(\n\t\t\t\t[...new Set(enabled.map((m) => m.datatable_name))].map(async (name) => {\n\t\t\t\t\tconst ms = enabled.filter((m) => m.datatable_name === name)","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/ImportSetupStep.svelte#L249-L285","documentation":"ImportSetupStep fetches a hub project export through the workspace's hub proxy endpoint. Any non-2xx response from the proxy (auth failure, hub unreachable, unknown project slug) is converted into this Error, so the UI shows the raw HTTP status rather than a silent failure.","triggerScenarios":"fetch(`/api/w/<workspace>/hub/projects/<slug>/export`) returns res.ok === false — e.g. 404 when the hub slug does not exist, 401/403 on expired credentials, or 502/504 when the hub proxy cannot reach the hub.","commonSituations":"Typo in the imported project slug; the hub project was renamed or deleted; the workspace's hub token expired; network/proxy outage between the Windmill backend and hub.windmill.dev.","solutions":["Check the reported HTTP status: 404 means the slug is wrong or the project no longer exists — verify the slug on the hub","401/403: re-authenticate the workspace against the hub (re-link credentials) and retry","5xx/502: retry later; check hub.windmill.dev availability and backend logs for proxy errors","Verify network egress from the Windmill backend instance to the hub"],"exampleFix":"// before\nconst res = await fetch(`/api/w/${workspace}/hub/projects/${slug}/export`)\nif (!res.ok) throw new Error(`the hub proxy answered ${res.status}`)\n// after\nconst res = await fetch(`/api/w/${workspace}/hub/projects/${slug}/export`)\nif (!res.ok) {\n  const detail = await res.text().catch(() => '')\n  throw new Error(`Hub export failed (${res.status}): ${detail || res.statusText}`)\n}","handlingStrategy":"try-catch","validationCode":"// before loading, check the slug is a plausible string\nif (!slug || typeof slug !== 'string') throw new Error('Missing hub project slug')","typeGuard":"function isOkResponse(res: Response): boolean { return res.ok }","tryCatchPattern":"try {\n  const res = await fetch(`/api/w/${workspace}/hub/projects/${slug}/export`)\n  if (!res.ok) throw new Error(`the hub proxy answered ${res.status}`)\n  const exportData = await res.json()\n} catch (e) {\n  loadError = String(e.message)\n  sendUserToast(`Hub project export failed: ${e.message}`, true)\n}","preventionTips":["Validate the project slug against the hub before running the import wizard","Re-authenticate hub credentials before long import sessions","Check instance egress to the hub when running behind restrictive firewalls"],"tags":["http","network","hub-proxy","wizard"],"backgroundTag":"http-error-response","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}