jhonderson / actual-http-api

Basic Actual Budget API exposed through HTTP endpoints
MIT License
43 stars 13 forks source link

Potential Issue Reading Timestamps? #22

Closed latetedemelon closed 1 month ago

latetedemelon commented 2 months ago

Currently using "edge" on actual budget and I'm getting the error below. Potentially an API version issues?

actualhttpapi  | Actual HTTP Server Listening on PORT:  5007
actualhttpapi  | Actual api client initialized successfully
actualhttpapi  | Database is out of sync with migrations: {
actualhttpapi  |   appliedIds: [
actualhttpapi  |     1548957970627, 1550601598648, 1555786194328,
actualhttpapi  |     1561751833510, 1567699552727, 1582384163573,
actualhttpapi  |     1597756566448, 1608652596043, 1608652596044,
actualhttpapi  |     1612625548236, 1614782639336, 1615745967948,
actualhttpapi  |     1616167010796, 1618975177358, 1632571489012,
actualhttpapi  |     1679728867040, 1681115033845, 1682974838138,
actualhttpapi  |     1685007876842, 1686139660866, 1688749527273,
actualhttpapi  |     1688841238000, 1691233396000, 1694438752000,
actualhttpapi  |     1697046240000, 1704572023730, 1704572023731,
actualhttpapi  |     1707267033000, 1712784523000, 1716359441000,
actualhttpapi  |     1720310586000, 1720664867241, 1720665000000,
actualhttpapi  |     1722717601000
actualhttpapi  |   ],
actualhttpapi  |   available: [
actualhttpapi  |     '1548957970627_remove-db-version.sql',
actualhttpapi  |     '1550601598648_payees.sql',
actualhttpapi  |     '1555786194328_remove_category_group_unique.sql',
actualhttpapi  |     '1561751833510_indexes.sql',
actualhttpapi  |     '1567699552727_budget.sql',
actualhttpapi  |     '1582384163573_cleared.sql',
actualhttpapi  |     '1597756566448_rules.sql',
actualhttpapi  |     '1608652596043_parent_field.sql',
actualhttpapi  |     '1608652596044_trans_views.sql',
actualhttpapi  |     '1612625548236_optimize.sql',
actualhttpapi  |     '1614782639336_trans_views2.sql',
actualhttpapi  |     '1615745967948_meta.sql',
actualhttpapi  |     '1616167010796_accounts_order.sql',
actualhttpapi  |     '1618975177358_schedules.sql',
actualhttpapi  |     '1632571489012_remove_cache.js',
actualhttpapi  |     '1679728867040_rules_conditions.sql',
actualhttpapi  |     '1681115033845_add_schedule_name.sql',
actualhttpapi  |     '1682974838138_remove_payee_rules.sql',
actualhttpapi  |     '1685007876842_add_category_hidden.sql',
actualhttpapi  |     '1686139660866_remove_account_type.sql',
actualhttpapi  |     '1688749527273_transaction_filters.sql',
actualhttpapi  |     '1688841238000_add_account_type.sql',
actualhttpapi  |     '1691233396000_add_schedule_next_date_tombstone.sql',
actualhttpapi  |     '1694438752000_add_goal_targets.sql',
actualhttpapi  |     '1697046240000_add_reconciled.sql',
actualhttpapi  |     '1704572023730_add_account_sync_source.sql',
actualhttpapi  |     '1704572023731_add_missing_goCardless_sync_source.sql',
actualhttpapi  |     '1707267033000_reports.sql',
actualhttpapi  |     '1712784523000_unhide_input_group.sql',
actualhttpapi  |     '1716359441000_include_current.sql',
actualhttpapi  |     '1720310586000_link_transfer_schedules.sql',
actualhttpapi  |     '1720664867241_add_payee_favorite.sql',
actualhttpapi  |     '1720665000000_goal_context.sql'
actualhttpapi  |   ]
actualhttpapi  | }
actualhttpapi  | Error updating Error: out-of-sync-migrations
actualhttpapi  |     at checkDatabaseValidity (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39631:31)
actualhttpapi  |     at Module.migrate (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39639:17)
actualhttpapi  |     at async runMigrations (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43510:17)
actualhttpapi  |     at async updateVersion (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43529:17)
actualhttpapi  |     at async loadBudget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39254:21)
actualhttpapi  |     at async handlers.load-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39084:29)
actualhttpapi  |     at async handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29637:21)
actualhttpapi  | TypeError: Cannot read properties of undefined (reading 'timestamp')
actualhttpapi  |     at _fullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42849:98)
actualhttpapi  |     at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42761:38
actualhttpapi  |     at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43707:38
actualhttpapi  |     at initialFullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42747:38)
actualhttpapi  |     at handlers.sync-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39069:94)
actualhttpapi  |     at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29640:65)
actualhttpapi  | [Exception] TypeError: Cannot read properties of undefined (reading 'timestamp')
actualhttpapi  |     at _fullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42849:98)
actualhttpapi  |     at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42761:38
actualhttpapi  |     at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43707:38
actualhttpapi  |     at initialFullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42747:38)
actualhttpapi  |     at handlers.sync-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39069:94)
actualhttpapi  |     at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29640:65)
actualhttpapi  | Unknown error while interacting with Actual Api. See server logs for more information Error: We had an unknown problem opening “My-Finances-d5c7721”.
actualhttpapi  |     at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29642:31)
actualhttpapi  | unhandledRejection Error: We had an unknown problem opening “My-Finances-d5c7721”.
actualhttpapi  |     at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29642:31)
jhonderson commented 2 months ago

Hey there, can you double check the version of the actual http api (in the swagger page) and the actual server version ? They should be both latest, or compatible

antoncuranz commented 1 month ago

Had the same problem after updating to actual 24.9.0. Bumping @actual-app/api fixes this.