Due to organizational infrastructure (incompatible Artifactory version), for the time being, I am required to use Docker engine version 1.7.1, which is not compatible with Docker Compose.
That being said, the error message produced by Docker Compose when the engine version is incompatible is confusing at best.
$ docker-compose up
Creating network "project_default" with the default driver
ERROR: 404 page not found
The actual cause of the issue is only shown when the --verbose flag is provided:
$ docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'*********', username=u'*******')
docker.auth.auth.parse_auth: Found entry (registry=u'*********', username=u'*******')
ERROR: compose.cli.main.log_api_error: The engine version is lesser than the minimum required by compose. Your current project requires a Docker Engine of version 1.10.0 or superior.
It would be really helpful to show the cause of the error (Docker Engine version less than minimum) without the --verbose flag.
System Information
$ docker info
Containers: 0
Images: 281
Storage Driver: aufs
Root Dir: /mnt/docker/images/aufs
Backing Filesystem: extfs
Dirs: 281
Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.16.0-53-generic
Operating System: Ubuntu 14.04.4 LTS
CPUs: 8
Total Memory: 15.67 GiB
Name: sdc-dev-01
ID: MC6B:CETM:WLIB:JQDR:CLU7:SMXU:63LB:YF5S:C53H:E75V:JSTM:CSIK
Debug mode (server): true
File Descriptors: 9
Goroutines: 14
System Time: 2016-04-12T09:05:22.280748887-07:00
EventsListeners: 0
Init SHA1: c8f59b9547b87a6d097a72404dc29cba4e3a196e
Init Path: /usr/lib/docker/dockerinit
Docker Root Dir: /mnt/docker/images
Http Proxy: http://********.com:****
Https Proxy: http://********.com:****
No Proxy: localhost,127.0.0.1,/var/run/docker.sock
WARNING: No swap limit support
$ docker --version
Docker version 1.7.1, build 786b29d
$ docker-compose --version
docker-compose version 1.6.2, build 4d72027
Are you running with COMPOSE_API_VERSION ? Normally the engine would respond with the appropriate error about the client version being above the server version.
I was not. To test it out, I checked my Docker Server version (which shows client and server both at 1.7.1):
$ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Server version: 1.7.1
Server API version: 1.19
Go version (server): go1.4.2
Git commit (server): 786b29d
OS/Arch (server): linux/amd64
After exporting COMPOSE_API_VERSION=1.7.1, running docker-compose-up produces the following output:
$ docker-compose up
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 56, in main
command.sys_dispatch()
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 23, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 26, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 191, in perform_command
handler(project, command_options)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 657, in up
detached=detached)
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 305, in up
self.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 323, in initialize
self.networks.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 159, in initialize
network.ensure()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 47, in ensure
data = self.inspect()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 82, in inspect
return self.client.inspect_network(self.full_name)
File "/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py", line 32, in wrapper
f.__name__, version
docker.errors.InvalidVersion: inspect_network is not available for version < 1.21
I'm not sure that is much more helpful...
The correct value would be COMPOSE_API_VERSION=1.19. "API version" and "Engine version" are different things, which is confusing, but there's not much we can do about it.
It's annoying that the 1.7.0 Engine returns a 404 instead of the usual version mismatch error. This only seems to happen for network-related commands:
$ docker ps
Error response from daemon: client and server don't have same version (client API version: 1.23, server API version: 1.19)
$ docker network create counter_default
Error response from daemon: 404 page not found
That is strange. I guess the version check is done post-routing, so if the routing fails, the version check never happens.
@aanand - Thank you for the clarification regarding COMPOSE_API_VERSION. I tried again, setting it as you suggested, but the console output was identical to when I had the version set incorrectly:
$ export COMPOSE_API_VERSION=1.19
$ docker-compose up
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 56, in main
command.sys_dispatch()
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 23, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 26, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 191, in perform_command
handler(project, command_options)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 657, in up
detached=detached)
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 305, in up
self.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 323, in initialize
self.networks.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 159, in initialize
network.ensure()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 47, in ensure
data = self.inspect()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 82, in inspect
return self.client.inspect_network(self.full_name)
File "/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py", line 32, in wrapper
f.__name__, version
docker.errors.InvalidVersion: inspect_network is not available for version < 1.21
Interestingly enough, running docker-compose --verbose up with COMPOSE_API_VERSION set does not print the engine version errors that were produced when run _without_ the COMPOSE_API_VERSION set.
$ docker-compose --verbose up
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'https://*****', username=u'*****')
docker.auth.auth.parse_auth: Found entry (registry=u'https://*****', username=u'*****')
compose.cli.command.get_client: docker-compose version 1.6.2, build 4d72027
docker-py version: 1.8.0
CPython version: 2.7.6
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014
compose.cli.command.get_client: Docker base_url: http+docker://localunixsocket
compose.cli.command.get_client: Docker version: KernelVersion=3.16.0-53-generic, Os=linux, ApiVersion=1.19, Version=1.7.1, GitCommit=786b29d, Arch=amd64, GoVersion=go1.4.2
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'vagrantscripts_default')
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 56, in main
command.sys_dispatch()
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 23, in sys_dispatch
self.dispatch(sys.argv[1:], None)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/docopt_command.py", line 26, in dispatch
self.perform_command(*self.parse(argv, global_options))
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 191, in perform_command
handler(project, command_options)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/main.py", line 657, in up
detached=detached)
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 305, in up
self.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/project.py", line 323, in initialize
self.networks.initialize()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 159, in initialize
network.ensure()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 47, in ensure
data = self.inspect()
File "/usr/local/lib/python2.7/dist-packages/compose/network.py", line 82, in inspect
return self.client.inspect_network(self.full_name)
File "/usr/local/lib/python2.7/dist-packages/compose/cli/verbose_proxy.py", line 55, in proxy_callable
result = getattr(self.obj, call_name)(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/docker/utils/decorators.py", line 32, in wrapper
f.__name__, version
docker.errors.InvalidVersion: inspect_network is not available for version < 1.21
Side note: I also attempted upgrading docker-engine to the latest version, and using the now-supported DOCKER_API_VERSION environment variable to specify API version 1.19, but this doesn't appear to get around Artifactory issue RTFACT-7920, which we are expieriencing running Artifactory version 3.5.2.1... guess I will just have to wait until our infrastructure is upgraded.
I'm getting that same error message having installed Docker with Homebrew, as well as when I uninstall and reinstall using Docker toolbox. The problem is whenever there are these error messages pertaining to differing versions of the various different components of the Docker ecosystem, the error message doesn't give you a lot of information about what happened. I know that this likely happened because I updated some part of Docker and not the rest of it, but that should be an easy circumstance for the tools to detect, and tell me which versions _exactly_ should be installed so I can inspect my other versions and see if everything is okay. This error message just tells me that _something_ somewhere in my setup is at less than version 1.21, but gives no information about which component that might be.
@mstahl As in, you're getting the 404 error? What's the output of docker version and docker-compose version?
I'm getting the "docker.errors.InvalidVersion: inspect_network is not available for version < 1.21" error. Here's my version info:
$ docker version
Client:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Tue Apr 26 23:44:17 2016
OS/Arch: darwin/amd64
Server:
Version: 1.11.1
API version: 1.23
Go version: go1.5.4
Git commit: 5604cbe
Built: Wed Apr 27 00:34:20 2016
OS/Arch: linux/amd64
$ docker-compose version
docker-compose version 1.7.0, build 0d7bf73
docker-py version: 1.8.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
And the full error message:
$ docker-compose --verbose run web /bin/bash
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: File doesn't exist
compose.cli.command.get_client: docker-compose version 1.7.0, build 0d7bf73
docker-py version: 1.8.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
compose.cli.command.get_client: Docker base_url: https://192.168.99.100:2376
compose.cli.command.get_client: Docker version: KernelVersion=4.4.8-boot2docker, Os=linux, BuildTime=2016-04-27T00:34:20.887998399+00:00, ApiVersion=1.23, Version=1.11.1, GitCommit=5604cbe, Arch=amd64, GoVersion=go1.5.4
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'theatrescheduler_default')
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose/cli/main.py", line 57, in main
File "compose/cli/main.py", line 108, in perform_command
File "compose/cli/main.py", line 591, in run
File "compose/cli/main.py", line 842, in run_one_off_container
File "compose/project.py", line 369, in up
File "compose/project.py", line 405, in initialize
File "compose/network.py", line 162, in initialize
File "compose/network.py", line 47, in ensure
File "compose/network.py", line 82, in inspect
File "compose/cli/verbose_proxy.py", line 55, in proxy_callable
File "site-packages/docker/utils/decorators.py", line 32, in wrapper
docker.errors.InvalidVersion: inspect_network is not available for version < 1.21
docker-compose returned -1
@mstahl Sorry for the delay. That's very confusing: unless you've explicitly set COMPOSE_API_VERSION, the API version should only be getting set to either 1.21 or 1.22 (here's the relevant bits of code at the exact git revision of Compose you're running: command.py, const.py).
Can you double-check if COMPOSE_API_VERSION is set anywhere in your shell environment?
Hrm this is apparently working for me now. I guess it must've just been homebrew having updated one but not the other. Anyways I can't reproduce this now. Thanks though!
For me, this was because of using "version: '2'"
When I switched to simpler compose format it worked.
Most helpful comment
@mstahl Sorry for the delay. That's very confusing: unless you've explicitly set
COMPOSE_API_VERSION, the API version should only be getting set to either1.21or1.22(here's the relevant bits of code at the exact git revision of Compose you're running: command.py, const.py).Can you double-check if
COMPOSE_API_VERSIONis set anywhere in your shell environment?