windmill-labs/windmill · error · LockfileGenerationError

Failed to poll dependencies job ${jobId}: ${e?.message ?? e}

Error message

Failed to poll dependencies job ${jobId}: ${e?.message ?? e}

What it means

After the dependencies job is queued, fetchScriptLock polls it to completion via pollJobWithQueueLogging. This LockfileGenerationError wraps any exception raised during that polling loop (network interruption, job cancellation, polling timeout, or the job being removed), attaching the job id and the inner error message. The job id in the message lets you look up what happened to the run in the Windmill UI.

Source

Thrown at cli/src/utils/metadata.ts:658

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

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

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

  const result = completion.result as any;
  if (!completion.success) {
    const message =
      result?.error?.message ??
      (typeof result === "string" ? result : JSON.stringify(result, null, 2));
    throw new LockfileGenerationError(`Failed to generate lockfile: ${message}`);
  }

  const lock = result?.lock;
  if (lock === undefined) {
    throw new LockfileGenerationError(
      `Failed to generate lockfile: ${JSON.stringify(result, null, 2)}`
    );
  }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Open the run at {remote}/runs (search for the job id from the message) to see whether it was canceled, killed or timed out
  2. Simply retry the command — transient network failures and server restarts resolve on re-run
  3. If timeouts recur on big dependency trees, pre-build/commit the lockfile or reduce raw workspace dependencies so resolution is faster
  4. Refresh an expiring token before long operations (`wmill workspace switch`)
  5. If the job was systematically canceled, check worker availability and queue configuration on the instance

Example fix

// before: polling one long job until timeout
const completion = await pollJobWithQueueLogging(workspaceId, jobId, { label });
// after: catch and retry transient poll failures
let completion;
try {
  completion = await pollJobWithQueueLogging(workspaceId, jobId, { label });
} catch (e) {
  completion = await pollJobWithQueueLogging(workspaceId, jobId, { label }); // retry once
}
Defensive patterns

Strategy: retry

Validate before calling

// pre-flight: confirm server reachability and token validity before starting a long lockfile operation
const health = await fetch(`${workspace.remote}api/users/whoami`, {
  headers: { Cookie: `token=${workspace.token}` },
});
if (!health.ok) throw new Error("Cannot reach Windmill or token expired before polling deps job");

Try / catch

try {
  await wmill.push(...);
} catch (e) {
  if (e instanceof LockfileGenerationError && e.message.startsWith("Failed to poll dependencies job")) {
    const jobId = e.message.match(/job (\S+):/)?.[1];
    log.error(
      `Polling failed for job ${jobId}. Check its status in the UI under /runs and retry the command.`
    );
  } else throw e;
}

Prevention

When it happens

Trigger: An exception escapes pollJobWithQueueLogging(workspaceId, jobId, ...) — e.g. repeated fetch failures while querying job status (server restarted mid-run), the polling timeout elapsing, the job being canceled or deleted before completion, or an auth error encountered mid-poll when the token expires during a long dependency resolution.

Common situations: Large dependency trees (long dbt deps/pip resolution) exceeding the polling timeout; laptop sleeping / network change mid-push; server redeploy while a sync/push is in flight; an admin canceling the dependencies run from the UI; token expiring during a long-running operation.

Related errors


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