Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actual api nodejs client (@actual-app/api) unable to create accounts #133

Closed
jhonderson opened this issue Jul 20, 2022 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@jhonderson
Copy link

I am trying to create an script to import accounts and transactions using SimpleFIN API and Actual NodeJS client, but I am getting this error:

...
Loading fresh spreadsheet
Importing Accounts...
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
error SELECT * FROM accounts WHERE offbudget = ? ORDER BY sort_order, name
(node:87511) UnhandledPromiseRejectionWarning: TypeError: connection.getNumClients is not a function
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49402:22)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:87511) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'transaction' of null
    at Module.transaction (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45837:6)
    at Module.transaction (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54383:77)
    at applyMessagesForImport (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:61290:50)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:61316:12
    at run (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64536:29)
    at sequenceState.queue.push.resolve.resolve (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64549:16)
    at new Promise (<anonymous>)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64548:14
    at _sendMessages (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:61484:11)
    at batchMessages (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:61529:11)
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 6)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 9)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 12)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 15)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 18)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 21)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 24)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'prepare' of null
    at Module.runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:45806:41)
    at runQuery (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54349:82)
    at all (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54392:10)
    at Module.insertAccount (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:54764:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56312:71
    at withUndo (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:64016:12)
    at Object.account-create (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:56311:65)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49780:36
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49399:26)
    at /Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:58515:10
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 26)
(node:87511) UnhandledPromiseRejectionWarning: TypeError: connection.getNumClients is not a function
    at Object.undoDisabled (/Users/jhondiaz/development/import-simplefin/node_modules/@actual-app/api/app/bundle.api.js:49402:22)
(node:87511) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 27)

The call to actual.getAccounts() works fine, but not createAccount.

I am using @actual-app/api-4.1.0.

@github-actions
Copy link
Contributor

🚧🚨 This issue is being marked as stale due to 90 days of inactivity. 🚧🚨

@github-actions github-actions bot added the stale label Nov 24, 2022
@tjfinlinson
Copy link

tjfinlinson commented Dec 30, 2022

@jhonderson , I'm interested in getting Simple Fin to work, but I honestly don't have much dev experience. There is a Draft PR for setting up a Nordigen sync for European banks, and work was also started on Plaid integration, I wonder if those would be helpful places.

The Plaid app can be found in https://github.com/actualbudget/actual/tree/master/packages/desktop-client/src

Nordigen PRs
#209
actualbudget/actual-server#74

@github-actions github-actions bot removed the stale label Dec 31, 2022
@MatissJanis
Copy link
Member

👋 There have been some significant changes in how we bundle the API. Your issue might have been fixed with those.

Could you please check if this is still a problem for you?

Thanks

@MatissJanis MatissJanis added bug Something isn't working stale and removed needs triage labels Jan 29, 2023
@JamesHenry
Copy link

@MatissJanis the last time I tried with a brand new copy of actual a couple of weeks ago I couldn't get even the most basic API usage to work: actualbudget/docs#52 (comment)

Has this now been fixed/is there any working example you can point me towards?

I had a break from Actual for a while but I had built my entire system around programmatic usage so that I could externalise the categorization logic on my side and decouple it from Actual. I would love to return to this.

Any help would be greatly appreciated 🙏

@j-f1
Copy link
Contributor

j-f1 commented Jan 31, 2023

I have a PR awaiting final approval from James that I would like to ship soon (#464). With those changes, you should be able to get the API working — let me know if you have any issues with that branch!

@MatissJanis MatissJanis moved this from Needs Triage to In Progress in Actual issues Feb 16, 2023
@j-f1
Copy link
Contributor

j-f1 commented Feb 27, 2023

I believe version 5 of the API package has improved things, but let me know if you’re still having issues after you upgrade and we can reopen.

@j-f1 j-f1 closed this as completed Feb 27, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Fixed in Actual issues Feb 27, 2023
oleksandr pushed a commit to oleksandr/actual that referenced this issue Dec 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Fixed
Development

No branches or pull requests

6 participants