[Bug]: API Unhandled Rejection #2295

Open
opened 2026-02-28 20:09:24 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @yankees5963 on GitHub (Jul 20, 2025).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

When logging into the budget through API it appears to successfully connect then fails to download due to an unhandled exception.

connect
open file
Unhandled Rejection at: Promise Promise {
  <rejected> Error: Could not get remote files
      at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27)
} reason: Error: Could not get remote files
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27)
Error: Could not get remote files
    at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27)

How can we reproduce the issue?

  1. Login using either actual-ai or actual-helpers (really anywhere that uses the API)
  2. Try to sync-banks
  3. Error

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome

Operating System

Linux

Originally created by @yankees5963 on GitHub (Jul 20, 2025). ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? When logging into the budget through API it appears to successfully connect then fails to download due to an unhandled exception. ``` connect open file Unhandled Rejection at: Promise Promise { <rejected> Error: Could not get remote files at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27) } reason: Error: Could not get remote files at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27) Error: Could not get remote files at handlers.api/download-budget (/usr/src/app/node_modules/@actual-app/api/dist/app/bundle.api.js:11613:27) ``` ### How can we reproduce the issue? 1. Login using either actual-ai or actual-helpers (really anywhere that uses the API) 2. Try to sync-banks 3. Error ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Chrome ### Operating System Linux
GiteaMirror added the bugAPI labels 2026-02-28 20:09:24 -06:00
Author
Owner

@matt-fidd commented on GitHub (Jul 20, 2025):

Can you try deleting the local cache folder? There should be one in the directory that you're running the script from

I'm unable to reproduce on my side

@matt-fidd commented on GitHub (Jul 20, 2025): Can you try deleting the local cache folder? There should be one in the directory that you're running the script from I'm unable to reproduce on my side
Author
Owner

@yankees5963 commented on GitHub (Jul 20, 2025):

tried on a clean install and deleted local cache, same issue. Could it be due to having OAUTH enabled, its not allowing password auth to hit the api? Getting same error in both actual-ai and actual-helpers so doubt its app specific to those third party apps.

@yankees5963 commented on GitHub (Jul 20, 2025): tried on a clean install and deleted local cache, same issue. Could it be due to having OAUTH enabled, its not allowing password auth to hit the api? Getting same error in both actual-ai and actual-helpers so doubt its app specific to those third party apps.
Author
Owner

@yankees5963 commented on GitHub (Jul 22, 2025):

I did a fresh install WITHOUT OIDC first, set the password, restored budget, then added OIDC and restarted. That seemed to be the trick its now showing budget downloaded in 3rd party apps.

Interesting that even though i reset/verified the server password before using third party apps, it seems to not have set it if the initial password set was not done. I used ENV Vars to setup oidc on first boot and never had the password prompt.

@yankees5963 commented on GitHub (Jul 22, 2025): I did a fresh install WITHOUT OIDC first, set the password, restored budget, then added OIDC and restarted. That seemed to be the trick its now showing budget downloaded in 3rd party apps. Interesting that even though i reset/verified the server password before using third party apps, it seems to not have set it if the initial password set was not done. I used ENV Vars to setup oidc on first boot and never had the password prompt.
Author
Owner

@mbrevda commented on GitHub (Jul 27, 2025):

Having this issue. Deleted the local cache folder, still getting the error

@mbrevda commented on GitHub (Jul 27, 2025): Having this issue. Deleted the local cache folder, still getting the error
Author
Owner

@mbrevda commented on GitHub (Aug 1, 2025):

In my case this turned out to be a weird networking issue. Restarting my terminal fixed it

@mbrevda commented on GitHub (Aug 1, 2025): In my case this turned out to be a weird networking issue. Restarting my terminal fixed it
Author
Owner

@bertmelis commented on GitHub (Sep 7, 2025):

Is this issue actually resolved? I just can't get actual-ai to work when OIDC is enabled. Password is set, E2E is disabled, works when I switch from OIDC to password login.

@bertmelis commented on GitHub (Sep 7, 2025): Is this issue actually resolved? I just can't get actual-ai to work when OIDC is enabled. Password is set, E2E is disabled, works when I switch from OIDC to password login.
Author
Owner

@m-schwob commented on GitHub (Sep 7, 2025):

I also had a similar issue with the actual API. Actual-API does not work with OIDC out of the box. I guess that is because it requires support for token creation.

I found a workaround to set it to OIDC mode and provide the token manually. It works since it uses the underlying functionality that already exists for the OIDC mode of the app itself.

Assuming you have a config object with all the required data:

// Initialize the API
await api.init({
    dataDir: config.apiDataDirectory,
    serverURL: config.actualServerUrl,
});

// Authenticate with OIDC (required for admin access)
console.log('Authenticating with OIDC token...');
await api.internal.send('subscribe-set-token', { token: config.adminToken });

const user = await api.internal.send('subscribe-get-user');
console.log(`Authenticated as: ${user.displayName}`);
To extract the token, i manually go to the actual SQLite file and extract the user token.

Hope it will work for you as well.

@m-schwob commented on GitHub (Sep 7, 2025): I also had a similar issue with the actual API. Actual-API does not work with OIDC out of the box. I guess that is because it requires support for token creation. I found a workaround to set it to OIDC mode and provide the token manually. It works since it uses the underlying functionality that already exists for the OIDC mode of the app itself. Assuming you have a config object with all the required data: ```ts // Initialize the API await api.init({ dataDir: config.apiDataDirectory, serverURL: config.actualServerUrl, }); // Authenticate with OIDC (required for admin access) console.log('Authenticating with OIDC token...'); await api.internal.send('subscribe-set-token', { token: config.adminToken }); const user = await api.internal.send('subscribe-get-user'); console.log(`Authenticated as: ${user.displayName}`); To extract the token, i manually go to the actual SQLite file and extract the user token. ``` Hope it will work for you as well.
Author
Owner

@bertmelis commented on GitHub (Sep 7, 2025):

I got it to work. It was actually something completely different and unrelated to Actual or Actual AI.

(apparently, the Podman documentation for quadlets contain some errors for specifying dependencies. This resulted starting the AI container before Actual itself so obviously the connection failed.)

So to sum up:

  • I started with password setup
  • Switched to OIDC
  • Set up Actual AI using the password

Ollama (or other) and Actual are dependencies of Actual AI.

@bertmelis commented on GitHub (Sep 7, 2025): I got it to work. It was actually something completely different and unrelated to Actual or Actual AI. (apparently, the Podman documentation for quadlets contain some errors for specifying dependencies. This resulted starting the AI container before Actual itself so obviously the connection failed.) So to sum up: - I started with password setup - Switched to OIDC - Set up Actual AI using the password Ollama (or other) and Actual are dependencies of Actual AI.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#2295