Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1331575

Summary: docker run invalid command, on invalid image: inconsistent diagnostics, exit code
Product: Red Hat Enterprise Linux 7 Reporter: Ed Santiago <santiago>
Component: docker-latestAssignee: smahajan <smahajan>
Status: CLOSED CURRENTRELEASE QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.2CC: cevich, dwalsh
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-14 15:31:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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.