windmill-labs/windmill · error · LockfileGenerationError

Failed to queue flow dependencies job

Error message

Failed to queue flow dependencies job: ${queueResponse.status} ${queueResponse.statusText}, ${bodyText}

What it means

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.

Solutions

  1. Read the status/body in the message — 401/403: refresh credentials with `wmill login` or fix token permissions
  2. Verify the active workspace is correct with `wmill workspace`
  3. Check server/worker health on the instance; retry once the queue is healthy
  4. If a proxy is involved, check whether it injected the non-JSON error (502/504)

Example fix

// before (CI)
- run: wmill flow push f/etl --generate-lockfile
// after
- run: wmill login --token $WMILL_TOKEN --workspace prod && wmill flow push f/etl --generate-lockfile
Defensive patterns

Strategy: retry

Validate before calling

const whoami = await fetch(`${baseUrl}/api/users/whoami`, { headers: { Authorization: `Bearer ${token}` } });
if (!whoami.ok) throw new Error(`bad token/workspace before queuing: ${whoami.status}`);

Try / catch

try {
  await generateLocks();
} catch (e) {
  if (e instanceof LockfileGenerationError && /queue flow dependencies job: (401|403|5..)/.test(e.message)) {
    await relogin();
    await generateLocks(); // retry once after credential refresh
  }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/aaf78e51686d382c. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/flow/flow_metadata.ts:485

        Cookie: `token=${workspace.token}`,
        "Content-Type": "application/json",
        ...extraHeaders,
      },
      body: JSON.stringify(body),
    }
  );

  await detectAuthGatewayChallenge(
    queueResponse,
    `${workspace.remote}api/w/${workspace.workspaceId}/jobs/run/flow_dependencies_async`,
  );

  if (!queueResponse.ok) {
    let bodyText = "";
    try {
      bodyText = await queueResponse.text();
    } catch { /* ignore */ }
    throw new LockfileGenerationError(
      `Failed to queue flow dependencies job: ${queueResponse.status} ${queueResponse.statusText}, ${bodyText}`
    );
  }

  const jobId = (await queueResponse.text()).trim();

  let completion;
  try {
    completion = await pollJobWithQueueLogging(
      workspace.workspaceId,
      jobId,
      { label: `flow deps ${remotePath}` },
    );
  } catch (e: any) {
    throw new LockfileGenerationError(
      `Failed to poll flow dependencies job ${jobId}: ${e?.message ?? e}`
    );
  }

View on GitHub (pinned to e474e8803c)