{"record":{"id":"5c8af6b20eea221a","repo":"actualbudget/actual","slug":"date-can-not-be-found-schedules-can-not-be-create","errorCode":null,"errorMessage":"Date can not be found. Schedules can not be created without a date there is a bug here","messagePattern":"Date can not be found\\. Schedules can not be created without a date there is a bug here","errorType":"exception","errorClass":"APIError","httpStatus":null,"severity":"error","filePath":"packages/loot-core/src/server/api.ts","lineNumber":1059,"sourceCode":"          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(\n            `Date can not be found. Schedules can not be created without a date there is a bug here`,\n          );\n        }\n        break;\n      }\n      default: {\n        throw APIError(`Unhandled field: ${typedKey}`);\n      }\n    }\n  }\n\n  if (conditionsUpdated) {\n    return handlers['schedule/update']({\n      schedule: {\n        id: sched.id,\n        posts_transaction: sched.posts_transaction,\n        name: sched.name,\n      },","sourceCodeStart":1041,"sourceCodeEnd":1077,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/api.ts#L1041-L1077","documentation":"Schedules require a date condition; the update handler only overwrites the date value if a 'date' condition already exists. If it is missing (dateIndex === -1), the APIError declares this a bug, since schedules cannot legitimately exist without a date condition.","triggerScenarios":"Updating fields.date on a schedule whose _conditions array has no 'date' field — only possible when the schedule data is corrupt, hand-edited, or came from an abnormal import path.","commonSituations":"Restored or partially-synced budgets where conditions were lost; schedules modified directly via low-level rules APIs bypassing creation invariants.","solutions":["Delete and recreate the schedule with a valid date condition.","Add a date condition to the schedule through the rules/conditions API before updating.","Check sync/import integrity if multiple schedules are missing conditions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const sched = await actual.getSchedule(id);\nif (!sched._conditions || !sched._conditions.some(c => c.field === 'date')) {\n  throw new Error('Schedule is corrupt: no date condition; recreate it');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await actual.updateSchedule(id, { date: '2026-09-01' });\n} catch (e) {\n  if (String(e.message).includes('Date can not be found')) {\n    // schedule is corrupt: delete and recreate\n  } else throw e;\n}","preventionTips":["Always create schedules with a date condition","Audit schedules after imports/restores for missing conditions","Recreate instead of patching schedules missing invariants"],"tags":["schedules","internal-state","data-corruption"],"backgroundTag":"schedule-condition-missing","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}