[GH-ISSUE #952] [Bug]: @actual-app/api encounters an error #49491

Closed
opened 2026-04-30 10:59:33 -05:00 by GiteaMirror · 9 comments
Owner

Originally created by @DistroByte on GitHub (Apr 23, 2023).
Original GitHub issue: https://github.com/actualbudget/actual/issues/952

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

distro@poseidon:~/projects/reports$ node server.js
Error updating Error: out-of-sync-migrations
    at checkDatabaseValidity (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61515:13)
    at Module.migrate (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61522:3)
    at async runMigrations (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66452:3)
    at async updateVersion (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66468:3)
    at async loadBudget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61104:5)
    at async module.exports../packages/loot-core/src/server/main.js.handlers.load-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60844:13)
    at async module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51327:5)
TypeError: Cannot read properties of null (reading 'timestamp')
    at _fullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64621:77)
    at /home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64533:22
    at onceFn (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66780:17)
    at initialFullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64521:22)
    at module.exports../packages/loot-core/src/server/main.js.handlers.sync-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60827:71)
    at module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51330:47)
[Exception] TypeError: Cannot read properties of null (reading 'timestamp')
    at _fullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64621:77)
    at /home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64533:22
    at onceFn (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66780:17)
    at initialFullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64521:22)
    at module.exports../packages/loot-core/src/server/main.js.handlers.sync-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60827:71)
    at module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51330:47)
error SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1
/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:47586
    stmt = typeof sql === 'string' ? db.prepare(sql) : sql;
                                        ^

TypeError: Cannot read properties of null (reading 'prepare')
    at Module.runQuery (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:47586:41)
    at runQuery (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:57963:82)
    at Module.first (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:58004:21)
    at Module.createAllBudgets (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:54775:76)
    at module.exports../packages/loot-core/src/server/main.js.handlers.get-budget-bounds (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:59162:72)
    at validateMonth (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51237:44)
    at module.exports../packages/loot-core/src/server/api.js.handlers.api/budget-month (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51436:9)
    at runHandler (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61789:17)
    at Object.send (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61386:82)
    at send (/home/distro/projects/reports/node_modules/@actual-app/api/methods.js:5:19)

Node.js v18.14.0
distro@poseidon:~/projects/reports$

Encountered when running downloadBudget() from @actual-app/api version 5.1.2 against client version: v23.4.2 and server version: v23.4.2.

My budget is not e2e encrypted.

Appears to be somewhat similar to #874

What error did you receive?

No response

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Windows 11

Originally created by @DistroByte on GitHub (Apr 23, 2023). Original GitHub issue: https://github.com/actualbudget/actual/issues/952 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? ``` distro@poseidon:~/projects/reports$ node server.js Error updating Error: out-of-sync-migrations at checkDatabaseValidity (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61515:13) at Module.migrate (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61522:3) at async runMigrations (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66452:3) at async updateVersion (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66468:3) at async loadBudget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61104:5) at async module.exports../packages/loot-core/src/server/main.js.handlers.load-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60844:13) at async module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51327:5) TypeError: Cannot read properties of null (reading 'timestamp') at _fullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64621:77) at /home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64533:22 at onceFn (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66780:17) at initialFullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64521:22) at module.exports../packages/loot-core/src/server/main.js.handlers.sync-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60827:71) at module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51330:47) [Exception] TypeError: Cannot read properties of null (reading 'timestamp') at _fullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64621:77) at /home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64533:22 at onceFn (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:66780:17) at initialFullSync (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:64521:22) at module.exports../packages/loot-core/src/server/main.js.handlers.sync-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:60827:71) at module.exports../packages/loot-core/src/server/api.js.handlers.api/download-budget (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51330:47) error SELECT * FROM transactions WHERE isChild=0 AND date IS NOT NULL ORDER BY date ASC LIMIT 1 /home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:47586 stmt = typeof sql === 'string' ? db.prepare(sql) : sql; ^ TypeError: Cannot read properties of null (reading 'prepare') at Module.runQuery (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:47586:41) at runQuery (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:57963:82) at Module.first (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:58004:21) at Module.createAllBudgets (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:54775:76) at module.exports../packages/loot-core/src/server/main.js.handlers.get-budget-bounds (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:59162:72) at validateMonth (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51237:44) at module.exports../packages/loot-core/src/server/api.js.handlers.api/budget-month (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:51436:9) at runHandler (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61789:17) at Object.send (/home/distro/projects/reports/node_modules/@actual-app/api/app/bundle.api.js:61386:82) at send (/home/distro/projects/reports/node_modules/@actual-app/api/methods.js:5:19) Node.js v18.14.0 distro@poseidon:~/projects/reports$ ``` Encountered when running `downloadBudget()` from `@actual-app/api` version `5.1.2` against client version: `v23.4.2` and server version: `v23.4.2`. My budget is not e2e encrypted. Appears to be somewhat similar to #874 ### What error did you receive? _No response_ ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Other ### Operating System Windows 11
GiteaMirror added the APIbug labels 2026-04-30 10:59:34 -05:00
Author
Owner

@j-f1 commented on GitHub (Apr 24, 2023):

@MatissJanis can you do another release of the API package?

<!-- gh-comment-id:1519353377 --> @j-f1 commented on GitHub (Apr 24, 2023): @MatissJanis can you do another release of the API package?
Author
Owner

@MatissJanis commented on GitHub (Apr 25, 2023):

@MatissJanis can you do another release of the API package?

Should we release a new API version each time we do a actual/web release? It seems that it's what we need to do now.. I wonder if we could somehow de-tangle the two dependencies.

<!-- gh-comment-id:1522320399 --> @MatissJanis commented on GitHub (Apr 25, 2023): > @MatissJanis can you do another release of the API package? Should we release a new API version each time we do a `actual/web` release? It seems that it's what we need to do now.. I wonder if we could somehow de-tangle the two dependencies.
Author
Owner

@j-f1 commented on GitHub (Apr 25, 2023):

That works! That would definitely prevent incompatibilities.

<!-- gh-comment-id:1522344057 --> @j-f1 commented on GitHub (Apr 25, 2023): That works! That would definitely prevent incompatibilities.
Author
Owner

@MatissJanis commented on GitHub (Apr 25, 2023):

Agreed. But given the new versioning strategy we will take for the API: lets hold off for a couple more days. And then do a release for everything in May: v23.5.0. 👍

<!-- gh-comment-id:1522365899 --> @MatissJanis commented on GitHub (Apr 25, 2023): Agreed. But given the new versioning strategy we will take for the API: lets hold off for a couple more days. And then do a release for everything in May: `v23.5.0`. :+1:
Author
Owner

@j-f1 commented on GitHub (Apr 25, 2023):

Agreed. But given the new versioning strategy we will take for the API: let's hold off for a couple more days. And then do a release for everything in May: v23.5.0

I don’t think this is a good idea. We should be following semver for the API package. It is annoying to have a separate versioning scheme, but I think doing a patch release for each release of the frontend, and then doing minor/major releases as needed would be better than using the versioning scheme we use in the app (which is explicitly not semver)

<!-- gh-comment-id:1522370588 --> @j-f1 commented on GitHub (Apr 25, 2023): > Agreed. But given the new versioning strategy we will take for the API: let's hold off for a couple more days. And then do a release for everything in May: `v23.5.0` I don’t think this is a good idea. We should be following semver for the API package. It is annoying to have a separate versioning scheme, but I think doing a patch release for each release of the frontend, and then doing minor/major releases as needed would be better than using the versioning scheme we use in the app (which is explicitly not semver)
Author
Owner

@MatissJanis commented on GitHub (Apr 29, 2023):

(we syned offline about this)

TLDR: we'll keep the existing versioning strategy. Just need to figure out a better solution for catching DB migration changes that subsequently require a new API version to be released.

I'll push out a new API version at the beginning of next month. Together with v23.5.0

<!-- gh-comment-id:1528827774 --> @MatissJanis commented on GitHub (Apr 29, 2023): (we syned offline about this) TLDR: we'll keep the existing versioning strategy. Just need to figure out a better solution for catching DB migration changes that subsequently require a new API version to be released. I'll push out a new API version at the beginning of next month. Together with v23.5.0
Author
Owner

@MatissJanis commented on GitHub (May 4, 2023):

API 6.0.0 has been released. Could you try it and let us know if you still experience issues? Thanks!

<!-- gh-comment-id:1535190857 --> @MatissJanis commented on GitHub (May 4, 2023): API 6.0.0 has been released. Could you try it and let us know if you still experience issues? Thanks!
Author
Owner

@anh-chu commented on GitHub (May 27, 2023):

seems to still persists

<!-- gh-comment-id:1565612077 --> @anh-chu commented on GitHub (May 27, 2023): seems to still persists
Author
Owner

@j-f1 commented on GitHub (May 28, 2023):

Can you open a new issue @anh-chu? I’m pretty confident we fixed the underlying issue here so any problems would be new.

<!-- gh-comment-id:1566105620 --> @j-f1 commented on GitHub (May 28, 2023): Can you open a new issue @anh-chu? I’m pretty confident we fixed the underlying issue here so any problems would be new.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#49491