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

docker-compose.exe up: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 10: ordinal not in range(128) docker-compose returned -1 #3817

Closed
rang501 opened this issue Aug 5, 2016 · 12 comments
Labels
Milestone

Comments

@rang501
Copy link

rang501 commented Aug 5, 2016

I'm getting following error while trying to do docker-compose up on Windows 10 machine:

docker-compose.exe up
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 61, in main
  File "compose\cli\main.py", line 110, in perform_command
  File "compose\cli\command.py", line 35, in project_from_options
  File "compose\cli\command.py", line 102, in get_project
  File "compose\config\config.py", line 319, in load
  File "compose\config\config.py", line 409, in load_services
  File "compose\config\config.py", line 388, in build_services
  File "compose\config\config.py", line 373, in build_service
  File "compose\config\config.py", line 612, in process_service
  File "compose\config\config.py", line 856, in resolve_volume_paths
  File "compose\config\config.py", line 866, in resolve_volume_path
  File "ntpath.py", line 311, in expanduser
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 10: ordinal not in range(128)
docker-compose returned -1

Should be the latest release:

docker-compose.exe version
docker-compose version 1.8.0, build d988a55
docker-py version: 1.9.0
CPython version: 2.7.11
OpenSSL version: OpenSSL 1.0.2d 9 Jul 2015

It's probably caused by my username, it contains character "ä". There are many similar issues, but they seem to be fixed, but not for me unfortunately.

@aanand
Copy link

aanand commented Aug 5, 2016

By the sound of this bug report, it's a Python stdlib issue that's fixed in Python 3 and marked as WONTFIX for Python 2. So we can only fix this by moving Compose to Python 3.

@dnephin @shin- have we tried building Python 3 binaries yet?

@rang501
Copy link
Author

rang501 commented Aug 5, 2016

Are there any workarounds or I just need to wait until Python 3 build is available?

@shin-
Copy link

shin- commented Aug 5, 2016

@rang501 It may sound like a hassle, but you could change your username to contain only ASCII characters.

@dnephin
Copy link

dnephin commented Aug 8, 2016

have we tried building Python 3 binaries yet?

I tried it a while ago. It was working for linux, but failing for windows on appveyor. I tried to get it building, but I don't think I ever got it working. I think it was a pyinstaller issue, so it might be fixed now.

We could encode the values before passing them to the stdlib functions, we do that in other places.

@happiness801
Copy link

I'm having a similar issue:

C:\dev\environment-containers\elk>docker-compose -f local-compose.yml up —force
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 62, in main
  File "compose\cli\main.py", line 114, in perform_command
  File "compose\cli\main.py", line 835, in up
  File "compose\project.py", line 379, in up
  File "compose\project.py", line 177, in get_services_without_duplicate
  File "compose\project.py", line 165, in get_services
  File "compose\project.py", line 136, in get_service
  File "compose\project.py", line 555, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position 0: ordinal not in range(128)
docker-compose returned -1
C:\dev\environment-containers\elk>docker version
Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 23:26:11 2016
 OS/Arch:      linux/amd64

C:\dev\environment-containers\elk>docker-compose version
docker-compose version 1.8.1, build 004ddae
docker-py version: 1.10.3
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016

C:\dev\environment-containers\elk>ver

Microsoft Windows [Version 10.0.14393]

C:\dev\environment-containers\elk>python --version
Python 2.7.9

@davweiss
Copy link

davweiss commented Feb 2, 2017

I have this Problem to.
Everything is uptodate!
Is there any workaround for this?

Severity Code Description Project File Line Suppression State
Error MSB4018 The "PrepareForLaunch" task failed unexpectedly.
Microsoft.DotNet.Docker.CommandLineClientException: Traceback (most recent call last):
File "", line 3, in
File "compose\cli\main.py", line 64, in main
File "compose\cli\main.py", line 113, in perform_command
File "compose\cli\command.py", line 36, in project_from_options
File "compose\cli\command.py", line 103, in get_project
File "compose\config\config.py", line 331, in load
File "compose\config\config.py", line 432, in load_services
File "compose\config\config.py", line 411, in build_services
File "compose\config\config.py", line 396, in build_service
File "compose\config\config.py", line 641, in process_service
File "compose\config\config.py", line 945, in resolve_volume_paths
File "compose\config\config.py", line 955, in resolve_volume_path
File "ntpath.py", line 311, in expanduser
UnicodeDecodeError: 'ascii' codec can't decode byte 0xdf in position 18: ordinal not in range(128)
docker-compose returned -1
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.DockerComposeClientExtensions.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.BuildTasks.PrepareForLaunch.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DotNet.Docker.BuildTasks.DockerBaseTask.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() D:\DEV\Spielwiese\dotNET_core_Hello_Docker_vs15\src\dotNET_core_Hello_Docker_vs15\dotNET_core_Hello_Docker_vs15.xproj C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing\ImportAfter\Microsoft.DotNet.Docker.targets 70
iese\dotNET_core_Hello_Docker_vs15\src\dotNET_core_Hello_Docker_vs15\dotNET_core_Hello_Docker_vs15.xproj C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Publishing\ImportAfter\Microsoft.DotNet.Docker.targets 70

C:\Users\David.Weiß>docker version
Client:
Version: 1.13.0
API version: 1.25
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: windows/amd64

Server:
Version: 1.13.0
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 49bf474
Built: Wed Jan 18 16:20:26 2017
OS/Arch: linux/amd64
Experimental: true

C:\Users\David.Weiß>docker-compose version
docker-compose version 1.10.0, build 4bd6f1a
docker-py version: 2.0.1
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j 26 Sep 2016

C:\Users\David.Weiß>ver

Microsoft Windows [Version 10.0.14393]

@shin-
Copy link

shin- commented Feb 2, 2017

@davweiss It's a bug in Python 2.7. Your options are:

  • Install docker-compose in a Python 3 environment
  • Change your Windows username to use only ASCII characters.

@stephane-r
Copy link

Hi @shin-

I've same problem and i've install pyton 3 on my path Windows and no result.

@shin-
Copy link

shin- commented Feb 6, 2017

@Leg3ndz It's probably a different error then. Can you share the stacktrace and which command you were running?

@stephane-r
Copy link

Hi @shin-

Finaly, i've change my Windows username :( I've recreate new user with only ASCII characters.

Thank you for the solution

@zhitom
Copy link

zhitom commented Jun 22, 2017

Because you can choose different path with docker tool box's installing,if you choose different path,it can affect docker-compose.exe's executing ,So you MUST MODIFY %yourpath\Docker Toolbox\start.sh:

export PATH="/yourpath/Docker Toolbox:$PATH"

@xlentLambert
Copy link

xlentLambert commented Jan 4, 2018

I had changed to language of Windows from English to Swedish (where the folder "Users" => "Användare"). When I changed back to English it worked again. I guess the whole path needs to only use ASCII characters.

@shin- shin- added this to the 1.20.0 milestone Jan 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants