[PR #98] [MERGED] fix(exec): return 200 (not 101) for an attached exec without a protocol upgrade #98

Closed
opened 2026-10-15 12:52:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/games-on-whales/LXC2Docker/pull/98
Author: @JBailes
Created: 6/27/2026
Status: ✅ Merged
Merged: 6/27/2026
Merged by: @JBailes

Base: main ← Head: fix/exec-start-200-when-not-upgrading


📝 Commits (1)

  • 0e8a6d4 fix(exec): return 200 (not 101) for attached exec without protocol upgrade

📊 Changes

1 file changed (+17 additions, -5 deletions)

View changed files

📝 internal/api/exec.go (+17 -5)

📄 Description

POST /exec/{id}/start always wrote HTTP/1.1 101 UPGRADED. Docker only returns 101 Switching Protocols when the client asked to upgrade (Upgrade: tcp); a plain attached exec is streamed over 200 OK (Content-Type: application/vnd.docker.raw-stream).

Impact (Wolf controllers in-game)

Wolf delivers hot-plugged input devices to the app container by docker exec-ing mknod <dev> && fake-udev -m <event> (wolf docker.cpp). Its exec client expects 200 from /exec/start; the shim returned 101, so Wolf logged [DOCKER] error 101 and abandoned the hijacked stream — cutting the mknod && fake-udev chain off partway. The device node got created (Wolf UI scans evdev directly, so the pad worked there) but the udev hot-plug event never completed, so SDL/Steam in the game container never detected the controller. Result: controller works in Wolf UI, dead in the game.

Fix

Return 101 UPGRADED only when the request carries an Upgrade header; otherwise 200 OK. The hijacked stream/mux is unchanged.

Test plan

  • go build ./..., go vet ./internal/api/, go test ./internal/api/ green (existing detached-exec test unaffected).
  • Manual: on the SmoothNAS AMD box, [DOCKER] error 101 on each Sending ...INPUT_CLASS=joystick ACTION=add should be gone and a controller should hot-plug into Steam.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/games-on-whales/LXC2Docker/pull/98 **Author:** [@JBailes](https://github.com/JBailes) **Created:** 6/27/2026 **Status:** ✅ Merged **Merged:** 6/27/2026 **Merged by:** [@JBailes](https://github.com/JBailes) **Base:** `main` ← **Head:** `fix/exec-start-200-when-not-upgrading` --- ### 📝 Commits (1) - [`0e8a6d4`](https://github.com/games-on-whales/LXC2Docker/commit/0e8a6d455aad54ac0d401c0bb82e23c64077a7af) fix(exec): return 200 (not 101) for attached exec without protocol upgrade ### 📊 Changes **1 file changed** (+17 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `internal/api/exec.go` (+17 -5) </details> ### 📄 Description POST `/exec/{id}/start` always wrote `HTTP/1.1 101 UPGRADED`. Docker only returns **101 Switching Protocols** when the client asked to upgrade (`Upgrade: tcp`); a plain attached exec is streamed over **200 OK** (`Content-Type: application/vnd.docker.raw-stream`). ## Impact (Wolf controllers in-game) Wolf delivers hot-plugged input devices to the app container by `docker exec`-ing `mknod <dev> && fake-udev -m <event>` (wolf `docker.cpp`). Its exec client expects **200** from `/exec/start`; the shim returned **101**, so Wolf logged `[DOCKER] error 101` and abandoned the hijacked stream — cutting the `mknod && fake-udev` chain off partway. The device node got created (Wolf UI scans evdev directly, so the pad worked there) but the **udev hot-plug event never completed**, so SDL/Steam in the game container never detected the controller. Result: controller works in Wolf UI, dead in the game. ## Fix Return `101 UPGRADED` only when the request carries an `Upgrade` header; otherwise `200 OK`. The hijacked stream/mux is unchanged. ## Test plan - `go build ./...`, `go vet ./internal/api/`, `go test ./internal/api/` green (existing detached-exec test unaffected). - Manual: on the SmoothNAS AMD box, `[DOCKER] error 101` on each `Sending ...INPUT_CLASS=joystick ACTION=add` should be gone and a controller should hot-plug into Steam. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 12:52:00 +00:00
Sign in to join this conversation.
No labels
pull-request
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/LXC2Docker#98
No description provided.