Bug 1331575 - docker run invalid command, on invalid image: inconsistent diagnostics, exit code
Summary: docker run invalid command, on invalid image: inconsistent diagnostics, exit ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: docker-latest
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: smahajan@redhat.com
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-28 20:39 UTC by Ed Santiago
Modified: 2017-06-14 15:31 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-06-14 15:31:26 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Ed Santiago 2016-04-28 20:39:59 UTC
Given this context:

    # IMG=https://github.com/autotest/autotest-docker/archive/0.7.6.tar.gz
    # docker import $IMG foo

The following command yields inconsistent error messages and exit codes:

    # docker run foo no such command;echo $?

Most of the time, it produces:

    exec: "no": executable file not found in $PATH
    docker: Error response from daemon: Cannot start container <sha>: [9] System error: invalid character ',' looking for beginning of value.
    125        <--- 125 = error in docker daemon itself

Once in a while (~1 in 5) it produces what looks like a sane result:

    exec: "no": executable file not found in $PATH
    docker: Error response from daemon: Container command not found or does not exist..
    127        <--- 127 = command not found (i.e. expected exit status)

And even more rarely (~1 in 8):

    exec: "no": executable file not found in $PATH
    docker: Error response from daemon: Cannot start container <sha>: [9] System error: json: cannot unmarshal string into Go value of type libcontainer.genericError.
    125        <--- docker daemon again

So, yeah, I know: "Docker, Docker, it hurts when I do this." But it would be nice if this produced a consistent 127.

    # rpm -qa|grep docker|sort
    docker-1.9.1-38.el7.x86_64
    docker-common-1.9.1-38.el7.x86_64
    docker-forward-journald-1.9.1-38.el7.x86_64
    docker-latest-1.10.3-19.el7.x86_64
    docker-rhel-push-plugin-1.10.3-19.el7.x86_64
    docker-selinux-1.9.1-38.el7.x86_64
    docker-utils-1.9.1-28.el7.x86_64

Comment 2 smahajan@redhat.com 2016-09-28 14:39:42 UTC
Ed, 

Do you think this is a duplicate of #1364238.
https://bugzilla.redhat.com/show_bug.cgi?id=1364238

Shishir

Comment 3 Ed Santiago 2016-09-28 14:48:32 UTC
I think it's unlikely. Bug 1364238 is specifically about command-line option parsing (--foo, --bar) and is closely tied to the cobra code restructuring. This one is a change only in `docker run` and, in my totally uneducated WAG, is probably in unrelated code. But I can't be sure without a deep dive.

Comment 4 Daniel Walsh 2016-10-18 14:23:46 UTC
Shishir any update on this?

Comment 5 Daniel Walsh 2017-06-14 15:31:26 UTC
We can not reproduce this.


Note You need to log in before you can comment on or make changes to this bug.