{"record":{"id":"01bd8a1aa0df894e","repo":"windmill-labs/windmill","slug":"failed-to-poll-dependencies-job-jobid-e-mes","errorCode":null,"errorMessage":"Failed to poll dependencies job ${jobId}: ${e?.message ?? e}","messagePattern":"Failed to poll dependencies job (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/app_metadata.ts","lineNumber":809,"sourceCode":"\n  if (!queueResponse.ok) {\n    const text = await queueResponse.text();\n    throw new Error(\n      `Dependency generation failed: ${queueResponse.status} ${queueResponse.statusText}\\n${text}`\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 ${scriptPath}` },\n    );\n  } catch (e: any) {\n    throw new Error(\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 Error(`Failed to generate lockfile: ${message}`);\n  }\n\n  const lock = result?.lock;\n  if (lock === undefined) {\n    throw new Error(\n      `Failed to generate lockfile: ${JSON.stringify(result, null, 2)}`\n    );\n  }","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/app_metadata.ts#L791-L827","documentation":"After the dependencies job is queued, generateInlineScriptLock polls it with pollJobWithQueueLogging; if that polling call throws (network drop, job endpoint 404, auth error), the catch re-wraps it with the job id and original message. This tells you the dependency lock job could not be tracked to completion — note that the job itself may still exist server-side.","triggerScenarios":"Polling a just-queued dependencies_async job fails: connection reset/timeout mid-poll, token expired between queue and poll, job was deleted/purged (404 on job fetch), workspace switched mid-operation, or the poll helper itself threw on a 5xx.","commonSituations":"Flaky VPN/corporate proxy dropping long-running CLI operations; instance restarted while the CLI was polling; CLI token TTL expired during a long sync; job run retention/cleanup removed the job before completion.","solutions":["Re-run the app sync command — the wrapped `e?.message` explains the root failure; transient network issues usually clear on retry","Verify the job exists (`wmill job show <jobId>` or the Runs page) to see whether it actually completed despite the poll failure","Check token validity and network stability (VPN/proxy) for long-running operations","If the job errored server-side, inspect its logs in the UI and fix the dependency definition (e.g. bad imports in the inline script) before retrying"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// confirm the job exists before/while polling\nconst job = await wmill.getJob({ workspace: workspace.workspaceId, id: jobId });\nif (!job) throw new Error(`dependencies job ${jobId} not found — was it purged?`);","typeGuard":null,"tryCatchPattern":"try {\n  await generateInlineScriptLock(workspace, scriptPath, ...);\n} catch (e) {\n  if (String(e).startsWith('Failed to poll dependencies job')) {\n    console.error('Polling failed (network/auth/job gone). Check the job in the Runs page and retry the sync.');\n  }\n  throw e;\n}","preventionTips":["Run app sync on a stable connection; avoid VPN drops mid-operation in CI (use a runner in-network)","Use a long-lived token for CI so it cannot expire mid-poll","If polling repeatedly fails, check job retention settings and the job's server-side logs by id"],"tags":["cli","polling","network","dependencies","job"],"backgroundTag":"job-poll-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"}