{"record":{"id":"da4bae1b76b29fe6","repo":"windmill-labs/windmill","slug":"failed-to-generate-lockfile-message-da4bae","errorCode":null,"errorMessage":"Failed to generate lockfile: ${message}","messagePattern":"Failed to generate lockfile: (.+?)","errorType":"exception","errorClass":"LockfileGenerationError","httpStatus":null,"severity":"error","filePath":"cli/src/utils/metadata.ts","lineNumber":668,"sourceCode":"  let completion;\n  try {\n    completion = await pollJobWithQueueLogging(\n      workspace.workspaceId,\n      jobId,\n      { label: `deps ${remotePath}` },\n    );\n  } catch (e: any) {\n    throw new LockfileGenerationError(\n      `Failed to poll dependencies job ${jobId}: ${e?.message ?? e}`\n    );\n  }\n\n  const result = completion.result as any;\n  if (!completion.success) {\n    const message =\n      result?.error?.message ??\n      (typeof result === \"string\" ? result : JSON.stringify(result, null, 2));\n    throw new LockfileGenerationError(`Failed to generate lockfile: ${message}`);\n  }\n\n  const lock = result?.lock;\n  if (lock === undefined) {\n    throw new LockfileGenerationError(\n      `Failed to generate lockfile: ${JSON.stringify(result, null, 2)}`\n    );\n  }\n  if (cacheKey) {\n    lockCache.set(cacheKey, lock);\n  }\n  return lock;\n}\n\nasync function updateScriptLock(\n  workspace: Workspace,\n  scriptContent: string,\n  language: ScriptLanguage,","sourceCodeStart":650,"sourceCodeEnd":686,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/metadata.ts#L650-L686","documentation":"The dependencies job ran to completion on the server but reported failure (completion.success is false). The CLI extracts the error message from the job result — result.error.message, or the stringified result itself — and wraps it in a LockfileGenerationError prefixed 'Failed to generate lockfile'. This means the server-side lockfile generation (e.g. pip/dbt dependency resolution) itself failed, not the transport.","triggerScenarios":"The dependencies_async job finished with success=false. Its result usually carries { error: { message } } from the lockfile generation step: an unresolvable dependency, a bad raw_workspace_dependencies entry, a script language whose lockfile generation isn't supported, or an internal error in the generation code.","commonSituations":"A typo'd or nonexistent package version in raw workspace dependencies (pip can't resolve it); a requirements.txt/lockfile that contradicts the raw deps; dbt project with an invalid packages.yml or unreachable private registry; dependency job image lacking network access to a private PyPI/npm index.","solutions":["Read the embedded message — it's the server-side error from the generation step and usually names the exact dependency or line that failed","Fix the offending dependency in the script's metadata (raw_workspace_dependencies) or in the project file (requirements.txt, packages.yml, etc.)","Verify private package indexes/registries are reachable from the worker and credentials (if any) are configured instance-side","Confirm the language actually supports server-side lockfile generation for the dependency set you passed","Retry after fixing; the result is deterministic for the same inputs"],"exampleFix":"// before: unresolvable dep in metadata\nraw_workspace_dependencies: { \"numpy\": \"numpy==9.9.9-nonexistent\" }\n// after: valid pinned version\nraw_workspace_dependencies: { \"numpy\": \"numpy==1.26.4\" }","handlingStrategy":"try-catch","validationCode":"// pre-flight: sanity-check declared dependencies locally before queuing the job\nfor (const [name, spec] of Object.entries(rawWorkspaceDependencies)) {\n  if (!/^\\S+==\\S+$|^\\S+$/.test(spec)) {\n    throw new Error(`Suspicious dependency spec '${spec}' for ${name} — fix metadata before push`);\n  }\n}","typeGuard":"function jobFailedWithError(\n  result: any,\n): result is { error: { message: string } } {\n  return (\n    result != null &&\n    typeof result === \"object\" &&\n    typeof result.error?.message === \"string\"\n  );\n}","tryCatchPattern":"try {\n  const lock = await fetchScriptLock(workspace, content, language, path, deps);\n} catch (e) {\n  if (e instanceof LockfileGenerationError && e.message.startsWith(\"Failed to generate lockfile:\")) {\n    // message contains the server-side resolver error; surface it verbatim\n    log.error(`Dependency resolution failed on server:\\n${e.message}`);\n  } else throw e;\n}","preventionTips":["Pin dependencies to versions known to exist; avoid typos in raw_workspace_dependencies","Keep requirements.txt/packages.yml consistent with the metadata's raw dependencies","Ensure private package indexes are reachable and credentialed from the worker environment","Test dependency changes with a single script push before syncing the whole repo"],"tags":["dependencies","lockfile","windmill","cli"],"backgroundTag":"lockfile-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"}