Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readmode pipes not supported In the default daemon configuration on Windows #383

Closed
jonaslewin opened this issue Jan 20, 2019 · 7 comments · Fixed by #384
Closed

readmode pipes not supported In the default daemon configuration on Windows #383

jonaslewin opened this issue Jan 20, 2019 · 7 comments · Fixed by #384

Comments

@jonaslewin
Copy link

Hello Stefan.
Thank you very much for your examples with docker and traefik.

I downloaded your repository, and copied the traefik folder.
On the Windows 10 (18.09) I did not change any files but just ran
docker-compose up -d

docker logs traefik_traefik_1
shows the following:
level=error msg="Failed to retrieve information of the docker client and server host: error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running."

docker ps shows all 3 containers running

3c27ed988f92        stefanscherer/whoami            "\\http.exe"             31 minutes ago      Up 31 minutes       8080/tcp                                                           traefik_whoami2_1
92b31cbae0ca        stefanscherer/traefik-windows   "/traefik --configfi…"   31 minutes ago      Up 31 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:8080->8080/tcp   traefik_traefik_1
fbf4d98a4c7d        stefanscherer/whoami            "\\http.exe"             31 minutes ago      Up 31 minutes       8080/tcp                                                           traefik_whoami1_1

docker version shows

Client: Docker Engine - Community
 Version:           18.09.1
 API version:       1.39
 Go version:        go1.10.6
 Git commit:        4c52b90
 Built:             Wed Jan  9 19:34:26 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.1
  API version:      1.39 (minimum version 1.24)
  Go version:       go1.10.6
  Git commit:       4c52b90
  Built:            Wed Jan  9 19:50:10 2019
  OS/Arch:          windows/amd64
  Experimental:     false

and the version of Docker Desktop I am running is 2.0.0.2 from the stable channel.

Do you have any suggestions on what I need to change? Do I need to change anything inside the traefik container, or somehow allow named pipes on the host? I'm lost here and would very much appreciate your help.

@StefanScherer
Copy link
Owner

StefanScherer commented Jan 20, 2019

Hello @jonaslewin
I can reproduce the problem on Windows 10 1809 with Docker-Desktop 2.0.0.2.

When I use a Windows Server 2019 with Docker-Desktop 2.0.0.2 it works fine.

Here is traefik's log of the container running on Windows 10 1809:

time="2019-01-20T19:52:41Z" level=error msg="Failed to retrieve information of the docker client and server host: error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running."
time="2019-01-20T19:52:41Z" level=error msg="Provider connection error Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version: open //./pipe/docker_engine: message readmode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).doRequest
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:182
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).sendRequest
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:122
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).get
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:37
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).ServerVersion
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/version.go:12
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1.1
  /go/src/github.com/containous/traefik/provider/docker/docker.go:137
github.com/containous/traefik/safe.OperationWithRecover.func1
  /go/src/github.com/containous/traefik/safe/routine.go:160
github.com/containous/traefik/vendor/github.com/cenk/backoff.RetryNotify
  /go/src/github.com/containous/traefik/vendor/github.com/cenk/backoff/retry.go:37
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1
  /go/src/github.com/containous/traefik/provider/docker/docker.go:252
github.com/containous/traefik/safe.(*Pool).GoCtx.func1
  /go/src/github.com/containous/traefik/safe/routine.go:62
github.com/containous/traefik/safe.GoWithRecover.func1
  /go/src/github.com/containous/traefik/safe/routine.go:142
runtime.goexit
  /usr/local/go/src/runtime/asm_amd64.s:1333
error during connect
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).doRequest
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:185
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).sendRequest
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:122
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).get
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/request.go:37
github.com/containous/traefik/vendor/github.com/docker/docker/client.(*Client).ServerVersion
  /go/src/github.com/containous/traefik/vendor/github.com/docker/docker/client/version.go:12
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1.1
  /go/src/github.com/containous/traefik/provider/docker/docker.go:137
github.com/containous/traefik/safe.OperationWithRecover.func1
  /go/src/github.com/containous/traefik/safe/routine.go:160
github.com/containous/traefik/vendor/github.com/cenk/backoff.RetryNotify
  /go/src/github.com/containous/traefik/vendor/github.com/cenk/backoff/retry.go:37
github.com/containous/traefik/provider/docker.(*Provider).Provide.func1
  /go/src/github.com/containous/traefik/provider/docker/docker.go:252
github.com/containous/traefik/safe.(*Pool).GoCtx.func1
  /go/src/github.com/containous/traefik/safe/routine.go:62
github.com/containous/traefik/safe.GoWithRecover.func1
  /go/src/github.com/containous/traefik/safe/routine.go:142
runtime.goexit
  /usr/local/go/src/runtime/asm_amd64.s:1333, retrying in 10.780695475s"

I have stopped the traefik container, tested with the stefanscherer/docker-cli-windows container which works fine on both Windows 10 and Windows Server 2019. Then I copied the docker.exe from this container into the stopped traefik container. Afterwards I've started the traefik container again.

I see the same error messages from traefik in the started container. But when I exec into the container and run docker.exe version in it the Docker CLI communicates with the Windows Docker engine on the Windows 10 host without a problem.

It seems to me a problem in traefik.exe itself as the docker.exe can communicate over the mapped named pipe.

@StefanScherer
Copy link
Owner

OK, it has something to do with the isolation mode of the traefik container. When I add

   isolation: hyperv

to the docker-compose.yml to run the traefik container in hyperv isolation on the Windows Server 2019 machine I can reproduce the error message there as well.

But a Docker CLI 18.09.0 works inside that container.

I've seen that the vendoring of github.com/docker/docker is a little bit outdated, about a year ago was the last update.

I've tried an older Docker CLI in the traefik container and I can reproduce the error with that old CLI

C:\>docker.exe version
Client:
 Version:      17.10.0-ce
 API version:  1.33
 Go version:   go1.8.3
 Git commit:   f4ffd25
 Built:        Tue Oct 17 19:00:02 2017
 OS/Arch:      windows/amd64
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.33/version: open //./pipe/docker_engine: message read
mode pipes not supported In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

So it's a problem in the traefik.exe caused by older Golang libraries running in hyperv isolation.

A workaround is to add isolation: process to the docker-compose.yml:

version: '2.4'
services:
  traefik:
    image: stefanscherer/traefik-windows
    command: --docker.endpoint=npipe:////./pipe/docker_engine --logLevel=DEBUG
    ports:
      - "8080:8080"
      - "443:443"
      - "80:80"
    isolation: hyperv
    volumes:
      - .:C:/etc/traefik
      - type: npipe
        source: \\.\pipe\docker_engine
        target: \\.\pipe\docker_engine

Then it also works on Windows 10 1809 as you can start using process isolation with Docker-Desktop 2.0.0.2.

@StefanScherer
Copy link
Owner

I've created traefik/traefik#4409 to report it in traefik repo.

@StefanScherer
Copy link
Owner

@jonaslewin use the updated docker-compose.yml which sets isolation: process to run traefik in process isolation. This also works on Windows 10 1809.

@jonaslewin
Copy link
Author

Thank you so much for your help. It works great.

According to the documentation https://docs.docker.com/engine/reference/commandline/run/#specify-isolation-technology-for-container---isolation it says:

The default (and only supported) isolation on Windows client operating systems is hyperv. An attempt to start a container on a client operating system with --isolation process will fail.

But as I just saw on my system - it works just fine with isolation set to process.

@StefanScherer
Copy link
Owner

Haha, yes it works with the latest versions, see https://stefanscherer.github.io/how-to-run-lightweight-windows-containers-on-windows-10/

@StefanScherer
Copy link
Owner

I've sent a PR to update the Docker CLI docs docker/cli#1627

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants