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

Docker compose healthcheck on lcow #6445

Closed
dmitriykanarskiy opened this issue Jan 8, 2019 · 6 comments · Fixed by moby/moby#39389
Closed

Docker compose healthcheck on lcow #6445

dmitriykanarskiy opened this issue Jan 8, 2019 · 6 comments · Fixed by moby/moby#39389

Comments

@dmitriykanarskiy
Copy link

Docker compose can't execute container healthcheck when running windows docker engine with lcow enabled

It seams that healthcheck test command completely ignores platform option from service configuration, no matter, the command syntax you use.

Output of docker-compose version

docker-compose version 1.23.2, build 1110ad01
docker-py version: 3.6.0
CPython version: 3.6.6
OpenSSL version: OpenSSL 1.0.2o  27 Mar 2018

Output of docker version

Client:
 Version:       0.0.0-dev
 API version:   1.37
 Go version:    go1.9.4
 Git commit:    c3991d06
 Built: Sun Mar 25 23:30:16 2018
 OS/Arch:       windows/amd64
 Experimental:  false
 Orchestrator:  swarm

Server:
 Engine:
  Version:      master-dockerproject-2018-07-01
  API version:  1.38 (minimum version 1.24)
  Go version:   go1.10.3
  Git commit:   8d1b280
  Built:        Mon Jul  2 00:00:39 2018
  OS/Arch:      windows/amd64
  Experimental: true

Output of docker-compose config
(Make sure to add the relevant -f and other flags)

networks:
  nat_network:
    driver: nat
services:
  zookeeper:
    environment:
      ZOOKEEPER_CLIENT_PORT: '2181'
      ZOOKEEPER_SERVER_ID: '1'
      ZOOKEEPER_SYNC_LIMIT: '2'
      ZOOKEEPER_TICK_TIME: '2000'
      ZOO_MAX_CLIENT_CNXNS: '3000'
    healthcheck:
      interval: 10s
      retries: 5
      test:
      - CMD-SHELL
      - -c
      - echo ruok | nc -w 2 -q 2 localhost 2181 | grep imok
      timeout: 5s
    hostname: zookeeper
    image: confluentinc/cp-zookeeper:3.2.4
    networks:
      nat_network: null
    platform: linux
    ports:
    - 2181/tcp
version: '2.4'

Observed result

Healthcheck fails

Expected result

Healthcheck passes

Stacktrace / full error message

{"Start":"2019-01-08T07:01:05.9826339-08:00","End":"2019-01-08T07:01:06.4507418-08:00","ExitCode":-1,"Output":"container 508c83343e5acd662ba5ad494a6cf39f376859fc3a0d0b02a091a88c8f1c3c7a encountered an error during CreateProcess: failure in a Windows system call: Unspecified error (0x80004005) extra info: {\"CommandArgs\":[\"cmd\",\"/S\",\"/C\",\"-c\",\"echo ruok | nc -w 2 -q 2 localhost 2181 | grep imok\"],\"WorkingDirectory\":\"/\",\"Environment\":{\"APT_ALLOW_UNAUTHENTICATED\":\"false\",\"COMPONENT\":\"zookeeper\",\"CONFLUENT_DEB_VERSION\":\"1\",\"CONFLUENT_MAJOR_VERSION\":\"3\",\"CONFLUENT_MINOR_VERSION\":\"2\",\"CONFLUENT_PATCH_VERSION\":\"1\",\"CONFLUENT_VERSION\":\"3.2.1\",\"HOSTNAME\":\"zookeeper\",\"KAFKA_VERSION\":\"0.10.2.2\",\"LANG\":\"C.UTF-8\",\"PATH\":\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\",\"PYTHON_PIP_VERSION\":\"8.1.2\",\"PYTHON_VERSION\":\"2.7.9-1\",\"SCALA_VERSION\":\"2.11\",\"ZOOKEEPER_CLIENT_PORT\":\"2181\",\"ZOOKEEPER_SERVER_ID\":\"1\",\"ZOOKEEPER_SYNC_LIMIT\":\"2\",\"ZOOKEEPER_TICK_TIME\":\"2000\",\"ZOO_MAX_CLIENT_CNXNS\":\"3000\",\"ZULU_OPENJDK_VERSION\":\"8=8.17.0.3\"},\"CreateStdInPipe\":true,\"CreateStdOutPipe\":true,\"CreateStdErrPipe\":true,\"ConsoleSize\":[0,0]}"}

Additional information

Windows Server Datacenter 6.3, Server Core, Build 1709

@shin-
Copy link

shin- commented Jan 8, 2019

I believe this is an engine issue.

cc @thaJeztah Looks like this doesn't account for possible LCOW setups.

@dmitriykanarskiy
Copy link
Author

@shin Thank you. I kind of thought this might be an engine issue.

@jwardle
Copy link

jwardle commented Jun 19, 2019

+1, unfortunately still encountering this issue on Docker 18.09.6 Win 2019 Server with latest LCOW kernel

thaJeztah added a commit to thaJeztah/docker that referenced this issue Jun 21, 2019
As reported in docker/compose#6445, when deploying a Linux
container on Windows (LCOW), the daemon made the wrong assumption
when deciding which shell to use to execute the healthcheck, looking
at the host's platform instead of the container's platform.

This patch adds a check for the container's platform when deploying
on Windows, and sets the correct shell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
Copy link
Member

Opened moby/moby#39389, which I think should fix this

docker-jenkins pushed a commit to docker/docker-ce that referenced this issue Jul 6, 2019
As reported in docker/compose#6445, when deploying a Linux
container on Windows (LCOW), the daemon made the wrong assumption
when deciding which shell to use to execute the healthcheck, looking
at the host's platform instead of the container's platform.

This patch adds a check for the container's platform when deploying
on Windows, and sets the correct shell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 3e6a13ccb8ec1395d46925bc4c075cb32cf395a6
Component: engine
burnMyDread pushed a commit to burnMyDread/moby that referenced this issue Oct 21, 2019
As reported in docker/compose#6445, when deploying a Linux
container on Windows (LCOW), the daemon made the wrong assumption
when deciding which shell to use to execute the healthcheck, looking
at the host's platform instead of the container's platform.

This patch adds a check for the container's platform when deploying
on Windows, and sets the correct shell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: zach <Zachary.Joyner@linux.com>
@stale
Copy link

stale bot commented Dec 18, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 18, 2019
@stale
Copy link

stale bot commented Dec 25, 2019

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Dec 25, 2019
thaJeztah added a commit to thaJeztah/docker that referenced this issue Feb 22, 2020
As reported in docker/compose#6445, when deploying a Linux
container on Windows (LCOW), the daemon made the wrong assumption
when deciding which shell to use to execute the healthcheck, looking
at the host's platform instead of the container's platform.

This patch adds a check for the container's platform when deploying
on Windows, and sets the correct shell.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3e6a13c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants