{"record":{"id":"c34a2faaacfcb2c9","repo":"windmill-labs/windmill","slug":"failed-to-fetch-version-response-status-resp","errorCode":null,"errorMessage":"Failed to fetch version: ${response.status} ${response.statusText}","messagePattern":"Failed to fetch version: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/core/context.ts","lineNumber":721,"sourceCode":"  const extraHeaders = getHeaders();\n  if (extraHeaders) {\n    for (const [key, value] of Object.entries(extraHeaders)) {\n      requestHeaders.set(key, value);\n    }\n  }\n\n  const versionUrl = new URL(new URL(baseUrl).origin + \"/api/version\");\n  const response = await fetch(versionUrl, {\n    headers: requestHeaders,\n    method: \"GET\",\n  });\n\n  await detectAuthGatewayChallenge(response, versionUrl.toString());\n\n  if (!response.ok) {\n    // Consume response body even on error to avoid resource leak\n    await response.text();\n    throw new Error(\n      `Failed to fetch version: ${response.status} ${response.statusText}`\n    );\n  }\n\n  return await response.text();\n}\nexport async function tryResolveVersion(\n  opts: GlobalOptions\n): Promise<number | undefined> {\n  if ((opts as any).__cache_version) {\n    return (opts as any).__cache_version;\n  }\n\n  const workspaceRes = await tryResolveWorkspace(opts);\n  if (workspaceRes.isError) return undefined;\n  const workspace = (workspaceRes as { isError: false; value: Workspace }).value;\n  const version = await fetchVersion(workspace.remote);\n","sourceCodeStart":703,"sourceCodeEnd":739,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/core/context.ts#L703-L739","documentation":"fetchVersion called GET <base>/api/version and received a non-OK HTTP status, so the CLI cannot determine the server version (used for compatibility checks). The input at fault is the base URL / server state, not local config content.","triggerScenarios":"Thrown at cli/src/core/context.ts:721 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the status code: 404 usually means --base-url points at the wrong path or a non-Windmill server.","Retry if 5xx — the server may be temporarily unhealthy.","Verify the instance is up and that any auth gateway in front of it forwards /api/version."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}