Skip to content

Getting error 'ConnectionError: ('Connection aborted.', error(2, 'No such file or directory'))' #49

@michaelbarton

Description

@michaelbarton

I 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions