actualbudget/actual · error · APIError

Ammount can not be found. There is a bug here

Error message

Ammount can not be found. There is a bug here

What it means

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.

Source

Thrown at packages/loot-core/src/server/api.ts:1041

          switch (value) {
            case 'is':
              convertedOp = 'is';
              break;
            case 'isapprox':
              convertedOp = 'isapprox';
              break;
            case 'isbetween':
              convertedOp = 'isbetween';
              break;
            default:
              throw APIError(
                `Invalid amount operator: ${String(value)}. Expected: is, isapprox, or isbetween`,
              );
          }
          sched._conditions[amountIndex].op = convertedOp;
          conditionsUpdated = true;
        } else {
          throw APIError(`Ammount can not be found. There is a bug here`);
        }
        break;
      }
      case 'amount': {
        if (amountIndex !== -1) {
          sched._conditions[amountIndex].value = value;
          conditionsUpdated = true;
        } else {
          throw APIError(`Ammount can not be found. There is a bug here`);
        }
        break;
      }
      case 'date': {
        if (dateIndex !== -1) {
          sched._conditions[dateIndex].value = value;
          conditionsUpdated = true;
        } else {
          throw APIError(

View on GitHub (pinned to d4334cb6e6)

Solutions

  1. Ensure the schedule has an amount condition before updating amountOp (recreate the schedule with an amount field).
  2. Inspect the schedule's conditions via the rules API and add an amount condition first.
  3. If the schedule is corrupt, delete and recreate it with valid amount and date conditions.
Defensive patterns

Strategy: try-catch

Validate before calling

const sched = await actual.getSchedule(id);
const hasAmount = sched._conditions && sched._conditions.some(c => c.field === 'amount');
if (!hasAmount) throw new Error('Schedule has no amount condition; recreate it');

Try / catch

try {
  await actual.updateSchedule(id, { amountOp: 'isapprox' });
} catch (e) {
  if (String(e.message).includes('Ammount can not be found')) {
    // recreate the schedule with full conditions
  } else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of actualbudget/actual@d4334cb6e6 (2026-08-29). Data as JSON: /api/errors/2c053c58794b2cf9. Report an issue: GitHub.