{"record":{"id":"0ac88216f3cabcf6","repo":"windmill-labs/windmill","slug":"metadata-for-filepath-appears-stale-content-ch","errorCode":null,"errorMessage":"Metadata for ${filePath} appears stale (content changed since last 'wmill generate-metadata').\nThe schema and lock may not match the current code. Consider running 'wmill generate-metadata' first.","messagePattern":"Metadata for (.+?) appears stale \\(content changed since last 'wmill generate-metadata'\\)\\.\nThe schema and lock may not match the current code\\. Consider running 'wmill generate-metadata' first\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/script/script.ts","lineNumber":216,"sourceCode":"      \"Cannot push a file/fileset resource content file as a script, push its .resource.yaml with 'wmill resource push' instead\"\n    );\n  }\n\n  await requireLogin(opts);\n\n  // Warn about metadata state before pushing\n  try {\n    const content = await readScriptContent(filePath);\n    const remotePath = removeExtensionToPath(filePath).replaceAll(SEP, \"/\");\n    const contentHash = await computePushMetadataHash(filePath, content);\n    const conf = await readLockfile();\n    const hasLockEntry = conf.locks && (conf.locks[remotePath] !== undefined || conf.locks[`${remotePath}.ts`] !== undefined);\n    if (!hasLockEntry) {\n      log.warn(colors.yellow(\n        `No metadata generated yet for ${filePath}. Run 'wmill generate-metadata' to generate schema and lock.`\n      ));\n    } else if (!(await checkifMetadataUptodate(remotePath, contentHash, conf))) {\n      log.warn(colors.yellow(\n        `Metadata for ${filePath} appears stale (content changed since last 'wmill generate-metadata').\\n` +\n        `The schema and lock may not match the current code. Consider running 'wmill generate-metadata' first.`\n      ));\n    }\n  } catch {\n    // Don't block push if check fails\n  }\n\n  const codebases = await listSyncCodebases(opts as SyncOptions);\n\n  await handleFile(\n    filePath,\n    workspace,\n    [],\n    opts.message,\n    opts,\n    await getRawWorkspaceDependencies(true),\n    codebases","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L198-L234","documentation":"After confirming a lock entry exists, `wmill push` compares the script's current content hash against the hash recorded by the last `wmill generate-metadata`. If the content changed since metadata was generated, the schema and lock may be out of sync with the code; wmill warns (non-blocking) that you should regenerate before pushing.","triggerScenarios":"Editing a script after running `wmill generate-metadata`, then running `wmill push` without regenerating; reverting code to a state that differs from the stored hash; pushing from a branch where the metadata was generated for different content.","commonSituations":"Iterating on a script's logic (which changes required args via its schema) without regenerating; CI pushing code that differs from what a developer generated metadata for; forgetting generate-metadata as part of the edit workflow.","solutions":["Run `wmill generate-metadata` to refresh schema and lock, then push","If the change is intentionally metadata-independent, push anyway knowing the schema/lock may be stale","If args changed, also verify downstream callers use the new required args before pushing"],"exampleFix":"// before\nwmill push f/scripts/foo.ts   # warns: stale metadata\n// after\nwmill generate-metadata\nwmill push f/scripts/foo.ts","handlingStrategy":"validation","validationCode":"if (hash !== lock.locks[remotePath].content_hash) await run('wmill generate-metadata');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["regenerate before push","never hand-edit hashes","CI pre-push generate step"],"tags":["cli","metadata","stale-cache"],"backgroundTag":"stale-metadata-hash","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"}