X Tutup
The Wayback Machine - https://web.archive.org/web/20201014013914/https://github.com/docker/docker-py/issues/2562
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Client ping raises pywintypes.error if Docker pipe is not open #2562

Open
inkychris opened this issue May 14, 2020 · 1 comment
Open

Comments

@inkychris
Copy link

@inkychris inkychris commented May 14, 2020

The DockerClient.ping() method raises a docker.errors.APIError if the daemon is not responsive, however, on Windows if Docker is not running at all or switching between Linux and Windows containers, the pipe is not open and subsequently results in

pywintypes.error: (2, 'CreateFile', 'The system cannot find the file specified.')

or

pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')

Steps to recreate:

Make sure Docker isn't running (System Tray > Quit Docker Desktop)

>>> import docker
>>> client = docker.from_env()
>>> client.ping()
@shughes-uk
Copy link

@shughes-uk shughes-uk commented Aug 7, 2020

just wanted to add this is slightly painful to deal with in a cross platform docker application as you'd have to do a conditional import of pywintypes to catch the error properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.
X Tutup