windmill-labs/windmill · error

Script '${path}' has a deployment error and cannot be run:\n

Error message

Script '${path}' has a deployment error and cannot be run:\n${script.lock_error_logs}

What it means

Before running a script by path, the CLI fetches the deployed script via `wmill.getScriptByPath` and checks `lock_error_logs`. If the server recorded a dependency-locking failure at deploy time, the script cannot be run and the CLI surfaces the stored lock logs. The error re-check in the catch block ensures this error isn't swallowed by the 404 handling.

Source

Thrown at cli/src/commands/script/script.ts:1444

  let id: string;
  try {
    id = await wmill.runScriptByPath({
      workspace: workspace.workspaceId,
      path,
      tag: opts.tag,
      requestBody: input,
    });
  } catch (e: any) {
    if (e?.status === 404) {
      // Script might exist but have a lock/deployment error — check before giving up
      try {
        const script = await wmill.getScriptByPath({
          workspace: workspace.workspaceId,
          path,
        });
        if (script.lock_error_logs) {
          throw new Error(
            `Script '${path}' has a deployment error and cannot be run:\n${script.lock_error_logs}`
          );
        }
      } catch (lookupErr: any) {
        if (lookupErr?.message?.includes("deployment error")) throw lookupErr;
        // Re-throw non-404 lookup errors (e.g. auth/network issues)
        if (lookupErr?.status && lookupErr.status !== 404) throw lookupErr;
      }
      throw new Error(
        `Script '${path}' not found. Run 'wmill script list' to see available scripts.`
      );
    }
    throw e;
  }

  if (!opts.silent) {
    await track_job(workspace.workspaceId, id);
  }

View on GitHub (pinned to e474e8803c)

Solutions

  1. Read the `lock_error_logs` in the message to find the failing dependency.
  2. Fix the dependency spec (pin a valid version, fix the package name) and re-push with `wmill script push`.
  3. Verify the worker can reach the package registry (proxy/env config).
  4. Run an earlier working deployment of the script if you need an immediate fix (via the UI's version history).
Defensive patterns

Strategy: validation

Validate before calling

const script = await wmill.getScriptByPath({ workspace, path });
if (script && script.lock_error_logs) {
  console.error('Fix locking before running:', script.lock_error_logs);
  process.exit(1);
}

Type guard

function hasLockErrors(s: { lock_error_logs?: string | null }): s is { lock_error_logs: string } {
  return typeof s.lock_error_logs === 'string' && s.lock_error_logs.length > 0;
}

Try / catch

try {
  await runScript(path);
} catch (e) {
  if (String(e.message).includes('deployment error')) {
    console.error('Dependency locking failed at deploy time; fix deps and re-push.');
  }
  throw e;
}

Prevention

When it happens

Trigger: Running a script whose latest deployment failed dependency locking — e.g. `wmill script run f/scripts/my_script` where the last `wmill script push` could not resolve/lock the Python/Node/Go dependencies, leaving `lock_error_logs` populated on the server.

Common situations: A requirements.txt with an unpinned or nonexistent package version; a private npm/PyPI registry unreachable from the worker at deploy time; a Go module that fails to build; pushing a script that never previously deployed successfully.

Related errors


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