{"record":{"id":"2c053c58794b2cf9","repo":"actualbudget/actual","slug":"ammount-can-not-be-found-there-is-a-bug-here","errorCode":null,"errorMessage":"Ammount can not be found. There is a bug here","messagePattern":"Ammount can not be found\\. There is a bug here","errorType":"exception","errorClass":"APIError","httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/api.ts","lineNumber":1041,"sourceCode":"          switch (value) {\n            case 'is':\n              convertedOp = 'is';\n              break;\n            case 'isapprox':\n              convertedOp = 'isapprox';\n              break;\n            case 'isbetween':\n              convertedOp = 'isbetween';\n              break;\n            default:\n              throw APIError(\n                `Invalid amount operator: ${String(value)}. Expected: is, isapprox, or isbetween`,\n              );\n          }\n          sched._conditions[amountIndex].op = convertedOp;\n          conditionsUpdated = true;\n        } else {\n          throw APIError(`Ammount can not be found. There is a bug here`);\n        }\n        break;\n      }\n      case 'amount': {\n        if (amountIndex !== -1) {\n          sched._conditions[amountIndex].value = value;\n          conditionsUpdated = true;\n        } else {\n          throw APIError(`Ammount can not be found. There is a bug here`);\n        }\n        break;\n      }\n      case 'date': {\n        if (dateIndex !== -1) {\n          sched._conditions[dateIndex].value = value;\n          conditionsUpdated = true;\n        } else {\n          throw APIError(","sourceCodeStart":1023,"sourceCodeEnd":1059,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/api.ts#L1023-L1059","documentation":"Inside the 'amountOp' update branch, the code looks for an existing 'amount' condition in the schedule's rules. If no amount condition exists (amountIndex === -1), it throws this internal-consistency error, since an operator cannot be applied without an amount condition. The message admits this is unexpected — schedules are normally created with an amount condition.","triggerScenarios":"Updating amountOp on a schedule whose _conditions array lacks an 'amount' field condition — typically a schedule created or mutated outside the normal creation path, or one whose conditions were manually edited in the rules.","commonSituations":"Schedules imported from external tools or older data formats without amount conditions; directly manipulating conditions via lower-level rules APIs before calling the schedule update API.","solutions":["Ensure the schedule has an amount condition before updating amountOp (recreate the schedule with an amount field).","Inspect the schedule's conditions via the rules API and add an amount condition first.","If the schedule is corrupt, delete and recreate it with valid amount and date conditions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const sched = await actual.getSchedule(id);\nconst hasAmount = sched._conditions && sched._conditions.some(c => c.field === 'amount');\nif (!hasAmount) throw new Error('Schedule has no amount condition; recreate it');","typeGuard":null,"tryCatchPattern":"try {\n  await actual.updateSchedule(id, { amountOp: 'isapprox' });\n} catch (e) {\n  if (String(e.message).includes('Ammount can not be found')) {\n    // recreate the schedule with full conditions\n  } else throw e;\n}","preventionTips":["Only update schedules created through the official createSchedule API","Inspect _conditions before mutating operator/value fields","Recreate corrupt schedules instead of patching them"],"tags":["schedules","internal-state","api"],"backgroundTag":"schedule-condition-missing","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}