{"record":{"id":"5b351ceff233e008","repo":"windmill-labs/windmill","slug":"cannot-derive-a-windmill-path-from-arg-remot","errorCode":null,"errorMessage":"Cannot derive a Windmill path from '${arg}'${remotePath ? ` (it maps to '${remotePath}')` : ''}: a preview runs under the path of the file it previews, which must sit inside the wmill.yaml root and be of the form <u|g|f>/<username|group|folder>/<name>.","messagePattern":"Cannot derive a Windmill path from '(.+?)'(.+?)'\\)` : ''\\}: a preview runs under the path of the file it previews, which must sit inside the wmill\\.yaml root and be of the form <u\\|g\\|f>/<username\\|group\\|folder>/<name>\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/core/context.ts","lineNumber":827,"sourceCode":" */\nfunction realpathOfNamed(p: string): string {\n  return existsSync(p)\n    ? realpathSync(p)\n    : join(realpathSync(dirname(p)), basename(p));\n}\n\n/** Windmill workspace path: `u|f|g` followed by at least a folder and a name. */\nconst REMOTE_PATH_RE = /^[ufg](\\/[^/]+){2,}$/;\n\n/**\n * Guard the Windmill path a preview run is pushed under. A preview job carries\n * no runnable of its own, so this path is the only identity it has: it is what\n * `WM_JOB_PATH` reports, what the runs page links to, and what relative imports\n * inside the previewed code resolve against.\n */\nexport function assertRemotePath(remotePath: string, arg: string): void {\n  if (REMOTE_PATH_RE.test(remotePath)) return;\n  throw new Error(\n    `Cannot derive a Windmill path from '${arg}'` +\n      (remotePath ? ` (it maps to '${remotePath}')` : \"\") +\n      `: a preview runs under the path of the file it previews, which must sit inside the ` +\n      `wmill.yaml root and be of the form <u|g|f>/<username|group|folder>/<name>.`\n  );\n}\n\nexport function validatePath(path: string): boolean {\n  if (!(path.startsWith(\"g\") || path.startsWith(\"u\") || path.startsWith(\"f\"))) {\n    log.infoStderr(\n      colors.red(\n        \"Given remote path looks invalid. Remote paths are typically of the form <u|g|f>/<username|group|folder>/...\"\n      )\n    );\n    return false;\n  }\n\n  return true;","sourceCodeStart":809,"sourceCodeEnd":845,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/core/context.ts#L809-L845","documentation":"assertRemotePath guards the path a preview run is pushed under: preview jobs have no runnable of their own, so the path must be a valid Windmill workspace path (u|g|f/<folder>/<name>) inside the wmill.yaml root; the given argument does not match that shape, so the job would have no usable identity.","triggerScenarios":"Thrown at cli/src/core/context.ts:827 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Preview a file that sits inside the wmill.yaml root directory.","Ensure the target maps to a path of the form u/<user>/<name>, g/<group>/<name>, or f/<folder>/<name>.","Check the mapped remote path reported in the message for missing folder segments."],"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"}