docker / docker/cli

docker exec's "executable file not found in $PATH" should go to stderr

Open
#2,025 3 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug kind/enhancement version/18.09
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

When docker exec cannot find an executable it prints an error. This error should go to standard error (stderr).

Steps to reproduce the issue:

  1. docker run -d --name ubuntu ubuntu sleep 5m
  2. docker exec -i ubuntu somethingsomething (prints OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"somethingsomething\": executable file not found in $PATH": unknown)
  3. docker exec -i ubuntu somethingsomething > /dev/null

Describe the results you received:

When executing docker exec -i ubuntu somethingsomething > /dev/null nothing gets printed.

Describe the results you expected:

The following printed to stderr:

OCI runtime exec failed: exec failed: container_linux.go:344: starting container process caused "exec: \"somethingsomething\": executable file not found in $PATH": unknown

Output of docker version:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:39 2019
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     true
docker

Output of docker info:

Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 487
Server Version: 18.09.2
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9754871865f7fe2f4e74d43e2fc7ccd237edcbce
runc version: 09c8266bf2fcf9519a651b04ae54c967b9ab86ec
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.787GiB
Name: linuxkit-025000000001
ID: 6XL3:ODYS:MM64:PTBE:B26E:2HTX:XSC6:46YG:7WTT:WF2F:TEF6:PACB
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 128
 Goroutines: 260
 System Time: 2019-07-30T14:24:42.7200981Z
 EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 [REDACTED]
Live Restore Enabled: false
Product License: Community Engine

Additional environment details (AWS, VirtualBox, physical, etc.):

none

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the documented docker run and docker exec commands, then trace the docker exec error-output path. Done means the missing-executable error is written to stderr while the documented redirection no longer suppresses it.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.