[Bug]: API can't sync because of missing migrations #489

Closed
opened 2026-02-28 19:05:58 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @CarloDePieri on GitHub (Jul 7, 2023).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

API version: 6.1.0
Actual server version: 23.7.1

After upgrading the server (I think I was on 23.6.0 before) I'm now getting, on a fresh api install, Error updating Error: out-of-sync-migrations.
I'm not familiar with this codebase, but I noticed that my local node_modules/@actual-api/api/dist/migrations and https://github.com/actualbudget/actual/tree/master/packages/loot-core/migrations (the only place where I found migrations) do seem out of sync. These files are missing in the api folder:

By manually adding them, I can sync again.

What error did you receive?

Error updating Error: out-of-sync-migrations

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

No response

Operating System

Linux

Originally created by @CarloDePieri on GitHub (Jul 7, 2023). ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? API version: `6.1.0` Actual server version: `23.7.1` After upgrading the server (I think I was on `23.6.0` before) I'm now getting, on a fresh api install, `Error updating Error: out-of-sync-migrations`. I'm not familiar with this codebase, but I noticed that my local `node_modules/@actual-api/api/dist/migrations` and https://github.com/actualbudget/actual/tree/master/packages/loot-core/migrations (the only place where I found migrations) do seem out of sync. These files are missing in the api folder: - [1685375406832_transaction_filters.sql](https://github.com/actualbudget/actual/blob/master/packages/loot-core/migrations/1685375406832_transaction_filters.sql) - [1686139660866_remove_account_type.sql](https://github.com/actualbudget/actual/blob/master/packages/loot-core/migrations/1686139660866_remove_account_type.sql) By manually adding them, I can sync again. ### What error did you receive? Error updating Error: out-of-sync-migrations ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? _No response_ ### Operating System Linux
GiteaMirror added the bug label 2026-02-28 19:05:58 -06:00
Author
Owner

@CarloDePieri commented on GitHub (Jul 7, 2023):

Diving into this further:

  • Building the api from the current head correctly puts the missing migrations in the dist/migrations folder
  • The package currently on the npmjs registry is indeed missing those migration files (which makes sense since that build is one month old)

I see that the ci builds an api package: is there no automated system in place to publish it on the registry?

@CarloDePieri commented on GitHub (Jul 7, 2023): Diving into this further: - Building the api from the [current head](https://github.com/actualbudget/actual/commit/02b1e03611550393a5dd6c280c7d50e4d5736dd7) correctly puts the missing migrations in the dist/migrations folder - The package currently on the [npmjs registry](https://www.npmjs.com/package/@actual-app/api?activeTab=code) is indeed missing those migration files (which makes sense since that build is one month old) I see that the ci builds an api package: is there no automated system in place to publish it on the registry?
Author
Owner

@MatissJanis commented on GitHub (Jul 7, 2023):

👋 We'll fix https://github.com/actualbudget/actual/issues/1296 very soon and then I'll push out a new API release.

We don't have an automated release process for the API package, but it would be a great addition if you'd like to contribute.

@MatissJanis commented on GitHub (Jul 7, 2023): 👋 We'll fix https://github.com/actualbudget/actual/issues/1296 very soon and then I'll push out a new API release. We don't have an automated release process for the API package, but it would be a great addition if you'd like to contribute.
Author
Owner

@j-f1 commented on GitHub (Jul 7, 2023):

Off the top of my head here’s what I’d like to see in an automation:

  • check that runs on release/* PRs that fails unless the API package version is updated (so that we can choose to release the new version as patch/minor/major as needed)
  • check that runs when the release PR is merged / when the release tag is pushed that does the publish

…but if you have experience with this sort of thing (which I don’t really) I am interested to hear your thoughts.

@j-f1 commented on GitHub (Jul 7, 2023): Off the top of my head here’s what I’d like to see in an automation: - check that runs on `release/*` PRs that fails unless the API package version is updated (so that we can choose to release the new version as patch/minor/major as needed) - check that runs when the release PR is merged / when the release tag is pushed that does the publish …but if you have experience with this sort of thing (which I don’t really) I am interested to hear your thoughts.
Author
Owner

@CarloDePieri commented on GitHub (Jul 9, 2023):

I'm only marginally familiar with the npm ecosystem but I've given this some thought, so here are my 2c:

  • Add something like this to the API package.json:
"@actual" : {
    "latest_supported_server_version": "23.6.0"
}
  • Have a check on push on release/* that fails if this new value is out of sync with the desktop-client version. This forces you to manually modify the API package.json when proposing a new desktop-client release (hopefully checking if any incompatibility requires a bump of the API version!)

  • Add a workflow on merge on release/* that runs after the build one that will publish both the desktop-client and the API packages. You could even automate the release on GitHub from there.

Sadly I'm very short on time and can't tackle this one right now!

@CarloDePieri commented on GitHub (Jul 9, 2023): I'm only marginally familiar with the npm ecosystem but I've given this some thought, so here are my 2c: - Add something like this to the API `package.json`: ```json "@actual" : { "latest_supported_server_version": "23.6.0" } ``` - Have a check on push on `release/*` that fails if this new value is out of sync with the desktop-client version. This forces you to manually modify the API `package.json` when proposing a new desktop-client release (hopefully checking if any incompatibility requires a bump of the API version!) - Add a workflow on merge on `release/*` that runs after the build one that will publish both the desktop-client and the API packages. You could even automate the release on GitHub from there. Sadly I'm very short on time and can't tackle this one right now!
Author
Owner

@MatissJanis commented on GitHub (Jul 9, 2023):

API v6.1.1 has been published

@MatissJanis commented on GitHub (Jul 9, 2023): API [v6.1.1](https://www.npmjs.com/package/@actual-app/api/v/6.1.1) has been published
Author
Owner

@MatissJanis commented on GitHub (Jul 18, 2023):

The issue should be fixed in the latest version of the API. Please let me know if it still persists for you.

@MatissJanis commented on GitHub (Jul 18, 2023): The issue should be fixed in the latest version of the API. Please let me know if it still persists for you.
Author
Owner

@CarloDePieri commented on GitHub (Jul 18, 2023):

The issue was resolved, thank you for the quick merge!

@CarloDePieri commented on GitHub (Jul 18, 2023): The issue was resolved, thank you for the quick merge!
Author
Owner

@rwong01 commented on GitHub (Nov 21, 2023):

I had this same issue of out of date migrations with the current version 6.2.1 of the api on npm which does not have this file
1694438752000_add_goal_targets.sql

and was able to fix it by manually copying it in locally

how would I build the api from the current head as mentioned above to avoid this issue in the future?

@rwong01 commented on GitHub (Nov 21, 2023): I had this same issue of out of date migrations with the current version 6.2.1 of the api on npm which does not have this file [1694438752000_add_goal_targets.sql ](https://github.com/actualbudget/actual/blob/fb2f712c1606145561f5c4d6891477c66de5a663/packages/loot-core/migrations/1694438752000_add_goal_targets.sql) and was able to fix it by manually copying it in locally how would I build the api from the current head as mentioned above to avoid this issue in the future?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#489