windmill-labs/windmill · error · Error

file path must refer to a file.

Error message

file path must refer to a file.

What it means

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.

Source

Thrown at cli/src/commands/trigger/trigger.ts:632

    }
  }

  // Now extract trigger type from the base path: "something.kafka_trigger.yaml" -> "kafka"
  const triggerMatch = pathToAnalyze.match(/\.(\w+)_trigger\.yaml$/);
  return triggerMatch ? triggerMatch[1] : undefined;
}

async function push(opts: GlobalOptions, filePath: string, remotePath: string) {
  const workspace = await resolveWorkspace(opts);
  await requireLogin(opts);

  if (!validatePath(remotePath)) {
    return;
  }

  const fstat = await stat(filePath);
  if (!fstat.isFile()) {
    throw new Error("file path must refer to a file.");
  }

  console.log(colors.bold.yellow("Pushing trigger..."));

  const triggerKind = await extractTriggerKindFromPath(filePath);
  if (!checkIfValidTrigger(triggerKind)) {
    throw new Error("Invalid trigger kind: " + triggerKind);
  }
  await pushTrigger(
    triggerKind,
    workspace.workspaceId,
    remotePath,
    undefined,
    parseFromFile(filePath)
  );
  console.log(colors.bold.underline.green("Trigger pushed"));
}

View on GitHub (pinned to e474e8803c)

Solutions

  1. Pass the trigger YAML file itself, not its directory.
  2. Use `wmill sync push` for pushing whole folders.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/trigger/trigger.ts:632 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/fae503070ffc4868. Report an issue: GitHub.