Golang docker client (v26.0.2+incompatible) doesn't handle the ContainerExecAttach response correctly when detach is true. #47772
Labels
kind/bug
Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed.
status/0-triage
version/26.0
Description
The go client has the ContainerExecAttach method to execute an already created exec session inside a container. It takes ExecStartCheck as an argument. As part of this struct, we can specify whether to detach the execution or not.
When the Detach field is false, the execution works as expected. However, when it is true, the execution results in an error
unable to upgrade to tcp, received 200
Upon debugging, it is being thrown by this piece of code from the
client/hijack.go
fileThis doesn't hinder the execution of the command inside the container. The command still executes successfully. But it does cause confusion for the client user.
Reproduce
Expected behavior
The client should return successfully and not throw an error.
docker version
Client: Cloud integration: v1.0.35+desktop.13 Version: 26.0.0 API version: 1.45 Go version: go1.21.8 Git commit: 2ae903e Built: Wed Mar 20 15:14:46 2024 OS/Arch: darwin/arm64 Context: desktop-linux Server: Docker Desktop 4.29.0 (145265) Engine: Version: 26.0.0 API version: 1.45 (minimum version 1.24) Go version: go1.21.8 Git commit: 8b79278 Built: Wed Mar 20 15:18:02 2024 OS/Arch: linux/arm64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: