[GH-ISSUE #526] API returns corrupted JSON when several requests come in at the same time #319

Open
opened 2026-10-15 12:59:37 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @To0wnn on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/games-on-whales/wolf/issues/526

What happens
When several requests to the API arrive at the same time, /api/v1/profiles sometimes returns a broken body: the length is correct, but some bytes in the middle are garbage, so the JSON can't be parsed.

How to reproduce
With a config of ~76 apps (the response is ~356 KB):

for i in $(seq 50); do curl -s --unix-socket /run/wolf/wolf.sock http://localhost/api/v1/profiles -o /tmp/r$i & done; wait
# then try to parse each file as JSON

Result: about 1 in 50 responses is corrupted. The same 40 requests sent one after another are all fine.

Why it matters
Wolf Den's Apps page asks for the profiles once per app, all at the same time, so with many apps it almost always hits a broken response and shows an error page (Could not deserialize the response body stream as GamesOnWhales.ProfileListResponse).

Workaround we use
A small proxy in front of the socket that sends requests to Wolf one at a time (passing /api/v1/events straight through). With that, 200 parallel requests all come back fine.

Setup
ghcr.io/games-on-whales/wolf:stable (built 2026-09-29), rootful podman 5.8.7, NVIDIA (manual driver volume), Bazzite.

Originally created by @To0wnn on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/games-on-whales/wolf/issues/526 **What happens** When several requests to the API arrive at the same time, `/api/v1/profiles` sometimes returns a broken body: the length is correct, but some bytes in the middle are garbage, so the JSON can't be parsed. **How to reproduce** With a config of ~76 apps (the response is ~356 KB): ```sh for i in $(seq 50); do curl -s --unix-socket /run/wolf/wolf.sock http://localhost/api/v1/profiles -o /tmp/r$i & done; wait # then try to parse each file as JSON ``` Result: about 1 in 50 responses is corrupted. The same 40 requests sent one after another are all fine. **Why it matters** Wolf Den's Apps page asks for the profiles once per app, all at the same time, so with many apps it almost always hits a broken response and shows an error page (`Could not deserialize the response body stream as GamesOnWhales.ProfileListResponse`). **Workaround we use** A small proxy in front of the socket that sends requests to Wolf one at a time (passing `/api/v1/events` straight through). With that, 200 parallel requests all come back fine. **Setup** `ghcr.io/games-on-whales/wolf:stable` (built 2026-09-29), rootful podman 5.8.7, NVIDIA (manual driver volume), Bazzite.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
games-on-whales/wolf#319
No description provided.