[GH-ISSUE #8168] [Bug]: @actual-app/api: postBinary sync fails with network-failure #117686

Open
opened 2026-06-11 13:08:17 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @latetedemelon on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/8168

What happened?

On an Alpine/musl Node image, @actual-app/api's downloadBudget() fails at the binary sync step (postBinary to POST /sync/sync) with PostError: network-failure. The identical setup on a Debian Slim Node image works. Same Node 22, same package, same self-hosted server.

try {
  const res = await fetch(url, {                      // Node global fetch (undici)
    method: "POST",
    body: Buffer.from(data),
    headers: {
      "Content-Length": data.length,                  // hand-set, and a NUMBER
      "Content-Type": "application/actual-sync",
      ...headers,
    },
  });
} catch {                                             // bare catch — original error discarded
  throw new PostError("network-failure");
}

Suggested fixes

  • Don't set Content-Length manually in postBinary and let fetch derive it from the body.
  • Catch the cause so it's diagnosable:

How can we reproduce the issue?

  • @actual-app/api 26.6.0, actual-server 26.6.0, alpline container (Node 22)
  • Run a normal api.init({ serverURL, password, dataDir }) + api.downloadBudget(syncId) script.
  • In a alpine container: login + all /sync/* GET succeeds, then download-budget throws:
PostError: network-failure
  at postBinary (@actual-app/api/dist/index.js)
  at _fullSync → initialFullSync → syncBudget → download-budget
  • The same script in a Debian Node 22 container → POST 200 /sync/sync, sync completes.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Linux

Originally created by @latetedemelon on GitHub (Jun 9, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/8168 ### What happened? On an Alpine/musl Node image, @actual-app/api's downloadBudget() fails at the binary sync step (postBinary to POST /sync/sync) with PostError: network-failure. The identical setup on a Debian Slim Node image works. Same Node 22, same package, same self-hosted server. ``` try { const res = await fetch(url, { // Node global fetch (undici) method: "POST", body: Buffer.from(data), headers: { "Content-Length": data.length, // hand-set, and a NUMBER "Content-Type": "application/actual-sync", ...headers, }, }); } catch { // bare catch — original error discarded throw new PostError("network-failure"); } ``` Suggested fixes - Don't set Content-Length manually in postBinary and let fetch derive it from the body. - Catch the cause so it's diagnosable: ### How can we reproduce the issue? - @actual-app/api 26.6.0, actual-server 26.6.0, alpline container (Node 22) - Run a normal api.init({ serverURL, password, dataDir }) + api.downloadBudget(syncId) script. - In a alpine container: login + all /sync/* GET succeeds, then download-budget throws: ``` PostError: network-failure at postBinary (@actual-app/api/dist/index.js) at _fullSync → initialFullSync → syncBudget → download-budget ``` - The same script in a Debian Node 22 container → POST 200 /sync/sync, sync completes. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Other ### Operating System Linux
GiteaMirror added the needs triagebug labels 2026-06-11 13:08:17 -05:00
Author
Owner
<!-- gh-comment-id:4663782794 --> @latetedemelon commented on GitHub (Jun 9, 2026): Potential related: https://github.com/actualbudget/actual/issues/1695 Actual AI: https://github.com/sakowicz/actual-ai/issues/402 https://github.com/sakowicz/actual-ai/issues/378 More Alpine Issues: https://github.com/actualbudget/actual/issues/4562 https://github.com/actualbudget/actual/issues/5412
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#117686