windmill-labs/windmill · error

Cannot regenerate lock for flow ${remote_path}: missing inli

Error message

Cannot regenerate lock for flow ${remote_path}: missing inline script file(s): ${missingFiles.join(", ")}. Either restore the file(s) or remove the !inline reference(s) from flow.yaml before retrying.

What it means

When regenerating a flow's lockfile, `!inline` script references are replaced with remote script content. If one or more referenced local files are missing on disk, the CLI aborts before calling updateFlow — otherwise the literal string '!inline path' would be pushed as rawscript.content (GIT-871 / #9140). Because replaceInlineScripts has already mutated flowValue.value in place for resolved modules, callers must re-parse rather than reuse it after this throw.

Source

Thrown at cli/src/commands/flow/flow_metadata.ts:293

      log,
      folder + SEP!,
      SEP,
      locksToRemove,
      missingFiles
    );
    if (flowValue.value.failure_module) {
      await replaceInlineScripts([flowValue.value.failure_module], fileReader, log, folder + SEP!, SEP, locksToRemove, missingFiles);
    }
    if (flowValue.value.preprocessor_module) {
      await replaceInlineScripts([flowValue.value.preprocessor_module], fileReader, log, folder + SEP!, SEP, locksToRemove, missingFiles);
    }
    if (missingFiles.length > 0) {
      // Abort before updateFlow rather than push the literal `!inline path`
      // string as rawscript.content (GIT-871 / #9140). Note: at this point
      // replaceInlineScripts has already mutated `flowValue.value` in place
      // for the modules that *did* resolve. All current callers re-throw on
      // this error; do not catch and reuse `flowValue` without re-parsing.
      throw new Error(
        `Cannot regenerate lock for flow ${remote_path}: missing inline script file(s): ${missingFiles.join(", ")}. ` +
        `Either restore the file(s) or remove the !inline reference(s) from flow.yaml before retrying.`
      );
    }

    //removeChangedLocks
    const tempScriptRefs = tree?.getTempScriptRefs(folderNormalized);

    // Preserve notes and groups — the backend round-trips through FlowValue
    // which doesn't include these fields, so they'd be lost (#8641).
    const savedNotes = flowValue.value.notes;
    const savedGroups = flowValue.value.groups;

    flowValue.value = await updateFlow(
      workspace,
      flowValue.value,
      remote_path,
      filteredDeps,

View on GitHub (pinned to e474e8803c)

Solutions

  1. Restore the missing file(s) listed in the error message at the referenced paths
  2. Remove the `!inline` reference(s) from flow.yaml and point the module at a remote script path instead
  3. Re-run the command from the flow's directory (or repo root) so relative paths resolve
  4. In CI, ensure the checkout includes all files referenced by the flow

Example fix

// flow.yaml before
value: !inline ./scripts/helper.ts   # file deleted
// after (option A) restore scripts/helper.ts, or (option B)
value:
  path: u/admin/helper   # use a remote script instead of !inline
Defensive patterns

Strategy: validation

Validate before calling

import { readFileSync, dirname } from 'node:fs';
for (const ref of inlineRefs(flowYaml)) {
  const p = resolve(flowDir, ref);
  if (!existsSync(p)) throw new Error(`missing inline file for ${ref}`);
}

Try / catch

try {
  await generateLocks();
} catch (e) {
  if (String(e).includes('missing inline script file(s)')) {
    // re-parse flow.yaml from disk; flowValue was mutated in place
    const fresh = parseFlowYaml(await fsp.readFile('flow.yaml', 'utf8'));
    // restore the missing files, then retry once
  }
}

Prevention

When it happens

Trigger: Running `wmill flow generate-locks` (or push with lock regeneration) on a flow whose flow.yaml contains `!inline ./relative/path.ts` where the file was deleted, renamed, or is outside the expected working directory.

Common situations: Deleting a helper script from the repo without updating flow.yaml; running the CLI from a different working directory so relative paths don't resolve; partial checkouts in CI (sparse clone, submodule not initialized).

Related errors


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