{"record":{"id":"ca1a6995d980a7e7","repo":"windmill-labs/windmill","slug":"dependency-generation-failed-queueresponse-stat","errorCode":null,"errorMessage":"Dependency generation failed: ${queueResponse.status} ${queueResponse.statusText}\\n${text}","messagePattern":"Dependency generation failed: (.+?) (.+?)\\\\n(.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/app_metadata.ts","lineNumber":794,"sourceCode":"          filteredDeps && Object.keys(filteredDeps).length > 0\n            ? filteredDeps\n            : null,\n        entrypoint: scriptPath,\n        ...(tempScriptRefs && Object.keys(tempScriptRefs).length > 0\n          ? { temp_script_refs: tempScriptRefs }\n          : {}),\n      }),\n    }\n  );\n\n  await detectAuthGatewayChallenge(\n    queueResponse,\n    `${workspace.remote}api/w/${workspace.workspaceId}/jobs/run/dependencies_async`,\n  );\n\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  }","sourceCodeStart":776,"sourceCodeEnd":812,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/app_metadata.ts#L776-L812","documentation":"Raised by generateInlineScriptLock when the async dependency-generation endpoint (`POST /jobs/run/dependencies_async`) responds with a non-2xx status. The response body (text) is included in the message, so the server-side reason (auth failure, invalid path, worker overload, bad payload) is appended after status and statusText.","triggerScenarios":"Calling `wmill app sync`/generate-lock for an inline script whose dependency lock must be generated, and the queued job request fails: 401/403 (bad token), 404 (bad workspace id or path), 402 (no workers / plan limit), 422/500 (malformed script metadata), or 5xx from an overloaded instance.","commonSituations":"Expired or wrong API token configured for the CLI; targeting the wrong instance URL (workspace.remote) so the endpoint 404s; no worker queue available for dependency jobs; offline/intermittent network producing a gateway error; server version mismatch rejecting the payload.","solutions":["Read the appended `text` in the message — it contains the server's error explanation; fix that underlying cause first","Run `wmill workspace switch` / verify the token with `wmill workspace add` to rule out auth (401/403)","Verify workspace.remote URL and workspace id are correct (404) and that the instance is reachable (curl the /api endpoint)","Check that workers are running and can process dependency jobs (402/queue errors), then retry the sync"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// pre-check reachability and auth before queuing\nconst wsCheck = await fetch(`${workspace.remote}api/w/${workspace.workspaceId}/workspaces/get`, {\n  headers: { Authorization: `Bearer ${workspace.token}` },\n});\nif (!wsCheck.ok) throw new Error(`Workspace unreachable/auth failed: ${wsCheck.status} — fix before syncing dependencies`);","typeGuard":null,"tryCatchPattern":"try {\n  await generateInlineScriptLock(workspace, scriptPath, ...);\n} catch (e) {\n  if (String(e).startsWith('Dependency generation failed:')) {\n    console.error('Server rejected the dependencies job; inspect status + body in the message, check auth/workers, then retry.');\n  }\n  throw e;\n}","preventionTips":["Check `wmill workspace current` and token freshness before long sync operations","Ensure workers are running and healthy (dependency jobs need a queue) before bulk app sync","Curl the dependencies_async endpoint or check instance health when CI syncs start failing"],"tags":["cli","network","http-error","dependencies","lock"],"backgroundTag":"dependency-generation-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"}