{"record":{"id":"b93e015378182171","repo":"Budibase/budibase","slug":"workspace-app-not-found","errorCode":null,"errorMessage":"Workspace app not found","messagePattern":"Workspace app not found","errorType":"http","errorClass":"HTTPError","httpStatus":400,"severity":"error","filePath":"packages/server/src/sdk/workspace/navigation/index.ts","lineNumber":59,"sourceCode":"  updatedLinks.forEach(link => {\n    if (link.type === \"sublinks\" && link.subLinks?.length) {\n      link.subLinks = link.subLinks.filter(subLink => subLink.url !== route)\n    }\n  })\n\n  await sdk.workspaceApps.update({\n    ...workspaceApp,\n    navigation: { ...workspaceApp.navigation, links: updatedLinks },\n  })\n}\n\nexport async function update(\n  workspaceAppId: string,\n  navigation: AppNavigation\n) {\n  const workspaceApp = await sdk.workspaceApps.get(workspaceAppId)\n  if (!workspaceApp) {\n    throw new HTTPError(\"Workspace app not found\", 400)\n  }\n  await sdk.workspaceApps.update({ ...workspaceApp, navigation })\n}\n","sourceCodeStart":41,"sourceCodeEnd":63,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/sdk/workspace/navigation/index.ts#L41-L63","documentation":"update replaces a workspace app's navigation but first checks the app exists; when sdk.workspaceApps.get returns nothing it throws HTTP 400 'Workspace app not found'. Unlike addLink's 500, this is treated as a client error: the caller supplied an unknown or deleted workspaceAppId.","triggerScenarios":"Calling update(workspaceAppId, navigation) with an ID that does not exist in the current workspace DB, was deleted, or was created in a different workspace/tenant; also surfaces indirectly through addLink/deleteLink which route through update.","commonSituations":"Builder UI holding a stale app ID after the app was removed; automation steps referencing an app from another environment; tenant context misconfiguration so the lookup hits the wrong DB.","solutions":["Confirm the workspaceAppId against the workspace app list API before updating","Re-create the app or pick a valid ID if it was deleted","Verify the tenancy/workspace context of the request so the lookup queries the correct database"],"exampleFix":"// before\nawait update(deletedAppId, navigation) // 400 Workspace app not found\n// after\nconst app = await sdk.workspaceApps.get(deletedAppId)\nif (!app) throw new Error(\"Pick a valid workspace app before updating navigation\")\nawait update(app._id!, navigation)","handlingStrategy":"try-catch","validationCode":"const app = await sdk.workspaceApps.get(workspaceAppId)\nif (!app) {\n  throw new HTTPError(`Workspace app ${workspaceAppId} not found`, 400)\n}","typeGuard":null,"tryCatchPattern":"try {\n  await navigation.update(workspaceAppId, navigation)\n} catch (err) {\n  if (err instanceof HTTPError && err.status === 400 && err.message === \"Workspace app not found\") {\n    // pick a valid app or surface a user-facing message\n    return\n  }\n  throw err\n}","preventionTips":["Verify the app exists via the workspace apps API before updating navigation","Watch for indirect failures via addLink/deleteLink which call update internally","Check tenant/workspace context when IDs look valid but lookups return nothing"],"tags":["navigation","workspace-app","not-found","http-400"],"backgroundTag":"resource-not-found","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}