{"record":{"id":"c1455e8aced18dcc","repo":"windmill-labs/windmill","slug":"script-path-has-a-deployment-error-and-cannot","errorCode":null,"errorMessage":"Script '${path}' has a deployment error and cannot be run:\\n${script.lock_error_logs}","messagePattern":"Script '(.+?)' has a deployment error and cannot be run:\\\\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":1444,"sourceCode":"\n  let id: string;\n  try {\n    id = await wmill.runScriptByPath({\n      workspace: workspace.workspaceId,\n      path,\n      tag: opts.tag,\n      requestBody: input,\n    });\n  } catch (e: any) {\n    if (e?.status === 404) {\n      // Script might exist but have a lock/deployment error — check before giving up\n      try {\n        const script = await wmill.getScriptByPath({\n          workspace: workspace.workspaceId,\n          path,\n        });\n        if (script.lock_error_logs) {\n          throw new Error(\n            `Script '${path}' has a deployment error and cannot be run:\\n${script.lock_error_logs}`\n          );\n        }\n      } catch (lookupErr: any) {\n        if (lookupErr?.message?.includes(\"deployment error\")) throw lookupErr;\n        // Re-throw non-404 lookup errors (e.g. auth/network issues)\n        if (lookupErr?.status && lookupErr.status !== 404) throw lookupErr;\n      }\n      throw new Error(\n        `Script '${path}' not found. Run 'wmill script list' to see available scripts.`\n      );\n    }\n    throw e;\n  }\n\n  if (!opts.silent) {\n    await track_job(workspace.workspaceId, id);\n  }","sourceCodeStart":1426,"sourceCodeEnd":1462,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L1426-L1462","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the `lock_error_logs` in the message to find the failing dependency.","Fix the dependency spec (pin a valid version, fix the package name) and re-push with `wmill script push`.","Verify the worker can reach the package registry (proxy/env config).","Run an earlier working deployment of the script if you need an immediate fix (via the UI's version history)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const script = await wmill.getScriptByPath({ workspace, path });\nif (script && script.lock_error_logs) {\n  console.error('Fix locking before running:', script.lock_error_logs);\n  process.exit(1);\n}","typeGuard":"function hasLockErrors(s: { lock_error_logs?: string | null }): s is { lock_error_logs: string } {\n  return typeof s.lock_error_logs === 'string' && s.lock_error_logs.length > 0;\n}","tryCatchPattern":"try {\n  await runScript(path);\n} catch (e) {\n  if (String(e.message).includes('deployment error')) {\n    console.error('Dependency locking failed at deploy time; fix deps and re-push.');\n  }\n  throw e;\n}","preventionTips":["Pin all dependency versions (requirements.txt, package.json lockfile, go.sum).","Always push with `wmill script push` and check its exit code before running.","Ensure workers can reach private registries before deploying new deps."],"tags":["cli","deployment","dependency-locking","windmill"],"backgroundTag":"dependency-resolution-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"}