{"record":{"id":"8b71cfff413e7cf7","repo":"windmill-labs/windmill","slug":"cannot-push-a-file-fileset-resource-content-file-a","errorCode":null,"errorMessage":"Cannot push a file/fileset resource content file as a script, push its .resource.yaml with 'wmill resource push' instead","messagePattern":"Cannot push a file/fileset resource content file as a script, push its \\.resource\\.yaml with 'wmill resource push' instead","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/script/script.ts","lineNumber":197,"sourceCode":"  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();\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))) {","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/script/script.ts#L179-L215","documentation":"wmill script push rejects files that are resource CONTENT files (file or fileset resource payloads). These belong to file/fileset resources, not scripts; the CLI tells you to push the accompanying .resource.yaml metadata via `wmill resource push` instead.","triggerScenarios":"Running `wmill script push` on a path where isFileResource(filePath) || isFilesetResource(filePath) is true — i.e. a file resource content file (e.g. a binary/data file backing a 'file' resource) or fileset content. Detected before any API call.","commonSituations":"Bulk-pushing a directory containing both scripts and file-resource assets; misremembering which extension maps to scripts vs resources; trying to version a data file as a script.","solutions":["Push the resource metadata instead: `wmill resource push path/to/file.resource.yaml` — the content file is referenced/uploaded by that flow.","Exclude *.resource.yaml content/asset files from your script push loop or directory sync.","If the file genuinely is a script (e.g. a .py file also used as a resource), move it to a separate path so the resource and script files do not collide."],"exampleFix":"# before\nwmill script push assets/dataset.csv\n\n# after\nwmill resource push assets/dataset.resource.yaml","handlingStrategy":"validation","validationCode":"if (/\\.resource\\.yaml$/.test(filePath) || isResourceContentFile(filePath)) {\n  // route to resource push instead\n  // execSync(`wmill resource push ${filePath}`);\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep resource content assets in directories excluded from script push loops.","Use `wmill resource push` with the .resource.yaml for file/fileset resources.","Audit directory sync globs so only script content extensions are pushed as scripts."],"tags":["cli","resource","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"}