Ubuntu 14.04 x64
$ docker --version
Docker version 1.6.0, build 4749651
$ docker-compose --version
docker-compose 1.2.0
Getting error on $ sudo docker-compose build
$ sudo docker-compose build
Building web...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 5: ordinal not in range(128)
docker-compose.yml
web:
build: .
command: gulp serve
ports:
- 3001:3001
volumes:
- .:/app
- /bower_components:./app/bower_components
volumes_from:
- bower_components
Dockerfile
FROM ubuntu:14.04
ENV NVM_VERSION 0.24.1
ENV NODE_VERSION 0.12.0
ENV NPM_VERSION 2.5.1
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v$NVM_VERSION/install.sh | bash \
&& source ~/.bashrc \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& npm install -g npm@"$NPM_VERSION" gulp bower \
WORKDIR /app
CMD tail -f /dev/null
NOTE: withdocker-comose -v 1.1.0-rc2
everything works well
I can't reproduce, but from the stack trace it looks like something's going wrong when trying to tar your build directory - specifically, when trying to build a path.
Do you have a file somewhere with an odd name?
I have the same probleme than @itsNikolay.
Ubuntu 14.04 x64
$ docker --version
Docker version 1.6.0, build 4749651
$ docker-compose --version
docker-compose 1.2.0
$ docker-compose build
db uses an image, skipping
Building web...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128)
Works with docker-compose 1.1.0.
It's would be great to have a better error message to locate a possible file with odd name
Having the same issue with docker-compose 1.1.0:
$ docker --version
Docker version 1.3.1, build 4e9bbfa
$ docker-compose --version
docker-compose 1.1.0
Even after running docker-compose rm && docker-compose up -d it stalls on 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)
Full trace:
$ docker-compose up -d
Recreating adoveoweb_redisphpsessionhandler_1...
Recreating adoveoweb_mailcatcher_1...
Creating adoveoweb_phpfiles_1...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 445, in up
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.project", line 184, in up
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 259, in recreate_containers
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 227, in create_container
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 453, in _get_container_create_options
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 636, in merge_environment
File "/Users/ben/fig/build/docker-compose/out00-PYZ.pyz/compose.service", line 670, in env_vars_from_file
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)
UPDATE: Upgraded docker-compose to 1.2.0 and the problem went away
UPDATE: Upgraded docker to 1.6.0 and the problem has not yet resurfaced - everything works afaik
I can reproduce this bug with a minimal project:
$ touch donées.txt
$ cat > docker-compose.yml << eof
data:
build: .
eof
$ cat > Dockerfile <<eof
FROM scratch
COPY donées.txt .
eof
after I have the bug
$ docker-compose build
Building data...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)
If I rename the file donées.txt
as data.txt
it's work.
Looks like a codepage / conversion thing; http://stackoverflow.com/questions/24475393/unicodedecodeerror-ascii-codec-cant-decode-byte-0xc3-in-position-23-ordinal
I can't even run docker build
when there's a file with that name (Mac OS X 10.10.3). When I run @oalbiez's commands:
$ docker build
Sending build context to Docker daemon 4.608 kB
Sending build context to Docker daemon
Step 0 : FROM scratch
--->
Step 1 : COPY donées.txt .
INFO[0000] donées.txt: no such file or directory
docker-compose build
gives me the same error, unsurprisingly.
That output looks like utf-8 treated as non-UTF8 yes.
I have the same problem with compose 1.2 but not 1.1, Ubuntu 15.04, Docker 1.6.0.
Even a compose yml with one service to build with a Dockerfile with one line did not work but "docker build ." has no problem.
Getting conflicting reports about what versions of Compose it does and doesn't work with.
@itsNikolay, @motin, @madaray:
I recommend passing --no-cache
to both docker build
and docker-compose build
, just to be sure we don't get any false negatives.
I tracked this down to our "apple-touch-icon-precomposed.png". After copying apple-touch-icon.png it works. Not sure why this doesn't happen with 1.1.0.
UPDATE: The name was corrupted somehow: apple-\302\255touch-\302\255icon-\302\255precomposed.png
@aanand, I am having the same issue with 1.2.0, but not 1.1.0 (Ubuntu 14.04 with kernel version 3.16.0-30-generic).
The traceback information are exactly the same as @itsNikolay 's.
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 464, in up
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 208, in up
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 214, in recreate_containers
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 187, in create_container
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 39: ordinal not in range(128)
My Dockerfile and docker-compose.yml are pretty simple. I am trying to run a simple node application talk with redis database to keep the session.
FROM node:0.10-onbuild
MAINTAINER YIRAN Mao <[email protected]>
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
EXPOSE 3000
EXPOSE 3001
redis:
image: redis:2.8.19
command: redis-server --appendonly yes
volumes:
- /data/:/data/
ports:
- "6379:6379"
keystone:
build: .
command: node app.js
ports:
- "5000:3000"
- "5001:3001"
volumes:
- ./:/usr/src/app
@yeelan0319 I think you're leaving out important details here. Could you paste your package.json
, for a start?
@aanand Glad to hear that may help. My application is just a keystone sample application which you can get it easily at keystonejs.com.
And here is the package.json:
{
"name": "keystonejs",
"version": "0.0.0",
"private": true,
"dependencies": {
"async": "~0.9.0",
"cloudinary": "^1.0.12",
"connect-redis": "^2.2.0",
"dotenv": "~0.4.0",
"express-handlebars": "~1.1.0",
"handlebars": "~2.0.0",
"i18n": "^0.5.0",
"keystone": "~0.3.0",
"moment": "~2.8.1",
"node-sass": "~1.0.1",
"node-sass-middleware": "^0.4.0",
"underscore": "~1.7.0"
},
"devDependencies": {
"gulp": "~3.7.0",
"gulp-jshint": "~1.9.0",
"jshint-stylish": "~0.1.3",
"gulp-watch": "~0.6.5"
},
"engines": {
"node": ">=0.10.22",
"npm": ">=1.3.14"
},
"scripts": {
"start": "node keystone.js"
},
"main": "keystone.js"
}
OK, I believe I've fixed this in https://github.com/docker/compose/issues/1376.
The problem is, as we've established, filenames with non-ASCII characters in. It occurs only when you pass a Unicode string to os.walk
, so we can avoid it by making sure docker-py's build
function receives a byte string.
I believe the problem is in all versions of Compose; differing reports about which versions do and don't work are most likely false negatives caused by docker build
caching.
@motin Your issue is a different one, as the exception is raised in env_vars_from_file
. I suspect you've got a non-ASCII character in your env file. If so, could you open a separate issue about it, with a minimal failing case?
@aanand I've just re-tested with docker-compose 1.1.0 (https://github.com/docker/compose/releases/tag/1.1.0) it's not a cache issue.
@oalbiez Do you mean that when you run docker-compose build --no-cache
with docker-compose 1.1.0, the build runs successfully?
@aanand I would also suspect it is a cache problem. In my case, I had version 1.2.0 in the first place, which doesn't work. So I downgrade to version 1.1.0 right away and that works.
Just to double check, I removed all containers, images I had and did a clean docker-compose build --no-cache
just now, it works.
Just a reference back to my post,
The error was thrown before it prints:
Step 0 : FROM node:0.10-onbuild
which would be the next line printed if build succeed.
As you can see in my Dockerfile
, node 0.10 is my base image for the build and the program pending after Building keystone...
really long before it threw the error. I am not sure what's the pre-build step composer take before execute Dockerfile
, I may need to dig into the code to see.
Hope this may provide you some clue.
The problem shown in all the stack traces (apart from @motin's) is entirely client-side, and occurs when creating the tarball to send to the server.
@aanand Yes, see the result:
$ ./compose-1.1.0 build --no-cache
Building data...
Step 0 : FROM scratch
--->
Step 1 : COPY * /home/
---> 141f622fa7de
Removing intermediate container 4222acf7ea17
Successfully built 141f622fa7de
$ ./compose-1.2.0 build --nocache
Building data...
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 4: ordinal not in range(128)
Interesting.
I've realised caching is actually irrelevant, as the problem occurs before we've even sent the build context to the daemon. False alarm.
having the same issue
$ docker-compose build --no-cache
redis uses an image, skipping
mongo uses an image, skipping
Building web...
Traceback (most recent call last):
File "
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 27, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 59, in perform_command
File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 119, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 191, in build
File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 475, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.client", line 300, in build
File "/code/build/docker-compose/out00-PYZ.pyz/docker.utils.utils", line 73, in tar
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 294, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/os", line 284, in walk
File "/code/build/docker-compose/out00-PYZ.pyz/posixpath", line 80, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 1: ordinal not in range(128)
@aanand @dnephin does compose have an automated "master" build? (Like https://master.dockerproject.com). Would be nice if users were able to confirm easily if the problem has been resolved by downloading the latest build.
Sorry for mis-using this issue for that, but I wanted to ask the reporters here if they could test on "master", then realised docker-compose didn't have a master build :smile:
@thaJeztah It would be nice, yes. For now, if anyone's using Compose via pip, they can run:
pip install git+https://github.com/docker/compose.git@4bce388b515343fd9c3f8a3916928e096a325dc9#egg=docker-compose
Thank you, the 1.3.0dev version installed did the trick for me.
I have the same problem.
docker-compose version: 1.5.0
Docker version 1.9.0, build 76d6bc9
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/code/compose/cli/main.py", line 54, in main
File "/code/compose/cli/docopt_command.py", line 23, in sys_dispatch
File "/code/compose/cli/docopt_command.py", line 26, in dispatch
File "/code/compose/cli/main.py", line 170, in perform_command
File "/code/compose/cli/main.py", line 588, in up
File "/code/compose/cli/main.py", line 658, in attach_to_logs
File "/code/compose/cli/log_printer.py", line 27, in run
File "/code/compose/cli/multiplexer.py", line 35, in loop
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc2 in position 0: unexpected end of data
docker-compose returned -1
Hi, I have the same problem. But real reason is I'm behind a proxy server which return non-UTF error messages. Without proxy server compose working well. Maybe it helps someone.
Just hit this and eventually tracked it down to Hipchat messing with copy/past. Manually type a command on one machine and it works. Copy/paste through hipchat to another machine and it fails. Retype the command on the new machine and it works perfectly.
@jeffwidman Hey Thanks a lot! After so many try, I figure out your comment is most helpful to me. Thanks!
PSA: Slack also changes --no-cache
to –no-cache
, which will result in the exact same error when copy pasted from there.
I had a similar problem. It turned out my requirements.txt was all hex code.
Watch you command line. You must have used some unicode (0xe2 ...): for example long unicode '--' instead of ascii '-'.
Got the same issue, it was only because my docker daemon stopped working.
@jeffwidman helped me straighten mine out. The error, for me, came from copying and pasting the command from Window's notepad into a PuTTY terminal.
i have a same problem
$ docker-compose up
Traceback (most recent call last):
File "docker-compose", line 3, in <module>
File "compose\cli\main.py", line 85, in main
File "compose\cli\main.py", line 113, in dispatch
File "compose\cli\utils.py", line 84, in get_version_info
File "compose\cli\utils.py", line 105, in get_build_version
File "ntpath.py", line 85, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xcd in position 7: ordinal not in range(128)
Failed to execute script docker-compose
when i run it at docker-quickstart-terminal, i met the same err messages
docker-compose --version
Same issue. For my case it was not a problem with docker-compose.yml itself. It was a problem with ".dockerignore". So you cold try to check: .dockerignore, docker-compose.yml, Dockerfile, etc. on not ascii symbols. In IntelliJ IDEA I just set US-ASCII in file encodding dropdown (which is placed at bottom toolbar on the right) and it converts non-ascii symbols to "?".
Same here :/
Traceback (most recent call last):
File "bin/docker-compose", line 6, in <module>
File "compose/cli/main.py", line 71, in main
File "compose/cli/main.py", line 124, in perform_command
File "compose/cli/main.py", line 797, in run
File "compose/cli/main.py", line 1263, in run_one_off_container
File "compose/cli/main.py", line 1343, in call_docker
File "distutils/spawn.py", line 220, in find_executable
File "posixpath.py", line 73, in join
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 11: ordinal not in range(128)
Failed to execute script docker-compose
Docker version 18.03.1-ce, build 9ee9f40
docker-compose version 1.17.0, build ac53b73
same error:
parker@ubuntu:~/go/src/github.com/hyperledger/fabric/examples/e2e_cli$ docker-compose -f docker-compose-orderer.yaml up –d
Traceback (most recent call last):
File "bin/docker-compose", line 6, in
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 952, in up
File "compose/project.py", line 428, in up
File "compose/project.py", line 188, in get_services_without_duplicate
File "compose/project.py", line 176, in get_services
File "compose/project.py", line 147, in get_service
File "compose/project.py", line 666, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)
Failed to execute script docker-compose
and my yaml content is as following:
version: '2'
services:
orderer.example.com:
extends:
file: base/docker-compose-base.yaml
service: orderer.example.com
container_name: orderer.example.com
I download the latest docker-compose, fix the problem
我也有同样的问题,是因为 .dockerignore文件中包含中文
I have the same problem because the. dockerignore file contains Chinese.
Most helpful comment
Just hit this and eventually tracked it down to Hipchat messing with copy/past. Manually type a command on one machine and it works. Copy/paste through hipchat to another machine and it fails. Retype the command on the new machine and it works perfectly.