BugZoo
BugZoo copied to clipboard
Docker API mismatch causing exception
After adding the genprog source, I get an exception when running repairbox tool list. I don't think this happened after adding the ManyBugs source, but I can't remove the source and try again because of #76
[12:06] gs17931:RepairBox :) > repairbox source list
Source URL Version
-------- ------------------------------------------ ---------
manybugs https://github.com/ChrisTimperley/ManyBugs 3e87b318
genprog https://bitbucket.org/ChrisTimperley/GP3 0c5d9255
[12:06] gs17931:RepairBox :) > repairbox tool list
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/api/client.py", line 222, in _raise_for_status
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 840, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localunixsocket/v1.30/images/christimperley/genprog:latest/json
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/repairbox", line 9, in <module>
load_entry_point('repairbox==0.0.1', 'console_scripts', 'repairbox')()
File "/usr/local/lib/python3.5/dist-packages/repairbox-0.0.1-py3.5.egg/repairbox/cli.py", line 348, in main
File "/usr/local/lib/python3.5/dist-packages/repairbox-0.0.1-py3.5.egg/repairbox/cli.py", line 262, in <lambda>
File "/usr/local/lib/python3.5/dist-packages/repairbox-0.0.1-py3.5.egg/repairbox/cli.py", line 124, in list_tools
File "/usr/local/lib/python3.5/dist-packages/repairbox-0.0.1-py3.5.egg/repairbox/tool.py", line 60, in installed
File "/usr/local/lib/python3.5/dist-packages/repairbox-0.0.1-py3.5.egg/repairbox/build.py", line 134, in installed
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/models/images.py", line 208, in get
return self.prepare_model(self.client.api.inspect_image(name))
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/utils/decorators.py", line 19, in wrapped
return f(self, resource_id, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/api/image.py", line 262, in inspect_image
self._get(self._url("/images/{0}/json", image)), True
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/api/client.py", line 228, in _result
self._raise_for_status(response)
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/api/client.py", line 224, in _raise_for_status
raise create_api_error_from_http_exception(e)
File "/usr/local/lib/python3.5/dist-packages/docker-2.6.1-py3.5.egg/docker/errors.py", line 31, in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.30, server API version: 1.24)")
Ah, interesting. Docker's Python API refuses to work unless its version is older than or the same as the version of the Docker server that is installed to your machine. This is an unacceptably hideous error message, though. I think a more acceptable solution is to add an exceptions module, and to improve error reporting on the CLI.
In the meantime, you can get around the issue by updating the Docker installation on your machine.