Skip to content

Fix exec_run() returning empty output over SSH connections#644

Open
maxammann wants to merge 1 commit into
containers:mainfrom
maxammann:fix/exec-run-ssh-empty-output
Open

Fix exec_run() returning empty output over SSH connections#644
maxammann wants to merge 1 commit into
containers:mainfrom
maxammann:fix/exec-run-ssh-empty-output

Conversation

@maxammann
Copy link
Copy Markdown

SSHSocket.send()/recv() were writing to subprocess pipes instead of the real forwarded unix socket established by connect(). Additionally, exec_run() now sends Connection: Upgrade headers so the server returns a 101 response, allowing multiplexed output to be read directly from the raw socket. Without the upgrade, http.client closes the connection before the body can be read because no Content-Length or Transfer-Encoding is set.

Fixes #506

This debugging was heavily Claude supported. In the end after it figured it out I manually provided the correct and minimal fixes.

SSHSocket.send()/recv() were writing to subprocess pipes instead of the
real forwarded unix socket established by connect(). Additionally,
exec_run() now sends Connection: Upgrade headers so the server returns
a 101 response, allowing multiplexed output to be read directly from
the raw socket. Without the upgrade, http.client closes the connection
before the body can be read because no Content-Length or
Transfer-Encoding is set.

Fixes containers#506

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Max Ammann <max.ammann@zoo.dev>
@maxammann maxammann force-pushed the fix/exec-run-ssh-empty-output branch from f272447 to a1ae74d Compare May 13, 2026 09:04
@maxammann
Copy link
Copy Markdown
Author

@jwhonce tyi this should fix podman on macOS as its using SSH connections there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] empty stdout/stderr for exec_run on macOS

1 participant