{"record":{"id":"86e2bb9b98619a1d","repo":"windmill-labs/windmill","slug":"wmill-lock-yaml-is-at-unknown-version-conf-vers","errorCode":null,"errorMessage":"wmill-lock.yaml is at unknown version \"${conf.version}\". This was written by a newer wmill CLI; please upgrade with `wmill upgrade`. Refusing to operate to avoid corrupting the lockfile.","messagePattern":"wmill-lock\\.yaml is at unknown version \"(.+?)\"\\. This was written by a newer wmill CLI; please upgrade with `wmill upgrade`\\. Refusing to operate to avoid corrupting the lockfile\\.","errorType":"exception","errorClass":"UnknownLockVersionError","httpStatus":null,"severity":"error","filePath":"cli/src/utils/metadata.ts","lineNumber":1259,"sourceCode":"  if (inMemoryLock) return inMemoryLock;\n  let parsed: unknown;\n  try {\n    parsed = await yamlParseFile(WMILL_LOCKFILE);\n  } catch {\n    const lock: Lock = { locks: {}, version: CURRENT_LOCK_VERSION };\n    await writeFile(WMILL_LOCKFILE, yamlStringify(lock, yamlOptions), \"utf-8\");\n    log.info(colors.green(\"wmill-lock.yaml created\"));\n    return lock;\n  }\n  if (typeof parsed != \"object\" || parsed == null) {\n    throw new MalformedLockfileError(\n      \"wmill-lock.yaml is malformed (expected an object). \" +\n      \"Refusing to operate to avoid corrupting the lockfile.\",\n    );\n  }\n  const conf = parsed as Lock;\n  if (conf.version != null && !KNOWN_LOCK_VERSIONS.includes(conf.version)) {\n    throw new UnknownLockVersionError(\n      `wmill-lock.yaml is at unknown version \"${conf.version}\". This was ` +\n      `written by a newer wmill CLI; please upgrade with \\`wmill upgrade\\`. ` +\n      `Refusing to operate to avoid corrupting the lockfile.`,\n    );\n  }\n  return conf;\n}\n\nfunction v2LockPath(path: string, subpath?: string) {\n  const normalizedPath = normalizeLockPath(path);\n  if (subpath) {\n    return `${normalizedPath}+${normalizeLockPath(subpath)}`;\n  } else {\n    return normalizedPath;\n  }\n}\nexport async function checkifMetadataUptodate(\n  path: string,","sourceCodeStart":1241,"sourceCodeEnd":1277,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/utils/metadata.ts#L1241-L1277","documentation":"wmill-lock.yaml carries a version field identifying which lockfile schema wrote it. If the version is present but not in the CLI's KNOWN_LOCK_VERSIONS, the CLI throws UnknownLockVersionError and refuses to operate, because an older CLI cannot safely interpret a newer lockfile format. This protects the lockfile from being downgraded or corrupted.","triggerScenarios":"Running a wmill command that reads the lockfile after wmill-lock.yaml was written by a newer CLI release whose lock version is not recognized by the installed CLI.","commonSituations":"Upgrading the lockfile with a newer wmill on one machine (or CI) then using an older CLI on another; switching branches where a teammate regenerated the lockfile with a newer CLI; running a stale CLI in Docker while the host CLI is current.","solutions":["Upgrade the CLI with `wmill upgrade` (or your package manager) so it recognizes the lockfile version","If you cannot upgrade, have the teammate/machine with the newer CLI regenerate the lockfile with a compatible version","As a last resort, delete wmill-lock.yaml and let your (older) CLI regenerate it, accepting loss of locked dependency state","Check for mixed CLI versions across team/CI and pin a consistent wmill version"],"exampleFix":"// shell\n// before\n$ wmill sync pull   # errors: unknown lock version\n// after\n$ wmill upgrade\n$ wmill sync pull   # succeeds","handlingStrategy":"validation","validationCode":"const lock = yaml.parse(await readFile(\"wmill-lock.yaml\", \"utf-8\"));\nif (lock?.version != null && lock.version > CURRENT_LOCK_VERSION) {\n  console.warn(\"Lockfile was written by a newer wmill CLI — run `wmill upgrade` first.\");\n}","typeGuard":"function hasKnownVersion(v: unknown): v is { version?: number } {\n  return typeof v === \"object\" && v !== null &&\n    ((v as any).version == null || KNOWN_LOCK_VERSIONS.includes((v as any).version));\n}","tryCatchPattern":"try {\n  await wmillSyncPush();\n} catch (e) {\n  if (e instanceof UnknownLockVersionError) {\n    await runWmillUpgrade(); // then retry\n  } else throw e;\n}","preventionTips":["Pin the same wmill CLI version across dev machines and CI","Run `wmill upgrade` whenever a teammate bumps the lockfile version","Check lockfile version in CI and fail early with a clear message","Avoid mixing lockfiles regenerated by different CLI versions across branches"],"tags":["cli","lockfile","versioning","upgrade"],"backgroundTag":"unsupported-lockfile-version","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"}