{"record":{"id":"aaf78e51686d382c","repo":"windmill-labs/windmill","slug":"failed-to-queue-flow-dependencies-job-queueresp","errorCode":null,"errorMessage":"Failed to queue flow dependencies job: ${queueResponse.status} ${queueResponse.statusText}, ${bodyText}","messagePattern":"Failed to queue flow dependencies job: (.+?) (.+?), (.+?)","errorType":"exception","errorClass":"LockfileGenerationError","httpStatus":null,"severity":"error","filePath":"cli/src/commands/flow/flow_metadata.ts","lineNumber":485,"sourceCode":"        Cookie: `token=${workspace.token}`,\n        \"Content-Type\": \"application/json\",\n        ...extraHeaders,\n      },\n      body: JSON.stringify(body),\n    }\n  );\n\n  await detectAuthGatewayChallenge(\n    queueResponse,\n    `${workspace.remote}api/w/${workspace.workspaceId}/jobs/run/flow_dependencies_async`,\n  );\n\n  if (!queueResponse.ok) {\n    let bodyText = \"\";\n    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  }","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/flow/flow_metadata.ts#L467-L503","documentation":"Lock regeneration queues a background 'flow dependencies' job on the server via a raw HTTP call; when the queueing response is not OK the CLI reads the body for details and throws this LockfileGenerationError including status, status text, and the response body.","triggerScenarios":"The POST that queues the flow-dependencies job returns a non-2xx: expired/invalid token (401), missing workspace permission (403), unknown workspace (404), or server error (5xx) while the job queue is down.","commonSituations":"CI token rotated or expired mid-deploy; instance under load with the queue/worker subsystem unhealthy; workspace id mismatch after switching workspaces; proxy returning 502.","solutions":["Read the status/body in the message — 401/403: refresh credentials with `wmill login` or fix token permissions","Verify the active workspace is correct with `wmill workspace`","Check server/worker health on the instance; retry once the queue is healthy","If a proxy is involved, check whether it injected the non-JSON error (502/504)"],"exampleFix":"// before (CI)\n- run: wmill flow push f/etl --generate-lockfile\n// after\n- run: wmill login --token $WMILL_TOKEN --workspace prod && wmill flow push f/etl --generate-lockfile","handlingStrategy":"retry","validationCode":"const whoami = await fetch(`${baseUrl}/api/users/whoami`, { headers: { Authorization: `Bearer ${token}` } });\nif (!whoami.ok) throw new Error(`bad token/workspace before queuing: ${whoami.status}`);","typeGuard":null,"tryCatchPattern":"try {\n  await generateLocks();\n} catch (e) {\n  if (e instanceof LockfileGenerationError && /queue flow dependencies job: (401|403|5..)/.test(e.message)) {\n    await relogin();\n    await generateLocks(); // retry once after credential refresh\n  }\n}","preventionTips":["Refresh tokens before long CI jobs or use non-expiring workspace tokens","Check instance/queue health before bulk deploys","Pin the workspace explicitly with --workspace instead of relying on the active one","Retry with exponential backoff in CI"],"tags":["cli","lockfile","http","queue"],"backgroundTag":"job-queue-request-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"}