UnicodeDecodeError when executing docker-compose up
when running docker-compose up
This error happens:
File "bin/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 "contextlib.py", line 35, in __exit__
File "compose/cli/errors.py", line 53, in handle_connection_errors
File "compose/cli/errors.py", line 118, in get_conn_error_message
File "distutils/spawn.py", line 220, in find_executable
File "posixpath.py", line 73, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Failed to execute script docker-compose
Versions :
docker-compose version 1.17.1, build 6d101fb
Docker version 17.09.0-ce, build afdb6d4
On Ubuntu 16.04.3
locale
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
Thanks for the report!
If you have a moment, can you try executing the script below and share the output as well?
#!/usr/bin/python
from distutils.spawn import find_executable
print find_executable(b'docker')
print find_executable(u'docker')
Having the same issue described above, running version 1.18
File "docker-compose", line 6, in <module>
File "compose\cli\main.py", line 71, in main
File "compose\cli\main.py", line 121, in perform_command
File "compose\cli\command.py", line 25, in project_from_options
File "compose\config\environment.py", line 61, in from_env_file
File "compose\config\environment.py", line 57, in _initialize
File "compose\config\environment.py", line 36, in env_vars_from_file
File "codecs.py", line 699, in next
File "codecs.py", line 630, in next
File "codecs.py", line 545, in readline
File "codecs.py", line 492, in read
File "encodings\utf_8_sig.py", line 104, in decode
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 0: invalid start byte
Failed to execute script docker-compose
Versions:
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a96
running on windows 10
Looks like your .env file isn't encoded properly. Please make sure you're using utf-8 encoding.
Be aware, you powershell users, creating a new file usually results in UTF-16+BOM.
Generally speaking, windows 10 does usually create UTF16+BOM files plain as Textfiles. Commandline, API calls.
我也有同样的问题,是因为 .dockerignore文件中包含中文 I have the same problem because the. dockerignore file contains Chinese.
Looks like your
.envfile isn't encoded properly. Please make sure you're using utf-8 encoding.
What worked for me was creating an empty .env file in the directory I run docker-compose in (encoded as UTF-8).
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: invalid continuation byte
[13032] Failed to execute script docker-compose
Traceback (most recent call last):
File "bin/docker-compose", line 6, in
Hi, How do I solve a problem? I don’t know what to do
when running docker-compose up This error happens:
ERROR: .UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 4: invalid continuation byte
Versions : docker-compose version 1.26.2, build unknown Docker version 19.03.12, build 48a6621
On Raspibian
locale
LANG=en_US.UTF-8 LANGUAGE=pt_BR.UTF-8 LC_CTYPE="pt_BR.UTF-8" LC_NUMERIC="pt_BR.UTF-8" LC_TIME="pt_BR.UTF-8" LC_COLLATE="pt_BR.UTF-8" LC_MONETARY="pt_BR.UTF-8" LC_MESSAGES="pt_BR.UTF-8" LC_PAPER="pt_BR.UTF-8" LC_NAME="pt_BR.UTF-8" LC_ADDRESS="pt_BR.UTF-8" LC_TELEPHONE="pt_BR.UTF-8" LC_MEASUREMENT="pt_BR.UTF-8" LC_IDENTIFICATION="pt_BR.UTF-8" LC_ALL=pt_BR.UTF-8
I have the same issue :+1:
docker-compose ps
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in
still unable to solve.. any help is welcome
@xoroz ~~let me guess, your locale is also pt_BR?~~ I know another unrelated context where users with pt_BR locale are having problems: https://github.com/libvips/pyvips/issues/80 although it's on Windows.
not really it was UTF-8 i had to rebuild the entire server. i tried everything including reinstalling docker and docker-compose nothing helped..
On Fri, Jan 22, 2021 at 3:50 PM Serhiy Zahoriya [email protected] wrote:
@xoroz https://github.com/xoroz let me guess, your locale is also pt_BR? I know another unrelated context where users with pt_BR locale are having problems: libvips/pyvips#80 https://github.com/libvips/pyvips/issues/80
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/compose/issues/5442#issuecomment-765455362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6I4DV4V2YA77AMSL44HGTS3GGDLANCNFSM4EG7BVBA .
-- Felipe Ferreira
same issue when run docker-compose(1.28.5) embedded in docker-desktop on win 10: `λ docker-compose up -d Traceback (most recent call last): File "docker\api\client.py", line 214, in _retrieve_server_version File "docker\api\daemon.py", line 181, in version File "docker\utils\decorators.py", line 46, in inner File "docker\api\client.py", line 237, in _get File "requests\sessions.py", line 543, in get File "requests\sessions.py", line 516, in request File "requests\sessions.py", line 446, in prepare_request File "requests\utils.py", line 204, in get_netrc_auth File "netrc.py", line 30, in init File "netrc.py", line 39, in _parse File "shlex.py", line 109, in get_token File "shlex.py", line 140, in read_token UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 49: illegal multibyte sequence
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "docker-compose", line 3, in
How to solve this problem?
docker-compose up -d
Traceback (most recent call last):
File "/root/buildbox/Python-3.8.2/bin/docker-compose", line 10, in <module>
sys.exit(main())
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/main.py", line 81, in main
command_func()
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/main.py", line 200, in perform_command
project = project_from_options('.', options)
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/command.py", line 60, in project_from_options
return get_project(
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/command.py", line 152, in get_project
client = get_client(
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/docker_client.py", line 41, in get_client
client = docker_client(
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/compose/cli/docker_client.py", line 170, in docker_client
client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs)
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/docker/api/client.py", line 131, in __init__
self._auth_configs = auth.load_config(
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/docker/auth.py", line 359, in load_config
return AuthConfig.load_config(config_path, config_dict, credstore_env)
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/docker/auth.py", line 182, in load_config
'auths': cls.parse_auth(
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/docker/auth.py", line 139, in parse_auth
username, password = decode_auth(entry['auth'])
File "/root/buildbox/Python-3.8.2/lib/python3.8/site-packages/docker/auth.py", line 334, in decode_auth
return login.decode('utf8'), pwd.decode('utf8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xee in position 1: invalid continuation byte
For anyone still facing this issue (I saw some recent comments), please be aware that Compose V1 is EOL, and not being maintained asides from critical security fixes. Please check out Compose V2 (which is GA) (install instructions here).