{"record":{"id":"c839b83b257dc5b5","repo":"windmill-labs/windmill","slug":"no-instanceuserspath-file-found","errorCode":null,"errorMessage":"No ${instanceUsersPath} file found","messagePattern":"No (.+?) file found","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/user/user.ts","lineNumber":436,"sourceCode":"    log.info(\"Pulling users from instance...\");\n    await writeFile(\n      instanceUsersPath,\n      yamlStringify(remoteUsers as any),\n      \"utf-8\"\n    );\n    log.info(colors.green(`Users written to ${instanceUsersPath}`));\n  }\n}\n\nexport async function readInstanceUsers(opts: InstanceSyncOptions) {\n  let localUsers: ExportedUser[] = [];\n\n  await checkInstanceUsersPath(opts);\n\n  try {\n    localUsers = (await yamlParseFile(instanceUsersPath)) as ExportedUser[];\n  } catch {\n    log.warn(`No ${instanceUsersPath} file found`);\n  }\n  return localUsers;\n}\n\nexport async function readInstanceGroups(opts: InstanceSyncOptions) {\n  let localGroups: InstanceGroup[] = [];\n\n  checkInstanceGroupsPath(opts);\n\n  try {\n    localGroups = (await yamlParseFile(\n      instanceGroupsPath\n    )) as ExportedInstanceGroup[];\n  } catch {\n    log.warn(`No ${instanceGroupsPath} file found`);\n  }\n  return localGroups;\n}","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/user/user.ts#L418-L454","documentation":"`readInstanceUsers` in the instance-user sync command parses the local instanceUsers file (path from instanceUsersPath, e.g. instance_users.yaml) with yamlParseFile. If parsing throws — typically because the file does not exist — it logs this warning and returns an empty user list rather than failing the command. The instance sync then behaves as if there are no local users defined.","triggerScenarios":"Running `wmill user ...` commands that call localUsers/readInstanceUsers (e.g. instance user sync) when the instance users YAML file has not been exported/created at the expected path.","commonSituations":"Fresh checkout missing the instance users export; wrong --instance-users-path or cwd so the file isn't found; deleted file after a failed export; typo in filename.","solutions":["Create/export the file first: run the instance users export command (e.g. `wmill user instance ... export` or equivalent) to generate instanceUsersPath.","Verify the path option/cwd matches where the YAML actually lives (`ls <instanceUsersPath>`).","If an empty list is genuinely acceptable, ignore the warning.","Check file permissions if the file exists but cannot be read."],"exampleFix":"// before\nwmill user instance sync  # No instance_users.yaml file found\n// after\nwmill user instance ... export  # writes instance_users.yaml\nwmill user instance sync","handlingStrategy":"fallback","validationCode":"// Before running instance sync, check the file exists:\nimport fs from 'fs';\nif (!fs.existsSync(instanceUsersPath)) {\n  throw new Error(`Run the export first: ${instanceUsersPath} missing`);\n}","typeGuard":"function isExportedUsers(v: unknown): v is ExportedUser[] {\n  return Array.isArray(v) && v.every((u) => typeof u === 'object' && u !== null && 'email' in u);\n}","tryCatchPattern":"let localUsers: ExportedUser[] = [];\ntry {\n  localUsers = (await yamlParseFile(instanceUsersPath)) as ExportedUser[];\n} catch {\n  log.warn(`No ${instanceUsersPath} file found — continuing with empty list`);\n}","preventionTips":["Run the instance users export before any instance sync command","Run commands from the directory containing the YAML, or pass an explicit path","Add a CI check that the exported file exists before sync jobs","Verify file permissions when the file should exist"],"tags":["cli","user","instance-sync","missing-file","yaml"],"backgroundTag":"missing-local-sync-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"}