{"record":{"id":"23aec33487f5694f","repo":"windmill-labs/windmill","slug":"sse-request-failed-response-status-response","errorCode":null,"errorMessage":"SSE request failed: ${response.status} ${response.statusText}","messagePattern":"SSE request failed: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/dev.ts","lineNumber":1977,"sourceCode":"  baseUrl: string,\n  token: string,\n): Promise<void> {\n  const sseUrl =\n    `${baseUrl}api/w/${workspace}/jobs_u/getupdate_sse/${jobId}?fast=true`;\n\n  const extraHeaders = getHeaders();\n  const response = await fetch(sseUrl, {\n    headers: {\n      Accept: \"text/event-stream\",\n      Authorization: `Bearer ${token}`,\n      ...extraHeaders,\n    },\n  });\n\n  await detectAuthGatewayChallenge(response, sseUrl);\n\n  if (!response.ok) {\n    throw new Error(\n      `SSE request failed: ${response.status} ${response.statusText}`,\n    );\n  }\n\n  const reader = response.body?.getReader();\n  if (!reader) {\n    throw new Error(\"No response body for SSE stream\");\n  }\n\n  const decoder = new TextDecoder();\n  let buffer = \"\";\n\n  try {\n    while (true) {\n      const { done, value } = await reader.read();\n      if (done) break;\n\n      buffer += decoder.decode(value, { stream: true });","sourceCodeStart":1959,"sourceCodeEnd":1995,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/dev.ts#L1959-L1995","documentation":"HTTP-level guard in the dev server's SSE job-watch helper: the fetch to /api/w/{workspace}/jobs_u/getupdate_sse/{jobId} returned a non-2xx status (the message embeds status and status text). Because detectAuthGatewayChallenge already ran, an auth-portal redirect was excluded — so this is a genuine API error: expired/invalid token (401), missing permissions (403), unknown job id (404) or a server error. The faulting input is the authenticated request to the SSE endpoint.","triggerScenarios":"Thrown at cli/src/commands/app/dev.ts:1977 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Match the status: 401 → re-login (wmill login / refresh token in the dev session); 403 → check workspace/job permissions; 404 → the job id is wrong or already expired from retention","Restart the app dev session to pick up fresh credentials","If 5xx, check backend health/logs — the SSE endpoint itself failed"],"exampleFix":null,"handlingStrategy":"validation","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"}