{"record":{"id":"250a9448c93281bd","repo":"windmill-labs/windmill","slug":"file-path-must-refer-to-a-file","errorCode":null,"errorMessage":"file path must refer to a file.","messagePattern":"file path must refer to a file\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/resource-type/resource-type.ts","lineNumber":77,"sourceCode":"      },\n    });\n  } else {\n    log.info(colors.yellow.bold(\"Creating new resource type...\"));\n    await wmill.createResourceType({\n      workspace: workspace,\n      requestBody: {\n        name: remotePath,\n        ...localResource,\n      },\n    });\n  }\n}\n\ntype PushOptions = GlobalOptions;\nasync function push(opts: PushOptions, filePath: string, name: string) {\n  const fstat = await stat(filePath);\n  if (!fstat.isFile()) {\n    throw new Error(\"file path must refer to a file.\");\n  }\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  log.info(colors.bold.yellow(\"Pushing resource...\"));\n\n  await pushResourceType(\n    workspace.workspaceId,\n    name,\n    undefined,\n    parseFromFile(filePath)\n  );\n  log.info(colors.bold.underline.green(\"Resource pushed\"));\n}\n\nasync function list(opts: GlobalOptions & { schema?: boolean; json?: boolean }) {\n  if (opts.json) log.setSilent(true);\n  const workspace = await resolveWorkspace(opts);","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/resource-type/resource-type.ts#L59-L95","documentation":"Guard in `wmill resource-type push`: after stat(), the given path is not a regular file (it is a directory, symlink-to-dir, or special file), so its contents cannot be read and pushed as a resource-type definition.","triggerScenarios":"Thrown at cli/src/commands/resource-type/resource-type.ts:77 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the path to the .resource-type.yaml/.json file itself, not its containing directory.","Run `ls -l` on the path to confirm it is a regular file and not a directory or broken symlink."],"exampleFix":null,"handlingStrategy":"validation","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"}