[GH-ISSUE #2338] [Bug]: API intermittently fails to open budget with automated transaction imports #7857

Closed
opened 2026-04-10 17:57:04 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @spenco100 on GitHub (Feb 7, 2024).
Original GitHub issue: https://github.com/actualbudget/actual/issues/2338

Verified issue does not already exist?

  • I have searched and found no existing issue
  • I have checked my server logs and could not see any errors there
  • I will be attaching my server logs to this issue
  • I will be attaching my client-side (browser) logs to this issue
  • I understand that this issue will be automatically closed if insufficient information is provided

What happened?

I have a system where all my cards / bank accounts send transaction alerts to a single mailbox, and a server to monitor that mailbox. I parse details from the emails, add the transactions to a google sheet, and then to my new Actual server (hosted on Fly.io)

Intermittently I see transactions that appear in my Google sheet but not in Actual - and my error logging shows the following error coinciding with the times that transactions were processed in my server.

Server running imports with the Actual API logs show:
Error: We had an unknown problem opening “My-Finances-7172b03”.

Has anyone else had this issue? Is there a better method I am not seeing in the docs, to import transactions? Here is my server config and code.

Node version: 18.12.0
Actual API version (running on my 3rd party server):
"@actual-app/api": "^6.4.0"

Actual server version:
"@actual-app/crdt": "2.1.0"
"@actual-app/web": "24.1.0"

Function calling the Actual API from my server:

const api = require('@actual-app/api');
// Write 1+ transaction to the Actual server
async function writeTransactions(transactions) {
    let result = { error: null, response: null };
    try {
        const actualTransactions = transactions.map(convertTransaction);

        await api.init({
            serverURL: host,
            password: password,
        });

        // load the budget
        await api.downloadBudget(actual_sync_id);

        // sort transactions by card into a larger object
        const transactionsByCard = {};
        actualTransactions.forEach(transaction => {
            const { account } = transaction;
            if (!transactionsByCard[account]) transactionsByCard[account] = [];
            transactionsByCard[account].push(transaction);
        });

        Object.keys(transactionsByCard).forEach(account => {
            api.importTransactions(account, transactionsByCard[account]);
        });

    } catch (e) {
        console.error(e);
        result.error = (typeof e != "string") ? JSON.stringify(e) : e;
    } finally {
        await api.shutdown();
        return result;
    }
};

What error did you receive?

Exception from a finished function: Error: We had an unknown problem opening “My-Finances-7172b03”.

Where are you hosting Actual?

Fly.io

What browsers are you seeing the problem on?

No response

Operating System

Linux

Originally created by @spenco100 on GitHub (Feb 7, 2024). Original GitHub issue: https://github.com/actualbudget/actual/issues/2338 ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### Is this related to GoCardless, Simplefin or another bank-sync provider? - [ ] I have checked my server logs and could not see any errors there - [X] I will be attaching my server logs to this issue - [ ] I will be attaching my client-side (browser) logs to this issue - [X] I understand that this issue will be automatically closed if insufficient information is provided ### What happened? I have a system where all my cards / bank accounts send transaction alerts to a single mailbox, and a server to monitor that mailbox. I parse details from the emails, add the transactions to a google sheet, and then to my new Actual server (hosted on Fly.io) Intermittently I see transactions that appear in my Google sheet but not in Actual - and my error logging shows the following error coinciding with the times that transactions were processed in my server. Server running imports with the Actual API logs show: `Error: We had an unknown problem opening “My-Finances-7172b03”.` Has anyone else had this issue? Is there a better method I am not seeing in the docs, to import transactions? Here is my server config and code. Node version: 18.12.0 Actual API version (running on my 3rd party server): "@actual-app/api": "^6.4.0" Actual server version: "@actual-app/crdt": "2.1.0" "@actual-app/web": "24.1.0" Function calling the Actual API from my server: ``` const api = require('@actual-app/api'); // Write 1+ transaction to the Actual server async function writeTransactions(transactions) { let result = { error: null, response: null }; try { const actualTransactions = transactions.map(convertTransaction); await api.init({ serverURL: host, password: password, }); // load the budget await api.downloadBudget(actual_sync_id); // sort transactions by card into a larger object const transactionsByCard = {}; actualTransactions.forEach(transaction => { const { account } = transaction; if (!transactionsByCard[account]) transactionsByCard[account] = []; transactionsByCard[account].push(transaction); }); Object.keys(transactionsByCard).forEach(account => { api.importTransactions(account, transactionsByCard[account]); }); } catch (e) { console.error(e); result.error = (typeof e != "string") ? JSON.stringify(e) : e; } finally { await api.shutdown(); return result; } }; ``` ### What error did you receive? Exception from a finished function: Error: We had an unknown problem opening “My-Finances-7172b03”. ### Where are you hosting Actual? Fly.io ### What browsers are you seeing the problem on? _No response_ ### Operating System Linux
GiteaMirror added the bug label 2026-04-10 17:57:04 -05:00
Author
Owner

@youngcw commented on GitHub (Feb 8, 2024):

The api can be really finicky about node versions. Im on 18.19 and it works fine.

<!-- gh-comment-id:1934289504 --> @youngcw commented on GitHub (Feb 8, 2024): The api can be really finicky about node versions. Im on 18.19 and it works fine.
Author
Owner

@youngcw commented on GitHub (Feb 26, 2024):

Closing for now unless something else comes up. If you are still having issues I recommend trying a few node versions and see what works.

<!-- gh-comment-id:1965358681 --> @youngcw commented on GitHub (Feb 26, 2024): Closing for now unless something else comes up. If you are still having issues I recommend trying a few node versions and see what works.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#7857