[GH-ISSUE #6118] [Bug]: A failed bank sync crashes actual-ai #16849

Closed
opened 2026-04-14 19:51:04 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @trumpetx on GitHub (Nov 11, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/6118

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

actual-ai is hitting the AI endpoint and categorizing things on startup just fine with syncAccountsBeforeClassify DISABLED/REMOVED from the features list. I have a bank that likes to fail to sync quite often (I need to continually fix it and ignore the failure most of the time). This failure to sync is causing actual-ai to crash and restart over and over again. The bug here is that the failure to sync should not be fatal to the actual-ai categorization operation.

When debugging this issue, I did comment here: https://github.com/sakowicz/actual-ai/issues/139#issuecomment-3511624127 - that comment still stands; however, this now happens during the "cron" sync and I'm basically blocked (I can effectively restart my docker compose over and over again to eventually categorize everything about 40 items at a time.

actual-ai-1      | Node.js v22.21.1
actual-ai-1      | 
actual-ai-1      | > @sakowicz/actual-ai@2.2.4 prod
actual-ai-1      | > node dist/app.js
actual-ai-1      | 
actual-ai-1      | Creating model for provider: openai
actual-ai-1      | Set openai rate limits: 500 requests/minute, 60000 tokens/minute
actual-ai-1      | Application started
actual-ai-1      | Starting classification process
actual-ai-1      | (node:18) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
actual-ai-1      | (Use `node --trace-warnings ...` to show where the warning was created)
actual_server-1  | Logging in via password
actual_server-1  | Deleted 0 old sessions
actual_server-1  | 2025-11-11T18:48:34.023Z info: POST 200 /account/login
actual-ai-1      | Loaded spreadsheet from cache (1964 items)
actual-ai-1      | Syncing since 2025-11-11T14:20:32.069Z-0000-9fc53234eed4ffa4 80 (attempt: 0)
actual-ai-1      | PostError: PostError: network-failure
actual-ai-1      |     at postBinary (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:56052:15)
actual-ai-1      |     at async _fullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60199:23)
actual-ai-1      |     at async /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60128:20
actual-ai-1      |     at async initialFullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60117:20)
actual-ai-1      |     at async Object.syncBudget [as sync-budget] (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:123106:20)
actual-ai-1      |     at async handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110334:25) {
actual-ai-1      |   type: 'PostError',
actual-ai-1      |   reason: 'network-failure',
actual-ai-1      |   meta: undefined
actual-ai-1      | }
actual-ai-1      | PostError: PostError: network-failure
actual-ai-1      |     at postBinary (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:56052:15)
actual-ai-1      |     at async _fullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60199:23)
actual-ai-1      |     at async /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60128:20
actual-ai-1      |     at async initialFullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60117:20)
actual-ai-1      |     at async Object.syncBudget [as sync-budget] (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:123106:20)
actual-ai-1      |     at async handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110334:25) {
actual-ai-1      |   type: 'PostError',
actual-ai-1      |   reason: 'network-failure',
actual-ai-1      |   meta: undefined
actual-ai-1      | }
actual-ai-1      | Failed to download budget: 
actual-ai-1      | Full error details: Error
actual-ai-1      |     at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110336:19)
actual-ai-1      | An error occurred: Budget download failed. Verify that:
actual-ai-1      | 1. Budget ID "91db9220-34bd-4ae3-b2bc-000000000000" is correct
actual-ai-1      | 2. Server URL "https://actual_server:5006" is reachable
actual-ai-1      | 3. Password is correct
actual-ai-1      | 4. E2E password (if used) is valid
actual-ai-1      | node:internal/process/promises:394
actual-ai-1      |     triggerUncaughtException(err, true /* fromPromise */);
actual-ai-1      |     ^
actual-ai-1      | 
actual-ai-1      | Error
actual-ai-1      |     at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110336:19)
actual-ai-1      | 

How can we reproduce the issue?

  • Set up Actual Budget with 2 Bank Syncs
  • Reset the password of Bank 2 so that the bank sync now fails
  • Start actual-ai with syncAccountsBeforeClassify feature enabled

Expected:
Bank 1 syncs
Bank 2 does not sync
actual-ai performs categorization on new Bank 1 transactions

Actual:
Bank 1 syncs
Bank 2 does not sync
actual-ai loops and starts the process over again, never actually running AI categorization

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Linux

Originally created by @trumpetx on GitHub (Nov 11, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/6118 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? `actual-ai` is hitting the AI endpoint and categorizing things on startup just fine with `syncAccountsBeforeClassify` DISABLED/REMOVED from the features list. I have a bank that likes to fail to sync quite often (I need to continually fix it and ignore the failure most of the time). This failure to sync is causing `actual-ai` to crash and restart over and over again. The bug here is that the failure to sync should not be fatal to the `actual-ai` categorization operation. When debugging this issue, I did comment here: https://github.com/sakowicz/actual-ai/issues/139#issuecomment-3511624127 - that comment still stands; however, this now happens during the "cron" sync and I'm basically blocked (I can effectively restart my docker compose over and over again to eventually categorize everything about 40 items at a time. ``` actual-ai-1 | Node.js v22.21.1 actual-ai-1 | actual-ai-1 | > @sakowicz/actual-ai@2.2.4 prod actual-ai-1 | > node dist/app.js actual-ai-1 | actual-ai-1 | Creating model for provider: openai actual-ai-1 | Set openai rate limits: 500 requests/minute, 60000 tokens/minute actual-ai-1 | Application started actual-ai-1 | Starting classification process actual-ai-1 | (node:18) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. actual-ai-1 | (Use `node --trace-warnings ...` to show where the warning was created) actual_server-1 | Logging in via password actual_server-1 | Deleted 0 old sessions actual_server-1 | 2025-11-11T18:48:34.023Z info: POST 200 /account/login actual-ai-1 | Loaded spreadsheet from cache (1964 items) actual-ai-1 | Syncing since 2025-11-11T14:20:32.069Z-0000-9fc53234eed4ffa4 80 (attempt: 0) actual-ai-1 | PostError: PostError: network-failure actual-ai-1 | at postBinary (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:56052:15) actual-ai-1 | at async _fullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60199:23) actual-ai-1 | at async /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60128:20 actual-ai-1 | at async initialFullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60117:20) actual-ai-1 | at async Object.syncBudget [as sync-budget] (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:123106:20) actual-ai-1 | at async handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110334:25) { actual-ai-1 | type: 'PostError', actual-ai-1 | reason: 'network-failure', actual-ai-1 | meta: undefined actual-ai-1 | } actual-ai-1 | PostError: PostError: network-failure actual-ai-1 | at postBinary (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:56052:15) actual-ai-1 | at async _fullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60199:23) actual-ai-1 | at async /opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60128:20 actual-ai-1 | at async initialFullSync (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:60117:20) actual-ai-1 | at async Object.syncBudget [as sync-budget] (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:123106:20) actual-ai-1 | at async handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110334:25) { actual-ai-1 | type: 'PostError', actual-ai-1 | reason: 'network-failure', actual-ai-1 | meta: undefined actual-ai-1 | } actual-ai-1 | Failed to download budget: actual-ai-1 | Full error details: Error actual-ai-1 | at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110336:19) actual-ai-1 | An error occurred: Budget download failed. Verify that: actual-ai-1 | 1. Budget ID "91db9220-34bd-4ae3-b2bc-000000000000" is correct actual-ai-1 | 2. Server URL "https://actual_server:5006" is reachable actual-ai-1 | 3. Password is correct actual-ai-1 | 4. E2E password (if used) is valid actual-ai-1 | node:internal/process/promises:394 actual-ai-1 | triggerUncaughtException(err, true /* fromPromise */); actual-ai-1 | ^ actual-ai-1 | actual-ai-1 | Error actual-ai-1 | at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110336:19) actual-ai-1 | ``` ### How can we reproduce the issue? * Set up Actual Budget with 2 Bank Syncs * Reset the password of Bank 2 so that the bank sync now fails * Start `actual-ai` with `syncAccountsBeforeClassify` feature enabled **Expected:** Bank 1 syncs Bank 2 does not sync `actual-ai` performs categorization on new Bank 1 transactions **Actual:** Bank 1 syncs Bank 2 does not sync `actual-ai` loops and starts the process over again, never actually running AI categorization ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Other ### Operating System Linux
GiteaMirror added the needs infobug labels 2026-04-14 19:51:04 -05:00
Author
Owner

@trumpetx commented on GitHub (Nov 11, 2025):

Just so it's clear that this "does work" for me (and only starts failing after a bad sync):

actual@ubuntu-homelab:~/actual$ docker compose down && docker compose up -d
[+] Running 3/3
 ✔ Container actual-actual-ai-1      Removed                                                                                                     11.5s 
 ✔ Container actual-actual_server-1  Removed                                                                                                      7.8s 
 ✔ Network actual_default            Removed                                                                                                      1.1s 
[+] Running 3/3
 ✔ Network actual_default            Created                                                                                                      1.3s 
 ✔ Container actual-actual-ai-1      Started                                                                                                     24.0s 
 ✔ Container actual-actual_server-1  Started                                                                                                     24.6s 
actual@ubuntu-homelab:~/actual$ docker compose logs -f
actual-ai-1      | 
actual_server-1  | Checking if there are any migrations to run for direction "up"...
actual_server-1  | Migrations: DONE
actual-ai-1      | > @sakowicz/actual-ai@2.2.4 prod
actual-ai-1      | > node dist/app.js
actual_server-1  | Running in production mode - Serving static React app
actual-ai-1      | 
actual_server-1  | Listening on :::5006...
actual_server-1  | Logging in via password
actual-ai-1      | Creating model for provider: openai
actual-ai-1      | Set openai rate limits: 500 requests/minute, 60000 tokens/minute
actual-ai-1      | Application started
actual-ai-1      | Starting classification process
actual-ai-1      | (node:18) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
actual-ai-1      | (Use `node --trace-warnings ...` to show where the warning was created)
actual-ai-1      | Failed to download budget: Could not get remote files
actual-ai-1      | Full error details: Error: Could not get remote files
actual-ai-1      |     at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110311:19)
actual-ai-1      | An error occurred: Budget download failed. Verify that:
actual-ai-1      | 1. Budget ID "91db9220-34bd-4ae3-b2bc-0000000000" is correct
actual-ai-1      | 2. Server URL "https://actual_server:5006" is reachable
actual-ai-1      | 3. Password is correct
actual-ai-1      | 4. E2E password (if used) is valid
actual-ai-1      | node:internal/process/promises:394
actual-ai-1      |     triggerUncaughtException(err, true /* fromPromise */);
actual-ai-1      |     ^
actual-ai-1      | 
actual-ai-1      | Error: Could not get remote files
actual-ai-1      |     at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110311:19)
actual-ai-1      | 
actual-ai-1      | Node.js v22.21.1
actual-ai-1      | 
actual-ai-1      | > @sakowicz/actual-ai@2.2.4 prod
actual-ai-1      | > node dist/app.js
actual-ai-1      | 
actual-ai-1      | Creating model for provider: openai
actual-ai-1      | Set openai rate limits: 500 requests/minute, 60000 tokens/minute
actual-ai-1      | Application started
actual-ai-1      | Starting classification process
actual-ai-1      | (node:17) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
actual-ai-1      | (Use `node --trace-warnings ...` to show where the warning was created)
actual_server-1  | Deleted 0 old sessions
actual_server-1  | 2025-11-11T19:07:13.591Z info: POST 200 /account/login
actual_server-1  | 2025-11-11T19:07:13.911Z info: GET 200 /sync/list-user-files
actual_server-1  | 2025-11-11T19:07:14.239Z info: GET 200 /sync/get-user-file-info
actual_server-1  | 2025-11-11T19:07:15.292Z info: GET 200 /sync/download-user-file
actual-ai-1      | Loading fresh spreadsheet
actual-ai-1      | Syncing since 2025-10-15T14:59:26.317Z-0000-8be5a9291a42ad14 0 (attempt: 0)
actual_server-1  | 2025-11-11T19:07:50.482Z info: POST 200 /sync/sync
actual-ai-1      | Got messages from server 3035
actual-ai-1      | Budget downloaded
actual-ai-1      | Found 262 transaction categorization rules
actual-ai-1      | rerunMissedTransactions false
actual-ai-1      | All transactions count: 2785
actual-ai-1      | All accounts: 18
actual-ai-1      | Accounts off budget: 0
actual-ai-1      | Already has a category - Excluded 2180 transactions
actual-ai-1      | Is a transfer - Excluded 234 transactions
actual-ai-1      | It was not guessed before - Excluded 2 transactions
actual-ai-1      | Found 369 uncategorized transactions
actual-ai-1      | Processing batch 1 (transactions 1-20)
actual-ai-1      | 1/369 Processing transaction 'PayPal Transfer'
actual-ai-1      | Making LLM request to openai
actual-ai-1      | Cleaned LLM response: {"type":"existing","categoryId":"3c1699a5-522a-435e-86dc-0000000000"}
actual-ai-1      | Using existing category: Income

As you can see, it gets a "normal" network failure as the docker instance starts up, but once it's started it logs in and starts working (and continues to work for a while). Then the cron happens to do a sync and it starts failing 100% (looping over and over again).

<!-- gh-comment-id:3518390245 --> @trumpetx commented on GitHub (Nov 11, 2025): Just so it's clear that this "does work" for me (and only starts failing after a bad sync): ``` actual@ubuntu-homelab:~/actual$ docker compose down && docker compose up -d [+] Running 3/3 ✔ Container actual-actual-ai-1 Removed 11.5s ✔ Container actual-actual_server-1 Removed 7.8s ✔ Network actual_default Removed 1.1s [+] Running 3/3 ✔ Network actual_default Created 1.3s ✔ Container actual-actual-ai-1 Started 24.0s ✔ Container actual-actual_server-1 Started 24.6s actual@ubuntu-homelab:~/actual$ docker compose logs -f actual-ai-1 | actual_server-1 | Checking if there are any migrations to run for direction "up"... actual_server-1 | Migrations: DONE actual-ai-1 | > @sakowicz/actual-ai@2.2.4 prod actual-ai-1 | > node dist/app.js actual_server-1 | Running in production mode - Serving static React app actual-ai-1 | actual_server-1 | Listening on :::5006... actual_server-1 | Logging in via password actual-ai-1 | Creating model for provider: openai actual-ai-1 | Set openai rate limits: 500 requests/minute, 60000 tokens/minute actual-ai-1 | Application started actual-ai-1 | Starting classification process actual-ai-1 | (node:18) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. actual-ai-1 | (Use `node --trace-warnings ...` to show where the warning was created) actual-ai-1 | Failed to download budget: Could not get remote files actual-ai-1 | Full error details: Error: Could not get remote files actual-ai-1 | at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110311:19) actual-ai-1 | An error occurred: Budget download failed. Verify that: actual-ai-1 | 1. Budget ID "91db9220-34bd-4ae3-b2bc-0000000000" is correct actual-ai-1 | 2. Server URL "https://actual_server:5006" is reachable actual-ai-1 | 3. Password is correct actual-ai-1 | 4. E2E password (if used) is valid actual-ai-1 | node:internal/process/promises:394 actual-ai-1 | triggerUncaughtException(err, true /* fromPromise */); actual-ai-1 | ^ actual-ai-1 | actual-ai-1 | Error: Could not get remote files actual-ai-1 | at handlers.api/download-budget (/opt/node_app/node_modules/@actual-app/api/dist/app/bundle.api.js:110311:19) actual-ai-1 | actual-ai-1 | Node.js v22.21.1 actual-ai-1 | actual-ai-1 | > @sakowicz/actual-ai@2.2.4 prod actual-ai-1 | > node dist/app.js actual-ai-1 | actual-ai-1 | Creating model for provider: openai actual-ai-1 | Set openai rate limits: 500 requests/minute, 60000 tokens/minute actual-ai-1 | Application started actual-ai-1 | Starting classification process actual-ai-1 | (node:17) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification. actual-ai-1 | (Use `node --trace-warnings ...` to show where the warning was created) actual_server-1 | Deleted 0 old sessions actual_server-1 | 2025-11-11T19:07:13.591Z info: POST 200 /account/login actual_server-1 | 2025-11-11T19:07:13.911Z info: GET 200 /sync/list-user-files actual_server-1 | 2025-11-11T19:07:14.239Z info: GET 200 /sync/get-user-file-info actual_server-1 | 2025-11-11T19:07:15.292Z info: GET 200 /sync/download-user-file actual-ai-1 | Loading fresh spreadsheet actual-ai-1 | Syncing since 2025-10-15T14:59:26.317Z-0000-8be5a9291a42ad14 0 (attempt: 0) actual_server-1 | 2025-11-11T19:07:50.482Z info: POST 200 /sync/sync actual-ai-1 | Got messages from server 3035 actual-ai-1 | Budget downloaded actual-ai-1 | Found 262 transaction categorization rules actual-ai-1 | rerunMissedTransactions false actual-ai-1 | All transactions count: 2785 actual-ai-1 | All accounts: 18 actual-ai-1 | Accounts off budget: 0 actual-ai-1 | Already has a category - Excluded 2180 transactions actual-ai-1 | Is a transfer - Excluded 234 transactions actual-ai-1 | It was not guessed before - Excluded 2 transactions actual-ai-1 | Found 369 uncategorized transactions actual-ai-1 | Processing batch 1 (transactions 1-20) actual-ai-1 | 1/369 Processing transaction 'PayPal Transfer' actual-ai-1 | Making LLM request to openai actual-ai-1 | Cleaned LLM response: {"type":"existing","categoryId":"3c1699a5-522a-435e-86dc-0000000000"} actual-ai-1 | Using existing category: Income ``` As you can see, it gets a "normal" network failure as the docker instance starts up, but once it's started it logs in and starts working (and continues to work for a while). Then the cron happens to do a sync and it starts failing 100% (looping over and over again).
Author
Owner

@MatissJanis commented on GitHub (Nov 11, 2025):

👋 We don't own or maintain actual-ai. It seems this issue was opened to the wrong repository. Or perhaps I am missing something here?

<!-- gh-comment-id:3518432331 --> @MatissJanis commented on GitHub (Nov 11, 2025): 👋 We don't own or maintain `actual-ai`. It seems this issue was opened to the wrong repository. Or perhaps I am missing something here?
Author
Owner

@trumpetx commented on GitHub (Nov 11, 2025):

@MatissJanis Oh, I must have followed the wrong link for bug submission, that's my bad. I think I was doing the "click link hop" around Github. I'll move my stuff over, thanks for the heads up.

<!-- gh-comment-id:3518511953 --> @trumpetx commented on GitHub (Nov 11, 2025): @MatissJanis Oh, I must have followed the wrong link for bug submission, that's my bad. I think I was doing the "click link hop" around Github. I'll move my stuff over, thanks for the heads up.
Author
Owner

@trumpetx commented on GitHub (Nov 11, 2025):

https://github.com/sakowicz/actual-ai/issues/378

(for anyone else who stumbles here from google or chatgpt)

<!-- gh-comment-id:3518522434 --> @trumpetx commented on GitHub (Nov 11, 2025): https://github.com/sakowicz/actual-ai/issues/378 (for anyone else who stumbles here from google or chatgpt)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#16849