4

Everytime I run docker-compose up on my machine (macOS 10.13.5, latest docker version) I get this error

Traceback (most recent call last): File "docker-compose", line 6, in File "compose/cli/main.py", line 71, in main File "compose/cli/main.py", line 124, in perform_command File "compose/cli/command.py", line 41, in project_from_options File "compose/cli/command.py", line 126, in get_project File "compose/project.py", line 96, in from_config File "compose/network.py", line 320, in get_networks File "compose/network.py", line 125, in true_name File "compose/network.py", line 146, in _set_legacy_flag File "compose/network.py", line 106, in inspect File "site-packages/docker/utils/decorators.py", line 19, in wrapped File "site-packages/docker/api/network.py", line 211, in inspect_network
File "site-packages/docker/utils/decorators.py", line 46, in inner
File "site-packages/docker/api/client.py", line 194, in _get File "site-packages/requests/sessions.py", line 521, in get File "site-packages/requests/sessions.py", line 494, in request File "site-packages/requests/sessions.py", line 424, in prepare_request
File "site-packages/requests/utils.py", line 195, in get_netrc_auth
File "netrc.py", line 33, in init File "netrc.py", line 42, in _parse File "shlex.py", line 105, in get_token File "shlex.py", line 136, in read_token File "/Users/distiller/compose-osx-release/compose/venv/lib/python3.6/codecs.py", line 321, in decode UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 33: invalid start byte

1
  • My first instinct is that this error means what it says: you somehow have the byte 0x80 in some file in your system (maybe not the docker-compose.yml) and it’s not UTF-8-encoded text. Commented Jul 19, 2018 at 16:08

5 Answers 5

4

Ok so apparently there is a problem with the current version of docker-compose for macOS... It's just my guess, but anyhow here is how I solved it

curl -L https://github.com/docker/compose/releases/download/1.14.0-rc2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Then restarted the terminal

Sign up to request clarification or add additional context in comments.

Comments

1

I ran into this same issue and this may also be related to your .env files.

Ensure that your .env files are UTF-8.

sudo apt install moreutils
isutf8 yourfile.env

If isutf8 returns no output it's likely a valid UTF-8 file.

Additionally, check the contents of the .env file you're referencing in your docker-compose.yml. Any incorrectly decrypted secrets/values you may be using locally can cause this problem too.

If in doubt, clear the env file and readd lines until you hit the error.

Comments

0

I have 2 ideas: 1. try to reinstall your python 2. use not the latest docker version, but the latest stable

4 Comments

i will try to re install python2, docker is already the latest stable version
The issue is about python3.6 here: "/Users/distiller/compose-osx-release/compose/venv/lib/python3.6/codecs.py"
I re installed python2 just to be sure. But in anycase I knew its not the issue, since I do not have python3 on my machine. Looks like docker has its own python enviroment .. distiller is not a user i have on my machine
@EbramSherif Check your git settings. Maybe you have windows line endings. stackoverflow.com/questions/10418975/…
0

What worked for me was creating an empty .env file in the directory I run docker-compose in (encoded as UTF-8).

2 Comments

If it's empty, it doesn't have an encoding.
@tripleee Sounds reasonable, yes. Notepad++ shows UTF-8 as the encoding anyway. So I wanted to add this.
0

you need to go to the pycharm env file, double click it and install the python env file. Then run the code [docker-compose up airflow-init] again, it'll work.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.