{"record":{"id":"3bb01e8153b1f436","repo":"windmill-labs/windmill","slug":"failed-to-poll-dependencies-job-jobid-e-mes-3bb01e","errorCode":null,"errorMessage":"Failed to poll dependencies job ${jobId}: ${e?.message ?? e}","messagePattern":"Failed to poll dependencies job (.+?): (.+?)","errorType":"exception","errorClass":"LockfileGenerationError","httpStatus":null,"severity":"error","filePath":"cli/src/utils/metadata.ts","lineNumber":658,"sourceCode":"    try {\n      bodyText = await queueResponse.text();\n    } catch { /* ignore */ }\n    throw new LockfileGenerationError(\n      `Failed to queue dependencies job: ${queueResponse.status} ${queueResponse.statusText}, ${bodyText}`\n    );\n  }\n\n  const jobId = (await queueResponse.text()).trim();\n\n  let completion;\n  try {\n    completion = await pollJobWithQueueLogging(\n      workspace.workspaceId,\n      jobId,\n      { label: `deps ${remotePath}` },\n    );\n  } catch (e: any) {\n    throw new LockfileGenerationError(\n      `Failed to poll dependencies job ${jobId}: ${e?.message ?? e}`\n    );\n  }\n\n  const result = completion.result as any;\n  if (!completion.success) {\n    const message =\n      result?.error?.message ??\n      (typeof result === \"string\" ? result : JSON.stringify(result, null, 2));\n    throw new LockfileGenerationError(`Failed to generate lockfile: ${message}`);\n  }\n\n  const lock = result?.lock;\n  if (lock === undefined) {\n    throw new LockfileGenerationError(\n      `Failed to generate lockfile: ${JSON.stringify(result, null, 2)}`\n    );\n  }","sourceCodeStart":640,"sourceCodeEnd":676,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/metadata.ts#L640-L676","documentation":"After the dependencies job is queued, fetchScriptLock polls it to completion via pollJobWithQueueLogging. This LockfileGenerationError wraps any exception raised during that polling loop (network interruption, job cancellation, polling timeout, or the job being removed), attaching the job id and the inner error message. The job id in the message lets you look up what happened to the run in the Windmill UI.","triggerScenarios":"An exception escapes pollJobWithQueueLogging(workspaceId, jobId, ...) — e.g. repeated fetch failures while querying job status (server restarted mid-run), the polling timeout elapsing, the job being canceled or deleted before completion, or an auth error encountered mid-poll when the token expires during a long dependency resolution.","commonSituations":"Large dependency trees (long dbt deps/pip resolution) exceeding the polling timeout; laptop sleeping / network change mid-push; server redeploy while a sync/push is in flight; an admin canceling the dependencies run from the UI; token expiring during a long-running operation.","solutions":["Open the run at {remote}/runs (search for the job id from the message) to see whether it was canceled, killed or timed out","Simply retry the command — transient network failures and server restarts resolve on re-run","If timeouts recur on big dependency trees, pre-build/commit the lockfile or reduce raw workspace dependencies so resolution is faster","Refresh an expiring token before long operations (`wmill workspace switch`)","If the job was systematically canceled, check worker availability and queue configuration on the instance"],"exampleFix":"// before: polling one long job until timeout\nconst completion = await pollJobWithQueueLogging(workspaceId, jobId, { label });\n// after: catch and retry transient poll failures\nlet completion;\ntry {\n  completion = await pollJobWithQueueLogging(workspaceId, jobId, { label });\n} catch (e) {\n  completion = await pollJobWithQueueLogging(workspaceId, jobId, { label }); // retry once\n}","handlingStrategy":"retry","validationCode":"// pre-flight: confirm server reachability and token validity before starting a long lockfile operation\nconst health = await fetch(`${workspace.remote}api/users/whoami`, {\n  headers: { Cookie: `token=${workspace.token}` },\n});\nif (!health.ok) throw new Error(\"Cannot reach Windmill or token expired before polling deps job\");","typeGuard":null,"tryCatchPattern":"try {\n  await wmill.push(...);\n} catch (e) {\n  if (e instanceof LockfileGenerationError && e.message.startsWith(\"Failed to poll dependencies job\")) {\n    const jobId = e.message.match(/job (\\S+):/)?.[1];\n    log.error(\n      `Polling failed for job ${jobId}. Check its status in the UI under /runs and retry the command.`\n    );\n  } else throw e;\n}","preventionTips":["Retry transient failures — most poll errors are network blips or server restarts","Use a stable network / disable aggressive laptop sleep during `wmill sync push` of large projects","Keep tokens long-lived enough for the operation; refresh before long dependency resolutions","Check the job id from the message in the Windmill UI (/runs) to see if the run was canceled or killed","Keep worker capacity available so dependency jobs complete inside polling timeouts"],"tags":["network","polling","timeout","cli","windmill"],"backgroundTag":"job-polling-failed","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"}