Bug 1300187

Summary: Unify output of error when docker daemon is not running
Product: Red Hat Enterprise Linux 7 Reporter: Alex Jia <ajia>
Component: atomicAssignee: Brent Baude <bbaude>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.4CC: dwalsh, lsm5, walters
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-23 16:21:16 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 Alex Jia 2016-01-20 08:07:12 UTC
Description of problem:
when docker daemon is not running, we ran atomic command will get different error message, it had better to define a unified error for this case.

Version-Release number of selected component (if applicable):
docker-1.9.1-11.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. systemctl stop docker 
2. to run atomic command


Actual results:
# docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

# atomic images
('Connection aborted.', error(111, 'Connection refused'))

# atomic migrate export
<class 'requests.exceptions.ConnectionError'>

# atomic stop busybox
Unable to communicate with docker daemon: ('Connection aborted.', error(111, 'Connection refused'))

# atomic scan busybox

Unable to communicate with docker daemon

# atomic top busybox
No containers running

NOTE: I guess atomic top doesn't need to communicate with docker daemon, if so, it's okay, otherwise, we should check docker daemon firstly.

Expected results:
atomic command gets the same error message "Cannot connect to the Docker daemon. Is the docker daemon running on this host?" when docker daemon is not running.

Additional info:

Comment 2 Daniel Walsh 2016-02-22 20:06:12 UTC
Brent any movement on this?

Comment 3 Brent Baude 2016-03-02 15:42:53 UTC
PR ->https://github.com/projectatomic/atomic/pull/309

Comment 4 Brent Baude 2016-03-03 14:44:15 UTC
The PR has now been merged and is in the master branch as part of the 1.9 release.

Comment 5 Alex Jia 2016-04-07 10:25:35 UTC
[cloud-user@atomic-00 ~]$ sudo atomic host status
  TIMESTAMP (UTC)         VERSION   ID             OSNAME               REFSPEC                                                        
* 2016-03-29 20:52:18     7.2.3     d620e84186     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard     
  2016-03-11 19:31:01     7.2.3     f6f9c97816     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
     
[cloud-user@atomic-00 ~]$ rpm -q atomic docker
atomic-1.9-4.gitff44c6a.el7.x86_64
docker-1.9.1-25.el7.x86_64

[cloud-user@atomic-00 ~]$ sudo atomic top busybox
('Connection aborted.', error(2, 'No such file or directory'))

Comment 6 Brent Baude 2016-04-07 13:11:55 UTC
Should be fixed with https://github.com/projectatomic/atomic/pull/340

Comment 7 Daniel Walsh 2016-04-07 14:10:51 UTC
Fixed in atomic-1.10.

Comment 9 Alex Jia 2016-06-12 10:40:52 UTC
I can get a unified error message 'The docker daemon does not appear to be running.' on atomic-1.10.3-1.el7.x86_64 when docker daemon is not running, so move the bug to VERIFIED status.

[cloud-user@atomic-host-001 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Atomic Host release 7.2

[cloud-user@atomic-host-001 ~]$ sudo atomic host status
  TIMESTAMP (UTC)         VERSION     ID             OSNAME               REFSPEC                                                   
* 2016-06-06 18:12:07     7.2.5       4bf265cf86     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard
  2016-05-06 05:57:30     7.2.4       b060975ce3     rhel-atomic-host     rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard

[cloud-user@atomic-host-001 ~]$ rpm -q atomic docker
atomic-1.10.3-1.el7.x86_64
docker-1.10.3-31.el7.x86_64

[cloud-user@atomic-host-001 ~]$ sudo systemctl stop docker
[cloud-user@atomic-host-001 ~]$ sudo atomic top busybox
The docker daemon does not appear to be running.

[cloud-user@atomic-host-001 ~]$ sudo atomic images
The docker daemon does not appear to be running.

[cloud-user@atomic-host-001 ~]$ sudo atomic migrate export
The docker daemon does not appear to be running.

[cloud-user@atomic-host-001 ~]$ sudo atomic stop busybox
The docker daemon does not appear to be running.

[cloud-user@atomic-host-001 ~]$ sudo atomic scan busybox
No scanners are configured for your system.

NOTE: scanner configuration is prior to docker deamon check.

Comment 11 errata-xmlrpc 2016-06-23 16:21:16 UTC
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://access.redhat.com/errata/RHBA-2016:1273