{"record":{"id":"4888e2eafb12fa83","repo":"windmill-labs/windmill","slug":"cannot-push-flow-remotepath-missing-inline-scr","errorCode":null,"errorMessage":"Cannot push flow ${remotePath}: missing inline script file(s): ${missingFiles.join(\", \")}. Either restore the file(s) or remove the !inline reference(s) from flow.yaml before pushing.","messagePattern":"Cannot push flow (.+?): missing inline script file\\(s\\): (.+?)\\. Either restore the file\\(s\\) or remove the !inline reference\\(s\\) from flow\\.yaml before pushing\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/flow/flow.ts","lineNumber":217,"sourceCode":"    fileReader,\n    log,\n    localPath,\n    SEP,\n    undefined,\n    missingFiles\n  );\n  if (localFlow.value.failure_module) {\n    await replaceInlineScripts([localFlow.value.failure_module], fileReader, log, localPath, SEP, undefined, missingFiles);\n  }\n  if (localFlow.value.preprocessor_module) {\n    await replaceInlineScripts([localFlow.value.preprocessor_module], fileReader, log, localPath, SEP, undefined, missingFiles);\n  }\n  if (missingFiles.length > 0) {\n    // Hard-fail rather than push the literal `!inline path` text as\n    // rawscript.content. That string would be persisted in flow_version.value\n    // and round-trip as the script body on the next pull, overwriting the\n    // user's local handler with the directive — see GIT-871 / #9140.\n    throw new Error(\n      `Cannot push flow ${remotePath}: missing inline script file(s): ${missingFiles.join(\", \")}. ` +\n      `Either restore the file(s) or remove the !inline reference(s) from flow.yaml before pushing.`\n    );\n  }\n\n  // Reject script/sub-flow steps whose path is not a workspace path (u/, f/, g/ or hub/).\n  // A flow.yaml generated from a feature-branch checkout can carry absolute local paths\n  // (e.g. /tmp/.../ops/scripts/...); pushed, they silently mis-resolve at runtime (#9751).\n  // The backend re-validates the same rule for every step type, so this is a fail-fast.\n  const badStepPaths = collectStepPaths(localFlow.value).filter(\n    (p) => p !== \"\" && !/^(u|f|g|hub)\\//.test(p)\n  );\n  if (badStepPaths.length > 0) {\n    throw new Error(\n      `Cannot push flow ${remotePath}: step(s) reference non-workspace path(s): ${badStepPaths.join(\", \")}. ` +\n      `Flow step paths must be workspace paths (u/, f/, g/ or hub/), not absolute or local filesystem paths. ` +\n      `This usually means flow.yaml was generated with paths from a checkout directory.`\n    );","sourceCodeStart":199,"sourceCodeEnd":235,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/flow/flow.ts#L199-L235","documentation":"`wmill flow push` resolves `!inline <path>` references in flow.yaml to local script files. If any referenced files are missing, it hard-fails with this error listing them instead of pushing the literal `!inline path` text as script content — that string would be persisted in flow_version.value and corrupt the flow on the next pull (GIT-871 / #9140).","triggerScenarios":"Pushing a flow whose flow.yaml contains `!inline` references to files that don't exist locally — files deleted, wrong relative path, flow.yaml copied from another checkout, or running push from the wrong cwd so relative paths don't resolve.","commonSituations":"Cleaning untracked files with git clean before pushing; partial git checkout; renamed/moved inline script files without updating flow.yaml; CI checking out only flow.yaml.","solutions":["Restore the missing inline files listed in the error (git checkout / re-pull the flow).","Remove the `!inline` references from flow.yaml if the files are intentionally gone.","Run push from the flow's root directory so relative paths resolve.","Inspect flow.yaml for stale `!inline` entries and fix their paths."],"exampleFix":"// before (flow.yaml)\ncontent: !inline ops/removed_script.ts\n// after\ngit checkout -- ops/removed_script.ts  # or remove the !inline step from flow.yaml","handlingStrategy":"validation","validationCode":"import { existsSync, readFileSync } from 'node:fs';\nconst yaml = readFileSync('flow.yaml', 'utf8');\nconst missing = [...yaml.matchAll(/!inline (.+)/g)].map(m => m[1]).filter(p => !existsSync(p));\nif (missing.length) throw new Error('missing inline files: ' + missing.join(', '));","typeGuard":"null","tryCatchPattern":"try { await pushFlow(...) } catch (e) { if (String(e).includes('missing inline script file')) restoreFromGit(e); else throw e; }","preventionTips":["Never delete inline script files referenced by flow.yaml without removing the reference","Use .gitignore patterns that keep inline files tracked","Pre-commit hook that resolves !inline refs before allowing push","Run push from the flow root so relative paths resolve"],"tags":["cli","flow","inline-scripts","file-not-found"],"backgroundTag":"missing-inline-file","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"}