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

IOError: [Errno 0] Error. on Windows. #5019

Closed
Lanayx opened this issue Jul 13, 2017 · 24 comments

Comments

Projects
None yet
@Lanayx
Copy link

commented Jul 13, 2017

Diagnostic ID 9F77D425-42B9-4F96-9C8B-7154DDF17AC9/2017-07-13_11-03-12

PS D:\Work\Imho\Api> docker-compose -f docker-compose.yml up
Creating network "api_default" with the default driver
Pulling ignite (apacheignite/ignite:latest)...
latest: Pulling from apacheignite/ignite
5040bd298390: Pulling fs layer
fce5728aad85: Pulling fs layer

Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 118, in perform_command
  File "compose\cli\main.py", line 926, in up
  File "compose\project.py", line 401, in up
  File "compose\service.py", line 305, in ensure_image_exists
  File "compose\service.py", line 1001, in pull
  File "compose\progress_stream.py", line 37, in stream_output
  File "codecs.py", line 370, in write
  File "site-packages\colorama\ansitowin32.py", line 40, in write
  File "site-packages\colorama\ansitowin32.py", line 141, in write
  File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
  File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose

docker-compose.yml:

version: '3'
services:
  ignite:
    image: apacheignite/ignite

This error only happens on one of my 3 machines, so I have no idea what causes it. Resetting to factory defaults or reinstalling docker doesn't help. Without docker compose the image is pulling and then working fine. All the machines are on windows 10 and latest stable docker installed.

@shin-

This comment has been minimized.

Copy link
Contributor

commented Jul 13, 2017

Looks like you're running into tartley/colorama#101

Are you able to change the default encoding on that machine to use UTF-8? This resource would be a good start.

@Lanayx

This comment has been minimized.

Copy link
Author

commented Jul 14, 2017

Encoding change doesn't help. However, what I've found during testing is that it only happens in VSCode, where I'm working. It internally runs PowerShell which fails, but if I run PowerShell manually without VSCode, it works. Looks like it is VSCode only issue, so I'm closing the ticket

@klinamen

This comment has been minimized.

Copy link

commented Nov 1, 2017

Diagnostic ID: DF9BA1B4-FD8A-4953-A1C0-7293B61C5149/2017-11-01_12-51-34

When I run docker-compose in a standalone Powershell, this issue does not come out, BUT it hangs at random steps during the image build process. Trying to interrupt process with CTRL+C produces - after a long time - you can see this stack trace that pointed me to this issue.

 [...]

 ---> Running in 9bd4a536c9fc
 ---> 9eb9a90e0501
Step 26/70 : USER root
 ---> Running in ba492d308e75
 ---> 37395f008135
Step 27/70 : RUN if [ ${INSTALL_YARN} = true ]; then     echo "" >> ~/.bashrc &&     echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc &&     echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc ;fi
 ---> Running in 71dec9b40ab0
GTraceback (most recent call last):
  File "docker-compose", line 6, in <module>
  File "compose\cli\main.py", line 68, in main
  File "compose\cli\main.py", line 121, in perform_command
  File "compose\cli\main.py", line 978, in up
  File "contextlib.py", line 35, in __exit__
  File "compose\cli\main.py", line 1256, in up_shutdown_context
  File "site-packages\colorama\ansitowin32.py", line 40, in write
  File "site-packages\colorama\ansitowin32.py", line 141, in write
  File "site-packages\colorama\ansitowin32.py", line 169, in write_and_convert
  File "site-packages\colorama\ansitowin32.py", line 174, in write_plain_text
IOError: [Errno 0] Error
Failed to execute script docker-compose
`
May the hanging issue be related to this?
@AnnatarHe

This comment has been minimized.

Copy link

commented Nov 2, 2017

@Lanayx Yeah, It works for me too. Hyper.js also have this issue.

@mickael83

This comment has been minimized.

Copy link

commented Nov 15, 2017

@AnnatarHe did you find any way to solve this issue using Hyper.js?

@AnnatarHe

This comment has been minimized.

Copy link

commented Nov 16, 2017

@mickael83 no... Maybe all electron based apps have this issue.

@Tetraib

This comment has been minimized.

Copy link

commented Nov 22, 2017

I confirm same behavior with native powershell. It started to fail after a windows update.
In powershell the error do not show up until you kill the process.

In vs code it shows directly which lead you to think it's a vs code error only.

docker-compose colorama bug

@gpunx

This comment has been minimized.

Copy link

commented Nov 22, 2017

same issue here. did not work in integrated vscode powershell, but ran fine in powershell.

@klinamen

This comment has been minimized.

Copy link

commented Nov 23, 2017

I confirm the behavior reported by @Tetraib. This issue should be reopened and investigated because could make the product unreliable and unusable.

@Tetraib

This comment has been minimized.

Copy link

commented Nov 23, 2017

@gpunx in powershell it appears to work better (does not fail as much as with vs code) the bug is sometimes not easy to pick up it's very random.
I'm developing a nodejs API which restart on code change. I spam ctrl-s key and usually after 10 or so it fails silently until you kill the process.

@klinamen I agree, it is very unreliable and unusable
As a workaround in native powershell you can do the following

  1. Execute chcp in cmd which returned 850 in my case
  2. Execute chcp 850 in powershell

It stops failing in native powershell (does not works for vs code)

@Speedy1991

This comment has been minimized.

Copy link

commented Nov 25, 2017

Got the same error if running docker with much output (e.g. configure/compiling in container). It get's a littlebit better if i redirect the outputs to /dev/null

€dit:
Error occurs in CMD and Powershell.
Running in a gitbash is just fine.
Maybe it is a buffer problem?

@mtpultz

This comment has been minimized.

Copy link

commented Nov 26, 2017

Confirming the issue occurs in VSCode's terminal and PowerShell, but works in GitBash.

@FluffierThanThou

This comment has been minimized.

Copy link

commented Nov 27, 2017

I have this problem in CMD, PowerShell, and Git-bash - regardless of running stand-alone or integrated. Fiddling with the code page did nothing, but setting the --no-ansi flag on docker-compose seems to resolve the issue (presumably by bypassing colorama).

Replying here because it's high in the google results for the stack trace, the --no-ansi flag was suggested here; #5263

@dschulten

This comment has been minimized.

Copy link

commented Dec 11, 2017

Same problem in Intellij/Webstorm terminal

IOError: [Errno 0] Error
Failed to execute script docker-compose

but works in git-bash for Windows or cmder. The --no-ansi option does not help in Intellij.

@big-red-dragon

This comment has been minimized.

Copy link

commented Dec 11, 2017

Works for me in Cygwin and Powershell, doesn't work if I use Cygwin as IntelliJ terminal. Something must be bugged with the script.

@navossoc

This comment has been minimized.

Copy link

commented Dec 12, 2017

+1 here... watching

@WyrdNexus

This comment has been minimized.

Copy link

commented Dec 13, 2017

Looks like this is an issue with VSCode and Intellij's integrated terminals.

Intellij Issue IDEA-181817

Fails in

  • Intellij powershell terminal
  • intellij cmd terminal
  • VScode

Works in

  • Git-Bash: MINGW64
  • CMD terminal
  • Powershell terminal
@shin-

This comment has been minimized.

Copy link
Contributor

commented Dec 13, 2017

Hey folks, the root cause for this issue is a bug in Windows as described here: microsoft/vscode#36630 (comment)

There's nothing that can be done on our end to mitigate this, although running with the --no-ansi might help in the meantime.

Thank you for your understanding.

@SkylinR

This comment has been minimized.

Copy link

commented Dec 19, 2017

That's weird because in my case docker-compose sometimes works in webstorm terminal and sometimes not then it throws error:

IOError: [Errno 0] Error
Failed to execute script docker-compose

Then i use windows powershell and it's ok

@Ymasri93

This comment has been minimized.

Copy link

commented Jan 6, 2018

to add to @WyrdNexus comment above. The same error occurs when I use docker-compose on windows with the pycharm terminal (which is another jetbrains IDE like intellij)

@kekkler

This comment has been minimized.

Copy link

commented Jan 7, 2018

This occurs for me on both native powershell and cmd.
cmd_docker_compose_issue
powershell_docker_compose_issue

@theel0ja

This comment has been minimized.

Copy link

commented Feb 1, 2018

Works in Powershell, but crashes in Hyper or VSCode shell

And while running the script in Powershell window, it opened this window to demand access to my E:\ drive where the code is.
image

@yakovenkoroman1993

This comment has been minimized.

Copy link

commented Feb 5, 2018

I have same problems. In cmd docker-compose doesn't work. But It sometimes works in powershell. Luckily, in git bash console I could build images.
image

@shin-

This comment has been minimized.

Copy link
Contributor

commented Feb 5, 2018

I'm locking this thread so the relevant information doesn't get buried with people reporting the same issue over and over.

Please refer to this comment for the identified cause and proposed mitigation ; people affected will have to arm themselves with patience and make sure to update Windows when the fix comes out.

@docker docker locked and limited conversation to collaborators Feb 5, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.