{"record":{"id":"cf8b53b9000c2d3c","repo":"actualbudget/actual","slug":"budget-not-found","errorCode":"budget-not-found","errorMessage":"Budget \"${syncId}\" not found. Check the sync id of your budget in the Advanced section of the settings page.","messagePattern":"Budget \"(.+?)\" not found\\. Check the sync id of your budget in the Advanced section of the settings page\\.","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/api.ts","lineNumber":201,"sourceCode":"    await handlers['close-budget']();\n  }\n\n  const budgets = await handlers['get-budgets']();\n  const localBudget = budgets.find(b => b.groupId === syncId);\n  let remoteBudget: RemoteFile;\n\n  // Load a remote file if we could not find the file locally\n  if (!localBudget) {\n    const files = await handlers['get-remote-files']();\n    if (!files) {\n      throw withErrorCode(\n        new Error('Could not get remote files'),\n        'network-failure',\n      );\n    }\n    const file = files.find(f => f.groupId === syncId);\n    if (!file) {\n      throw withErrorCode(\n        new Error(\n          `Budget \"${syncId}\" not found. Check the sync id of your budget in the Advanced section of the settings page.`,\n        ),\n        'budget-not-found',\n      );\n    }\n\n    remoteBudget = file;\n  }\n\n  const activeFile = remoteBudget ? remoteBudget : localBudget;\n\n  // Set the e2e encryption keys\n  if (activeFile.encryptKeyId) {\n    if (!password) {\n      throw withErrorCode(\n        new Error(\n          `File ${activeFile.name} is encrypted. Please provide a password.`,","sourceCodeStart":183,"sourceCodeEnd":219,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/api.ts#L183-L219","documentation":"Thrown by api/download-budget in packages/loot-core/src/server/api.ts when the remote file list was fetched successfully but no file has a groupId matching the provided syncId. Tagged with code 'budget-not-found'. The message explicitly directs the user to check the sync id in the Advanced section of the settings page.","triggerScenarios":"Calling downloadBudget(syncId) where syncId does not match any remote budget's groupId — wrong id, budget deleted from the server, or the local file exists under a different sync id so the remote lookup path ran against the wrong id.","commonSituations":"Copy-pasting the wrong id (e.g. fileId instead of groupId/syncId); budget deleted via the settings page on another device; connecting to a different sync server than the one hosting the budget.","solutions":["Open the server's web app > Settings > Advanced and copy the exact sync id of the budget","Confirm you are connecting to the correct sync server instance","List remote files programmatically (get-remote-files) and match groupId before downloading","If the budget was deleted, restore from the server's data directory backup or re-upload it"],"exampleFix":"// before\nawait api.downloadBudget('abc123');\n// after\nconst files = await api.getRemoteFiles?.() ?? [];\nconst match = files.find(f => f.groupId === syncId);\nif (!match) throw new Error(`No remote budget with syncId ${syncId}; check Settings > Advanced`);\nawait api.downloadBudget(syncId);","handlingStrategy":"validation","validationCode":"const remote = await getRemoteFiles();\nif (!remote.some(f => f.groupId === syncId)) throw new Error(`Unknown syncId: ${syncId}`);","typeGuard":"function isRemoteFile(f: unknown): f is { groupId: string; fileId: string } {\n  return typeof f === 'object' && f !== null && typeof (f as any).groupId === 'string';\n}","tryCatchPattern":"try {\n  await api.downloadBudget(syncId);\n} catch (e) {\n  if (e.code === 'budget-not-found') {\n    const ids = (await getRemoteFiles()).map(f => f.groupId);\n    throw new Error(`${syncId} not found. Known ids: ${ids.join(', ')}`);\n  }\n  throw e;\n}","preventionTips":["Copy the sync id directly from Settings > Advanced, never retype it","Confirm the groupId (not fileId) is what downloadBudget expects","Verify you point at the correct sync server instance","List remote files and assert the id exists before downloading"],"tags":["sync","budget-not-found","api"],"backgroundTag":"budget-not-found","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}