{"record":{"id":"654bee5d108ce75c","repo":"windmill-labs/windmill","slug":"cannot-push-a-script-metadata-file-point-to-the-s","errorCode":null,"errorMessage":"Cannot push a script metadata file, point to the script content file instead (.py, .ts, .go|.sh)","messagePattern":"Cannot push a script metadata file, point to the script content file instead \\(\\.py, \\.ts, \\.go\\|\\.sh\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":191,"sourceCode":"    return;\n  }\n\n  // A dbt project's descriptor is optional, so the one content path a\n  // descriptor-less project has is deliberately not on disk. The project beside\n  // it is what says the script is real.\n  const absentDescriptor = await stat(filePath).then(\n    () => false,\n    (e) => isMissingDbtDescriptor(filePath, e)\n  );\n  if (!absentDescriptor) {\n    const fstat = await stat(filePath);\n    if (!fstat.isFile()) {\n      throw new Error(\"file path must refer to a file.\");\n    }\n  }\n\n  if (filePath.endsWith(\".script.json\") || filePath.endsWith(\".script.yaml\")) {\n    throw Error(\n      \"Cannot push a script metadata file, point to the script content file instead (.py, .ts, .go|.sh)\"\n    );\n  }\n\n  if (isFileResource(filePath) || isFilesetResource(filePath)) {\n    throw Error(\n      \"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();","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L173-L209","documentation":"The wmill script push command expects the path to a script CONTENT file (.py, .ts, .go, .sh, etc.). Passing a script metadata file (.script.json or .script.yaml) — which only holds settings, not code — is rejected upfront with this error, guiding the user to the correct file.","triggerScenarios":"Running `wmill script push path/to/script.script.json` or `... .script.yaml` — detected in push() by the filePath.endsWith checks before any login/API work.","commonSituations":"Syncing a repo and pushing every file including metadata files; confusing the metadata file (used by `wmill script` sync/to-json tooling) with the code file; tab-completion picking the .script.json instead of the .py/.ts sibling.","solutions":["Point the push at the content file instead: `wmill script push path/to/script.py --path u/user/my_script` (the metadata lives alongside as .script.json and is applied automatically).","If pushing a whole directory of scripts, use `wmill script sync` or filter out *.script.json/*.script.yaml from your push script.","If you only have the metadata file, recover/regenerate the content file — the metadata does not contain the code."],"exampleFix":"# before\nwmill script push u/user/my_script.script.json\n\n# after\nwmill script push u/user/my_script.ts --path u/user/my_script --summary \"...\"","handlingStrategy":"validation","validationCode":"const CONTENT_RE = /\\.(py|ts|go|sh|sql|billing|php|rs|nu|jsx|tsx|flow|yaml\\.flow)$/;\nif (filePath.endsWith('.script.json') || filePath.endsWith('.script.yaml')) {\n  filePath = filePath.replace(/\\.script\\.(json|yaml)$/, ''); // derive content file\n}\nif (!CONTENT_RE.test(filePath)) throw new Error(`not a script content file: ${filePath}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In push loops, filter out *.script.json and *.script.yaml glob patterns.","Always pass the code file (.py/.ts/...) to `wmill script push`; metadata is applied automatically.","Tab-complete to the extension you intend before running push."],"tags":["cli","script","push","user-input"],"backgroundTag":"wrong-file-type-for-push","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"}