Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Error not handled - docker daemon not running #570

Closed
concaf opened this issue Feb 22, 2016 · 3 comments
Closed

Error not handled - docker daemon not running #570

concaf opened this issue Feb 22, 2016 · 3 comments

Comments

@concaf
Copy link
Contributor

concaf commented Feb 22, 2016

This is how atomicapp errors out when the docker daemon is not running.

[vagrant@centos7-adb atomicapp]$ sudo atomicapp --verbose run foo --provider docker
2016-02-22 09:32:57,763 - [INFO] - main.py - Action/Mode Selected is: run
2016-02-22 09:32:57,763 - [DEBUG] - main.py - Final parsed cmdline: run --verbose foo --provider docker
2016-02-22 09:32:57,763 - [DEBUG] - main.py - NuleculeManager init app_path: /var/lib/atomicapp/foo-a45442b82021
2016-02-22 09:32:57,763 - [DEBUG] - main.py - NuleculeManager init image: foo
2016-02-22 09:32:57,764 - [DEBUG] - main.py - Request to unpack to foo to /var/lib/atomicapp/foo-a45442b82021
2016-02-22 09:32:57,764 - [INFO] - base.py - Unpacking image: foo to /var/lib/atomicapp/foo-a45442b82021
2016-02-22 09:32:57,800 - [ERROR] - main.py - Command '['/usr/bin/docker', 'version']' returned non-zero exit status 1
Traceback (most recent call last):
File "/home/vagrant/atomicapp/atomicapp/cli/main.py", line 101, in cli_run
nm.run(**argdict)
File "/home/vagrant/atomicapp/atomicapp/nulecule/main.py", line 224, in run
self.nulecule = self.unpack(dryrun=dryrun, config=self.answers)
File "/home/vagrant/atomicapp/atomicapp/nulecule/main.py", line 129, in unpack
nodeps=nodeps, dryrun=dryrun, update=update)
File "/home/vagrant/atomicapp/atomicapp/nulecule/base.py", line 103, in unpack
docker_handler = DockerHandler(dryrun=dryrun)
File "/home/vagrant/atomicapp/atomicapp/nulecule/container.py", line 37, in init
raise e
CalledProcessError: Command '['/usr/bin/docker', 'version']' returned non-zero exit status 1

Here is the culprit, but we have already handled subprocess.CalledProcessError for a different error.
The traceback can be handled with #569, but how do we distinguish between different errors? How do we make sense out of the docker CLI output and use it? I just tried the switch --format, but it does not seem to format errors.

Please correct if I'm talking gibberish.

@dustymabe
Copy link
Contributor

We could add another case in that except block that handles the output that happens when the docker daemon isn't running?

In the long run I think we are planning to not use the docker cli directly anymore, but use the REST API instead. So we can improve the output as part of that transition.

@concaf
Copy link
Contributor Author

concaf commented Feb 23, 2016

Working on it

concaf added a commit to concaf/atomicapp that referenced this issue Feb 24, 2016
concaf added a commit to concaf/atomicapp that referenced this issue Mar 7, 2016
@concaf
Copy link
Contributor Author

concaf commented Mar 7, 2016

@dustymabe Does this help? #600

concaf added a commit to concaf/atomicapp that referenced this issue Mar 12, 2016
@cdrage cdrage closed this as completed in 46f0d62 Mar 17, 2016
cdrage added a commit that referenced this issue Mar 17, 2016
Handle docker error, 'raise' instead of 'print', fix #570
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants