{"record":{"id":"0c3840af5154bab3","repo":"windmill-labs/windmill","slug":"app-apppath-not-found","errorCode":null,"errorMessage":"App ${appPath} not found","messagePattern":"App (.+?) not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/app/app.ts","lineNumber":481,"sourceCode":"  })\n  .command(\n    \"set-permissioned-as\",\n    \"Set the on_behalf_of_email for an app (requires admin or wm_deployers group)\"\n  )\n  .arguments(\"<path:string> <email:string>\")\n  .action((async (opts: any, appPath: string, email: string) => {\n    const workspace = await resolveWorkspace(opts);\n    await requireLogin(opts);\n\n    const { lookupUsernameByEmail } = await import(\"../../core/permissioned_as.ts\");\n    const cache = new Map<string, { username: string; email: string }>();\n    const username = await lookupUsernameByEmail(workspace.workspaceId, email, cache);\n\n    const remote = await wmill.getAppByPath({\n      workspace: workspace.workspaceId,\n      path: appPath,\n    });\n    if (!remote) throw new Error(`App ${appPath} not found`);\n\n    // Only spread remote.policy — spreading the full remote object would include\n    // `value` and trigger a new app version on every call. EditApp has all-Option\n    // fields, so a minimal body only updates the policy column.\n    await wmill.updateApp({\n      workspace: workspace.workspaceId,\n      path: appPath,\n      requestBody: {\n        policy: {\n          ...(remote.policy as any),\n          on_behalf_of: `u/${username}`,\n          on_behalf_of_email: email,\n        } as any,\n        preserve_on_behalf_of: true,\n        // Preserve any user draft at this path (see backend skip_draft_deletion).\n        skip_draft_deletion: true,\n      },\n    });","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/app/app.ts#L463-L499","documentation":"This CLI error is raised during `wmill app push`/sync when the remote workspace returns no app for the given path: `wmill.getAppByPath` resolves to a falsy value (404) and the code throws explicitly. It means the app you are trying to update does not exist remotely under that exact path.","triggerScenarios":"Running an app sync/push command with --path (or an app metadata path) pointing to an app that was never created, was deleted, was renamed, or whose path casing/spacing differs from the remote one, in a different workspace than expected.","commonSituations":"Typo in the app path in the local app folder; pushing to a fresh workspace/instance where the app was never created; the app was deleted by a teammate; switching workspaces (the CLI workspace is not the one containing the app); path changed after a rename while local files still use the old one.","solutions":["Create the app first (wmill app push creates it if missing — check you didn't pass a flag/mode that only edits) or verify the command mode you used","Confirm the exact remote path in the Windmill UI and fix the path in your local app folder/app.yaml","Run `wmill workspace switch` (or pass the right workspace) to make sure you target the workspace that owns the app","Check for typos, extra whitespace, or case differences in the path"],"exampleFix":"// before\nawait wmill.updateApp({ workspace, path: \"f/apps/dasboard\", ... });\n// after (typo fixed and app verified to exist)\nconst app = await wmill.getAppByPath({ workspace, path: \"f/apps/dashboard\" });\nif (!app) throw new Error(\"create the app first: wmill app push\");","handlingStrategy":"type-guard","validationCode":"const remote = await wmill.getAppByPath({ workspace: ws, path: appPath });\nif (!remote) {\n  console.error(`App ${appPath} not found in workspace ${ws}; create it or fix the path before updating.`);\n  process.exit(1);\n}","typeGuard":"function appExists(app: { path?: string } | null | undefined): app is { path: string } {\n  return !!app && typeof app.path === 'string';\n}","tryCatchPattern":"try {\n  await wmill.updateApp({ workspace, path: appPath, body });\n} catch (e) {\n  if (String(e).includes('not found')) {\n    console.error(`App ${appPath} does not exist remotely — run 'wmill app push' to create it or verify the path/workspace.`);\n  }\n  throw e;\n}","preventionTips":["Verify the app path in the UI matches the local app folder before sync/push","Run `wmill workspace current` to confirm you target the right workspace","Prefer `wmill app push` (which creates missing apps) over edit-only flows for first-time deploys"],"tags":["cli","app","not-found","path"],"backgroundTag":"resource-not-found","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"}