{"record":{"id":"1e9a7475f1a3cb06","repo":"windmill-labs/windmill","slug":"file-path-must-refer-to-a-file-1e9a74","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/variable/variable.ts","lineNumber":214,"sourceCode":"    });\n  }\n}\n\nasync function push(\n  opts: GlobalOptions & { plainSecrets: boolean },\n  filePath: string,\n  remotePath: string\n) {\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  log.info(colors.bold.yellow(\"Pushing variable...\"));\n\n  const local = parseFromFile(filePath) as VariableFile;\n\n  // A secret value in a single-file push is authored by the user and is\n  // therefore plaintext that must be encrypted server-side — unless it has the\n  // shape of workspace ciphertext (a value round-tripped from `sync pull`).\n  // Pushing plaintext as already-encrypted would brick the variable. An explicit\n  // --plain-secrets always forces the plaintext (encrypt) path.\n  let plainSecrets = opts.plainSecrets ?? false;\n  if (opts.plainSecrets === undefined && local.is_secret) {\n    if (!looksLikeWorkspaceCiphertext(local.value)) {\n      log.info(\n        colors.yellow(\n          \"Secret value is not in encrypted form; pushing as plaintext to be encrypted server-side (pass --plain-secrets to silence).\"\n        )","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/variable/variable.ts#L196-L232","documentation":"Fired by `wmill variable push` after stat-ing the local path: the path exists but is not a regular file (typically a directory). Generic validation guard; the faulting input is the filePath CLI argument. Throwing aborts the variable push before parsing the variable file.","triggerScenarios":"Thrown at cli/src/commands/variable/variable.ts:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the .variable.yaml file path, not a directory.","Use `wmill sync push` to push a whole folder of variables."],"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-08T15:18:49.778Z"}