{"record":{"id":"fae503070ffc4868","repo":"windmill-labs/windmill","slug":"file-path-must-refer-to-a-file-fae503","errorCode":null,"errorMessage":"file path must refer to a file.","messagePattern":"file path must refer to a file\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/trigger/trigger.ts","lineNumber":632,"sourceCode":"    }\n  }\n\n  // Now extract trigger type from the base path: \"something.kafka_trigger.yaml\" -> \"kafka\"\n  const triggerMatch = pathToAnalyze.match(/\\.(\\w+)_trigger\\.yaml$/);\n  return triggerMatch ? triggerMatch[1] : undefined;\n}\n\nasync function push(opts: GlobalOptions, filePath: string, remotePath: string) {\n  const workspace = await resolveWorkspace(opts);\n  await requireLogin(opts);\n\n  if (!validatePath(remotePath)) {\n    return;\n  }\n\n  const fstat = await stat(filePath);\n  if (!fstat.isFile()) {\n    throw new Error(\"file path must refer to a file.\");\n  }\n\n  console.log(colors.bold.yellow(\"Pushing trigger...\"));\n\n  const triggerKind = await extractTriggerKindFromPath(filePath);\n  if (!checkIfValidTrigger(triggerKind)) {\n    throw new Error(\"Invalid trigger kind: \" + triggerKind);\n  }\n  await pushTrigger(\n    triggerKind,\n    workspace.workspaceId,\n    remotePath,\n    undefined,\n    parseFromFile(filePath)\n  );\n  console.log(colors.bold.underline.green(\"Trigger pushed\"));\n}\n","sourceCodeStart":614,"sourceCodeEnd":650,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/trigger/trigger.ts#L614-L650","documentation":"Fired by trigger push after stat-ing the local path: the path exists but is not a regular file (typically a directory). This is a generic validation guard; the input at fault is the filePath CLI argument. Unlike the script push variant, this one throws, aborting the push.","triggerScenarios":"Thrown at cli/src/commands/trigger/trigger.ts:632 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the trigger YAML file itself, not its directory.","Use `wmill sync push` for pushing whole folders."],"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"}