actualbudget / actual

A local-first personal finance app
https://actualbudget.org
MIT License
12.51k stars 954 forks source link

[Bug]: Database is out of sync with migrations #2949

Closed totalitarian closed 5 days ago

totalitarian commented 5 days ago

Verified issue does not already exist?

What happened?

Fresh install of 24.6 and I get this error

Actual api client initialized successfully
Database is out of sync with migrations: {
  appliedIds: [
    1548957970627, 1550601598648, 1555786194328,
    1561751833510, 1567699552727, 1582384163573,
    1597756566448, 1608652596043, 1608652596044,
    1612625548236, 1614782639336, 1615745967948,
    1616167010796, 1618975177358, 1632571489012,
    1679728867040, 1681115033845, 1682974838138,
    1685007876842, 1686139660866, 1688749527273,
    1688841238000, 1691233396000, 1694438752000,
    1697046240000, 1704572023730, 1704572023731,
    1707267033000, 1712784523000, 1716359441000
  ],
  available: [
    '1548957970627_remove-db-version.sql',
    '1550601598648_payees.sql',
    '1555786194328_remove_category_group_unique.sql',
    '1561751833510_indexes.sql',
    '1567699552727_budget.sql',
    '1582384163573_cleared.sql',
    '1597756566448_rules.sql',
    '1608652596043_parent_field.sql',
    '1608652596044_trans_views.sql',
    '1612625548236_optimize.sql',
    '1614782639336_trans_views2.sql',
    '1615745967948_meta.sql',
    '1616167010796_accounts_order.sql',
    '1618975177358_schedules.sql',
    '1632571489012_remove_cache.js',
    '1679728867040_rules_conditions.sql',
    '1681115033845_add_schedule_name.sql',
    '1682974838138_remove_payee_rules.sql',
    '1685007876842_add_category_hidden.sql',
    '1686139660866_remove_account_type.sql',
    '1688749527273_transaction_filters.sql',
    '1688841238000_add_account_type.sql',
    '1691233396000_add_schedule_next_date_tombstone.sql',
    '1694438752000_add_goal_targets.sql',
    '1697046240000_add_reconciled.sql',
    '1704572023730_add_account_sync_source.sql',
    '1704572023731_add_missing_goCardless_sync_source.sql',
    '1707267033000_reports.sql',
    '1712784523000_unhide_input_group.sql'
  ]
}
Error updating Error: out-of-sync-migrations
    at checkDatabaseValidity (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39329:31)
    at Module.migrate (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:39337:17)
    at async runMigrations (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43144:17)
    at async updateVersion (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43163:17)
    at async loadBudget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:38945:21)
    at async handlers.load-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:38775:29)
    at async handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29468:21)
TypeError: Cannot read properties of undefined (reading 'timestamp')
    at _fullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42483:98)
    at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42395:38
    at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43341:38
    at initialFullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42381:38)
    at handlers.sync-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:38760:94)
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29471:65)
[Exception] TypeError: Cannot read properties of undefined (reading 'timestamp')
    at _fullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42483:98)
    at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42395:38
    at /usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:43341:38
    at initialFullSync (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:42381:38)
    at handlers.sync-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:38760:94)
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29471:65)
Unknown error while interacting with Actual Api. See server logs for more information Error: We had an unknown problem opening “My-Finances-347c8aa”.
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29473:31)
unhandledRejection Error: We had an unknown problem opening “My-Finances-347c8aa”.
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:29473:31)
Actual HTTP Server Listening on PORT:  5007

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Microsoft Edge

Operating System

Linux

youngcw commented 5 days ago

did you use the edge build at some point? or use a different desktop client than the one on the release page?

youngcw commented 5 days ago

The easy fix probably is to update your server to edge until the next release comes through

totalitarian commented 5 days ago

I did use edge at one point. So what i'm trying to do now is start completely from fresh but I keep getting references to My-Finances-347c8aa somehow

totalitarian commented 5 days ago

I tried going back to edge but still get the same issue

youngcw commented 5 days ago

if you are trying to start from scratch make sure you clear your browser cache and delete all the server files

totalitarian commented 5 days ago

Just tried that. This is my landing page on actual

image

But still get this error even after cache reset We had an unknown problem opening “My-Finances-347c8aa”

I'm at a loss how it can still think My-Finances-347c8aa exists...

youngcw commented 5 days ago

Maybe try changing the ip:port or url to kinda force everything to go away. Also that old budget file could have resynced to the server before the error, so check that

youngcw commented 5 days ago

one thing that helps is to use an incognito window so that way nothing is stored in your browser. That can help narrow down which side is remembering things

totalitarian commented 5 days ago

Sorry to be a pain but i've cleared caches, installed actual on another server, ip:port and only used incognito. I'm totally baffled now...

youngcw commented 5 days ago

:shrug: Something must be holding onto data

totalitarian commented 5 days ago

did you use the edge build at some point? or use a different desktop client than the one on the release page?

Managed to fix it. I had to clear cache on my iphone, ipad and PC. Got there in the end and thank you for your patience