{"record":{"id":"2aebb0f963037e39","repo":"windmill-labs/windmill","slug":"failed-to-generate-lockfile-json-stringify-resu","errorCode":null,"errorMessage":"Failed to generate lockfile: ${JSON.stringify(result, null, 2)}","messagePattern":"Failed to generate lockfile: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/app_metadata.ts","lineNumber":824,"sourceCode":"      { label: `deps ${scriptPath}` },\n    );\n  } catch (e: any) {\n    throw new Error(\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 Error(`Failed to generate lockfile: ${message}`);\n  }\n\n  const lock = result?.lock;\n  if (lock === undefined) {\n    throw new Error(\n      `Failed to generate lockfile: ${JSON.stringify(result, null, 2)}`\n    );\n  }\n  return lock ?? \"\";\n}\n\n/**\n * Result of schema inference for a runnable\n */\nexport interface InferredSchemaResult {\n  runnableId: string;\n  schema: any;\n}\n\n/**\n * Infers schema for a single runnable from its file content.\n * Used by dev server to update schema in memory (for wmill.d.ts generation).\n * Does NOT write to the runnable YAML file - schema is kept in memory only.","sourceCodeStart":806,"sourceCodeEnd":842,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/app_metadata.ts#L806-L842","documentation":"Thrown by generateInlineScriptLock when the dependencies job finished successfully (success=true) yet its result payload carries no 'lock' field. This is a worker/CLI contract mismatch: the job completed but returned an unexpected result shape — an older worker image that doesn't emit lock data, a partially failed deps step masked as success, or an API/proxy truncating the result. The full JSON result is dumped so the actual shape is visible.","triggerScenarios":"Thrown at cli/src/commands/app/app_metadata.ts:824 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the dumped JSON result: if it contains an error-like field instead of 'lock', address that underlying failure","Update the CLI to match the server version (npm i -g windmill-cli@latest or the matching version) — a 'lock' field missing usually means worker and CLI disagree on the deps job output format","Retry after restarting/upgrading workers if the result JSON looks truncated or empty"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}