sakowicz / actual-ai

Categorise transactions in Actual Budget using AI.
MIT License
83 stars 3 forks source link

Traceback error on transaction classification #45

Closed delize closed 2 weeks ago

delize commented 1 month ago
11/44 Processing transaction NAME / NAME / 1000000
/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:34683
                        throw new Error(`“${field}” is required for table “${table}”: ${JSON.stringify(obj)}`);
                              ^

Error: “account” is required for table “transactions”: {"id":"f169186e-2e76-4988-8f02-c36e4a27d315","starting_balance_flag":null,"cleared":null}
    at /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:34683:31
    at Array.map (<anonymous>)
    at conform (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:34673:60)
    at convertForUpdate (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:34734:24)
    at updateWithSchema (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:39223:93)
    at Module.updateTransaction (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:39577:24)
    at /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:32133:68
    at Array.map (<anonymous>)
    at /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:32124:51
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.20.4

I am receiving errors when using the tool after successfully connecting Actual AI to Actual Server.

sakowicz commented 1 month ago

Do you use the latest version of Actual Server (v24.10.1?

delize commented 1 month ago

I believe so, yes. Can check later this evening.

I just want to note, that it successfully went through 11 or so transactions and then failed. So it isn't an immediate failure.

delize commented 1 month ago

Just to confirm, yes, I do.

sakowicz commented 4 weeks ago

TBH, it looks like it is an issue with @actual-app/api package.

This project uses only the code:

await actualApi.updateTransaction(transaction.id, {
      category: guessCategory.id,
      notes: `${transaction.notes} | ${NOTES_GUESSED}`,
    });

So, we have a transaction and want to update it — nothing related to “account” from the error message.

I would recommend opening an issue on https://github.com/actualbudget/actual/issues .

If this is a problem with only a single transaction, you can try manually adding a category to it and try to run the classification again.

delize commented 3 days ago

https://github.com/actualbudget/actual/issues/3898#issuecomment-2499200837

The Actual Budget devs, mention it is an issue with the library version you are using.