{"record":{"id":"654160a43ed2858c","repo":"windmill-labs/windmill","slug":"failed-to-poll-flow-dependencies-job-jobid-e","errorCode":null,"errorMessage":"Failed to poll flow dependencies job ${jobId}: ${e?.message ?? e}","messagePattern":"Failed to poll flow dependencies job (.+?): (.+?)","errorType":"exception","errorClass":"LockfileGenerationError","httpStatus":null,"severity":"error","filePath":"cli/src/commands/flow/flow_metadata.ts","lineNumber":500,"sourceCode":"    try {\n      bodyText = await queueResponse.text();\n    } catch { /* ignore */ }\n    throw new LockfileGenerationError(\n      `Failed to queue flow 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: `flow deps ${remotePath}` },\n    );\n  } catch (e: any) {\n    throw new LockfileGenerationError(\n      `Failed to poll flow 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  return result?.updated_flow_value;\n}\n","sourceCodeStart":482,"sourceCodeEnd":515,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/flow/flow_metadata.ts#L482-L515","documentation":"After the flow dependencies job is queued, the CLI polls it with pollJobWithQueueLogging; any exception raised during polling (network failure, auth rejection, unexpected API shape) is wrapped as this LockfileGenerationError with the job id and the underlying message.","triggerScenarios":"Polling a queued flow-deps job throws: transient network drop, 401 mid-poll after token expiry, job purged before completion, or pollJobWithQueueLogging rejecting on an unexpected response.","commonSituations":"Long lockfile generation exceeding client-side timeouts; flaky VPN/proxy in CI; token with read-expiry shorter than the job; server restart while the job was pending.","solutions":["Re-run the command — the underlying job may have completed; check the run in the web UI by job id","Fix connectivity/credential issues surfaced in the inner `e.message`","Increase client timeout allowances or retry in CI with backoff","Ensure workers are healthy so dependency jobs complete quickly"],"exampleFix":"// CI before\nwmill flow generate-locks f/etl\n// after\nfor i in 1 2 3; do wmill flow generate-locks f/etl && break || sleep 30; done","handlingStrategy":"retry","validationCode":"// Verify reachability before starting a long poll\nawait fetch(`${baseUrl}/api/version`, { headers: { Authorization: `Bearer ${token}` } }).then(r => { if (!r.ok) throw new Error('instance unreachable'); });","typeGuard":null,"tryCatchPattern":"try {\n  await generateLocks();\n} catch (e) {\n  if (String(e).startsWith('Failed to poll flow dependencies job')) {\n    // check the job in the UI by id before re-queuing; the job may have finished\n    await backoffRetry(() => generateLocks(), 3);\n  }\n}","preventionTips":["Run from networks with stable connectivity to the instance","Ensure token lifetime exceeds the worst-case lockfile generation time","Avoid server restarts during deploys","Set generous HTTP timeouts in the CLI environment"],"tags":["cli","lockfile","polling","network"],"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"}