{"record":{"id":"9e68950159eb08a9","repo":"windmill-labs/windmill","slug":"label-jobid-error-checking-job-status-con","errorCode":null,"errorMessage":"${label}${jobId}: error checking job status (${consecutiveErrors}/${MAX_CONSECUTIVE_POLL_ERRORS}): ${err?.message ?? err}","messagePattern":"(.+?)(.+?): error checking job status \\((.+?)/(.+?)\\): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/utils/job_polling.ts","lineNumber":110,"sourceCode":"  let lastHeartbeatAt = Date.now();\n  let consecutiveErrors = 0;\n\n  while (true) {\n    try {\n      const maybe = await wmill.getCompletedJobResultMaybe({\n        workspace,\n        id: jobId,\n        getStarted: false,\n      });\n\n      consecutiveErrors = 0;\n\n      if (maybe.completed) {\n        return { result: maybe.result, success: maybe.success ?? false };\n      }\n    } catch (err: any) {\n      consecutiveErrors++;\n      log.warn(\n        colors.yellow(\n          `${label}${jobId}: error checking job status (${consecutiveErrors}/${MAX_CONSECUTIVE_POLL_ERRORS}): ${err?.message ?? err}`,\n        ),\n      );\n      lastHeartbeatAt = Date.now();\n      if (consecutiveErrors >= MAX_CONSECUTIVE_POLL_ERRORS) {\n        throw new Error(\n          `Giving up polling job ${jobId} after ${MAX_CONSECUTIVE_POLL_ERRORS} consecutive errors. Last error: ${err?.message ?? err}`,\n        );\n      }\n    }\n\n    if (Date.now() - lastQueueLogAt >= QUEUE_LOG_INTERVAL_MS) {\n      lastQueueLogAt = Date.now();\n      const logged = await logQueueStatus(workspace, jobId, label);\n      if (logged) lastHeartbeatAt = Date.now();\n    }\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/job_polling.ts#L92-L128","documentation":"Retry-loop warning from pollJobWithQueueLogging: the getCompletedJobResultMaybe call for a job failed (network/API error, not job failure). consecutiveErrors tracks how many polls in a row failed against MAX_CONSECUTIVE_POLL_ERRORS; polling continues and the counter resets on the next successful check.","triggerScenarios":"Thrown at cli/src/utils/job_polling.ts:110 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check API/server reachability and auth token validity from the CLI environment","Wait — transient errors self-heal as long as the consecutive counter stays under the max","Inspect err.message to distinguish auth (401/403) from connectivity problems"],"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"}