ERROR: client version 1.22 is too old #4106

Open
PatrickLang opened this Issue Nov 3, 2016 · 15 comments

Projects

None yet

7 participants

@PatrickLang

I'm trying to run https://github.com/docker/labs/blob/master/windows/windows-containers/MultiContainerApp.md using Docker-Compose with named pipes. It's failing with an error about client API version:

PS C:\Source\Musicstore> docker-compose -f .\docker-compose.windows.yml up
ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client to a newer version
PS C:\Source\Musicstore> docker-compose -f .\docker-compose.windows.yml ps
ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client to a newer version

Here's what I have installed:

docker-compose version

docker-compose version 1.9.0-rc2, build d41f869
docker-py version: 1.10.5
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016

docker version:

Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   877c860
 Built:        Thu Nov  3 04:06:20 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   877c860
 Built:        Thu Nov  3 04:06:20 2016
 OS/Arch:      windows/amd64
 Experimental: false
@nicholasdille

I am seeing the same issue then running docker-compose up on Windows Server 2016 RTM against a remote Windows Server 2016 RTM:
echo $env:DOCKER_HOST:

tcp://10.0.0.201:2375

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

docker version:

Client:
 Version:      1.12.2-cs2-ws-beta
 API version:  1.25
 Go version:   go1.7.1
 Git commit:   050b611
 Built:        Tue Oct 11 02:35:40 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   81683e8
 Built:        Thu Nov  3 15:40:00 2016
 OS/Arch:      windows/amd64
@shin-
Member
shin- commented Nov 3, 2016

The Engine shouldn't refuse older clients. This is a wontfix as far as Compose is concerned - implications of changing the API version are too great.

@nicholasdille

Isn't the message related to docker-py 1.10.5 which implements API version 1.22? Is it possible to update docker-py independently of docker-compose on Windows? Feels like I am missing something here ;-)

@PatrickLang PatrickLang referenced this issue in docker/docker Nov 5, 2016
Merged

Windows: Allow API v1.24 #28072

@PatrickLang
PatrickLang commented Nov 5, 2016 edited

Ok, I picked up builds of Docker/DockerD that have docker/docker#28072 fixed.

Based on the discussion there - I think that I should still be getting ERROR: client version 1.22 is too old. Minimum supported API version is 1.25, please upgrade your client because the docker-compose file has version: '2'. Instead, I get this:

PS C:\Users\Patrick\Source\Repos\MusicStore> docker-compose -f .\docker-compose.windows.yml build
db uses an image, skipping
Building web
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 65, in main
  File "compose\cli\main.py", line 117, in perform_command
  File "compose\cli\main.py", line 223, in build
  File "compose\project.py", line 300, in build
  File "compose\service.py", line 741, in build
  File "site-packages\docker\api\build.py", line 105, in build
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\client.py", line 135, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1057, in request
  File "httplib.py", line 1097, in _send_request
  File "httplib.py", line 1053, in endheaders
  File "httplib.py", line 901, in _send_output
  File "httplib.py", line 870, in send
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 158, in sendall
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 153, in send
pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')
docker-compose returned -1

Why aren't I getting the right error?

If I change it to version: '2.1', then it works as expected.

For reference, here's the versions I'm using now:

PS C:\Users\Patrick\Source\Repos\MusicStore> docker-compose version
docker-compose version 1.9.0dev, build 9046e33
docker-py version: 1.10.6
CPython version: 2.7.12
OpenSSL version: OpenSSL 1.0.2h  3 May 2016
PS C:\Users\Patrick\Source\Repos\MusicStore> docker version
Client:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   c5ceb0f
 Built:        Sat Nov  5 03:24:43 2016
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.0-dev
 API version:  1.25
 Go version:   go1.7.3
 Git commit:   c5ceb0f
 Built:        Sat Nov  5 03:24:43 2016
 OS/Arch:      windows/amd64
 Experimental: false
@PatrickLang PatrickLang referenced this issue in friism/MusicStore Nov 5, 2016
Merged

Updating docker-compose.yml version to 2.1 #3

@shin-
Member
shin- commented Nov 7, 2016

@PatrickLang It's possible build behaves a bit differently than other commands. Do you see the same issue with up or ps?

@shin-
Member
shin- commented Nov 7, 2016

FWIW, I get the same type of error on Linux if I try to build with a version < 1.12

$ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import docker
>>> c = docker.Client(version='1.11')
>>> c.build('.')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/docker_py-1.10.6-py2.7.egg/docker/api/build.py", line 105, in build
    timeout=timeout,
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/docker_py-1.10.6-py2.7.egg/docker/utils/decorators.py", line 47, in inner
    return f(self, *args, **kwargs)
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/docker_py-1.10.6-py2.7.egg/docker/client.py", line 135, in _post
    return self.post(url, **self._set_request_timeout(kwargs))
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/requests/sessions.py", line 508, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/home/joffrey/.envs/compose/local/lib/python2.7/site-packages/requests/adapters.py", line 415, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(104, 'Connection reset by peer'))
@nerumo
nerumo commented Dec 5, 2016

I'm getting the same issue with

Client:
Version: 1.13.0-rc2
API version: 1.25
Go version: go1.7.3
Git commit: 1f9b3ef
Built: Wed Nov 23 17:40:58 2016
OS/Arch: windows/amd64

Server:
Version: 1.13.0-rc2
API version: 1.25
Minimum API version: 1.24
Go version: go1.7.3
Git commit: 1f9b3ef
Built: Wed Nov 23 17:40:58 2016
OS/Arch: windows/amd64
Experimental: false

@nerumo
nerumo commented Dec 8, 2016

Nevermind my comment, after setting version to 2.1 it worked. But the error message could be a bit more specific

@adamtuliper

FYI - tried 2.1 and it fixed the issue for me. Thanks :)

@PatrickLang
PatrickLang commented Dec 9, 2016 edited

I still get the error trying to build a docker-compose.yml with version: "2.0" using Docker version v1.13-rc3 too.

@shin-
Member
shin- commented Dec 9, 2016

@PatrickLang Yes - you have to use 2.1 on Windows.

@PatrickLang

@shin- should we close this issue? I think we should still fix the error message to say "Windows requires version 2.1 or greater" instead of

PS C:\Users\Patrick\Source\Repos\MusicStore> docker-compose -f .\docker-compose.windows.yml build
db uses an image, skipping
Building web
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 65, in main
  File "compose\cli\main.py", line 117, in perform_command
  File "compose\cli\main.py", line 223, in build
  File "compose\project.py", line 300, in build
  File "compose\service.py", line 741, in build
  File "site-packages\docker\api\build.py", line 105, in build
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\client.py", line 135, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1057, in request
  File "httplib.py", line 1097, in _send_request
  File "httplib.py", line 1053, in endheaders
  File "httplib.py", line 901, in _send_output
  File "httplib.py", line 870, in send
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 158, in sendall
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 153, in send
pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')
docker-compose returned -1

Should I file a separate issue for that and close this one?

@shin-
Member
shin- commented Dec 9, 2016

pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')

That's an engine issue - the connection shouldn't be closed like this. It's a problem on Linux too as I mentioned here: #4106 (comment)

We can look into adding Windows checks with a distinct error message, but we have to differentiate Windows Engine from "Docker For Windows"

@reduardo7

Maybe related with: #268

Try to change version: "2" to "version: "2.1" in you docker-compose.yml file.

@prochnowc

@shin- I still get the error when running docker-compose on docker for windows.

version: '2.1'

PS C:\> docker-compose version
docker-compose version 1.11.1, build 7afaa436
docker-py version: 2.0.2
CPython version: 2.7.13
OpenSSL version: OpenSSL 1.0.2j  26 Sep 2016
PS C:\dev\Source\DevTools\Docker> docker version
Client:
 Version:      1.13.1
 API version:  1.26
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      windows/amd64

Server:
 Version:      1.13.1
 API version:  1.26 (minimum version 1.24)
 Go version:   go1.7.5
 Git commit:   092cba3
 Built:        Wed Feb  8 08:47:51 2017
 OS/Arch:      windows/amd64
 Experimental: true
PS C:\dev\Source\DevTools\Docker> docker-compose -f .\docker-compose.windows.yml build
consul uses an image, skipping
sql uses an image, skipping
Building audittrail
Traceback (most recent call last):
  File "docker-compose", line 3, in <module>
  File "compose\cli\main.py", line 88, in main
  File "compose\cli\main.py", line 140, in perform_command
  File "compose\cli\main.py", line 247, in build
  File "compose\project.py", line 313, in build
  File "compose\service.py", line 804, in build
  File "site-packages\docker\api\build.py", line 205, in build
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\api\client.py", line 175, in _post
  File "site-packages\requests\sessions.py", line 522, in post
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1042, in request
  File "httplib.py", line 1082, in _send_request
  File "httplib.py", line 1038, in endheaders
  File "httplib.py", line 886, in _send_output
  File "httplib.py", line 855, in send
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 159, in sendall
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 154, in send
pywintypes.error: (232, 'WriteFile', 'The pipe is being closed.')
Failed to execute script docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment