Getting error 'ConnectionError: ('Connection aborted.', error(2, 'No such file or directory'))'
See original GitHub issueI am getting an error when trying to use dockerpty. Using the example in the README:
import docker
import dockerpty
client = docker.Client()
container = client.create_container(
'busybox:latest',
stdin_open=True,
tty=True,
command='/bin/sh')
dockerpty.start(client, container)
When I run this, I get the error:
Traceback (most recent call last):
File "test_script.py", line 9, in <module>
command='/bin/sh')
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/docker/api/container.py", line 116, in create_container
return self.create_container_from_config(config, name)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/docker/api/container.py", line 126, in create_container_from_config
res = self._post_json(u, data=config, params=params)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/docker/client.py", line 166, in _post_json
return self._post(url, data=json.dumps(data2), **kwargs)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/docker/client.py", line 107, in _post
return self.post(url, **self._set_request_timeout(kwargs))
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 508, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/requests/sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "/Users/michaelbarton/Library/Python/2.7/lib/python/site-packages/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(2, 'No such file or directory'))
Here are the details of my docker install, using docker-machine:
Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: darwin/amd64
Server:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: linux/amd64
And the details of my OS:
Darwin Michaels-MacBook-Air.local 14.5.0 Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64 x86_64 i386 MacBookAir7,2 Darwin
Issue Analytics
- State:
- Created 8 years ago
- Comments:5
Top Results From Across the Web
('Connection aborted.', error(2, 'No such file or directory ...
The error here means that /run/docker.sock doesn't exist. 5
Read more >requests.exceptions.ConnectionError: ('Connection aborted ...
I believe you might be running the container that might be connecting another service(DB access or other container service) that was only ...
Read more >error while fetching server api version: ('connection aborted ...
I've found solution is Docker daemon is not working after Docker was installed by Ansible . It's required to add following command in...
Read more >Error saying ConnectionError ProtocolError Connection ...
I have a private insecure docker registry running at http://registry.myserver.com:5000. Ansible version: 1. ... (2, 'No such file or ...
Read more >How to use the urllib3.exceptions.ProtocolError function ... - Snyk
To help you get started, we've selected a few urllib3.exceptions. ... if a1 == 2 or a2 == "No such file or directory":...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you’re using Docker Machine, you can point docker-py at it using
docker-machine env
and thekwargs_from_env()
utility method.@michaelbarton @mejamiewilson Did you find any solution ? I understand that
eval ${docker-machine env default}
works great for command, but any solution for Client() via script ?OS info: Darwin Ravis-MacBook-Pro.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64