Bug 1162807
| Summary: | Docker CLI exit codes for errors? | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Chris Evich <cevich> |
| Component: | docker | Assignee: | smahajan <smahajan> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.0 | CC: | bsarathy, dwalsh, lsm5, mjenner, smahajan, virt-bugs |
| Target Milestone: | rc | Keywords: | Extras, Reopened |
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1097344 | Environment: | |
| Last Closed: | 2015-03-05 03:19:07 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
Chris Evich
2014-11-11 18:00:19 UTC
These 3 commands are providing an exit code of 2 (Non-zero exit code for failure), so they are working as expected.
1) # /usr/bin/docker -D attach --no-stdin=sig-proxy
echo $?
Prints: 2
2. # /usr/bin/docker -D commit --authormessage 123412341234 <container name>
echo $?
Prints: 2
3) docker load --input
Prints: flag needs an arguement: --input
echo $?
Prints: 2
however HELP commands are throwing non-zero (2) exit code.
e.g. docker --help
docker run --help
docker pull --help
These commands should throw exit code 0 (SUCCESS).
So I ll keep this ticket open for now.
Shishir
There is an existing pull request to fix the docker --help issue. For --help issue this is the PR being worked on. https://github.com/docker/docker/pull/9085 Closing the ticket now. Shishir Hi, There must be some discrepancy or mistake I am making then. [root@dockertest ~]# yum update Loaded plugins: product-id, subscription-manager No packages marked for update [root@dockertest ~]# docker version Client version: 1.3.0 Client API version: 1.15 Go version (client): go1.3.1 Git commit (client): 16a7d74/1.3.0 OS/Arch (client): linux/amd64 Server version: 1.3.0 Server API version: 1.15 Go version (server): go1.3.1 Git commit (server): 16a7d74/1.3.0 With docker-1.3.0-5.el7.HTB.x86_64 (i.e. CURRENTRELEASE) I'm still getting a zero exit code, even copy-paste from your commands above: [root@dockertest ~]# /usr/bin/docker -D attach --no-stdin=sig-proxy; echo $? invalid boolean value "sig-proxy" for --no-stdin: strconv.ParseBool: parsing "sig-proxy": invalid syntax See 'docker attach --help'. 0 [root@dockertest ~]# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7c110ce78697 docker_testimage:latest "date" 3 days ago Exited (0) 3 days ago test [root@dockertest ~]# /usr/bin/docker -D commit --authormessage 123412341234 test; echo $? flag provided but not defined: --authormessage See 'docker commit --help'. 0 Though "load" is now giving an exit code of "1", which is good: [root@dockertest ~]# docker load --input; echo $? flag needs an argument: --input See 'docker load --help'. [2014-11-24T11:07:10.287030860-05:00] [fatal] log.go:64 flag needs an argument: --input 1 Ok you guys are working off of different packages. We need to test with the updated docker --help patch. To see if we see the same problems. shishir could you test with the patch I linked you to, to see if this is still a problem. Thanks Dan, I'm glad it was just simple package mismatch. Re-opening so QE can test candidate and/or verify in released/HTB package, including the "--help fix" (unless there's a separate BZ for that aspect). Verified fixed with docker-1.3.2-4.el7.x86_64 Docker autotest exercizes & verifies command exit codes extensivly. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0623.html |