docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.44k stars 119 forks source link

Error response from daemon: cannot stop container: es-local: tried to kill container, but did not receive an exit event #6850

Open afraidjpg opened 1 year ago

afraidjpg commented 1 year ago

Expected behavior

stop all container success

Actual behavior

cannot stop them all:

> docker compose down
 ✔ Container redis-local       Removed                                                                                                                                                                                                            0.2s 
 ✔ Container etcdkeeper-local  Removed                                                                                                                                                                                                            0.2s 
 ✔ Container kibana-local      Removed                                                                                                                                                                                                            0.5s 
 ✔ Container php-local         Removed                                                                                                                                                                                                            0.3s 
 ✘ Container mysql-local       Error while Stopping                                                                                                                                                                                              22.1s 
 ✔ Container etcd-local        Removed                                                                                                                                                                                                            0.2s 
 ✘ Container mq-local          Error while Stopping                                                                                                                                                                                              24.1s 
 ✘ Container es-local          Error while Stopping                                                                                                                                                                                              24.0s 
Error response from daemon: cannot stop container: e7643047b4ebd54c9aa1408eb338206202a98c389cfa8298bb7d8b8176431ceb: container e7643047b4eb PID 33127 is zombie and can not be killed. Use the --init option when creating containers to run an init inside the container that forwards signals and reaps processes

> docker compose down
 ✘ Container es-local     Error while Stopping                                                                                                                                                                                                   24.1s 
 ✔ Container mysql-local  Removed                                                                                                                                                                                                                12.1s 
 ✘ Container mq-local     Error while Stopping                                                                                                                                                                                                   24.1s 
Error response from daemon: cannot stop container: 671610ebbddaffc93ef2d2e2765e7e3746ee383390e20d4829bd7fa3b488a916: tried to kill container, but did not receive an exit event

> docker compose down
 ✘ Container mq-local  Error while Stopping                                                                                                                                                                                                      24.1s 
 ✘ Container es-local  Error while Stopping                                                                                                                                                                                                      24.1s 
Error response from daemon: cannot stop container: 671610ebbddaffc93ef2d2e2765e7e3746ee383390e20d4829bd7fa3b488a916: tried to kill container, but did not receive an exit event

> docker compose down
 ✘ Container mq-local  Error while Stopping                                                                                                                                                                                                      24.1s 
 ✘ Container es-local  Error while Stopping                                                                                                                                                                                                      24.1s 
Error response from daemon: cannot stop container: 671610ebbddaffc93ef2d2e2765e7e3746ee383390e20d4829bd7fa3b488a916: tried to kill container, but did not receive an exit event

Tried to stop many times, and finally mq-local and es-local could not be stopped. I can fix it by restart docker, but, I have other containers running. and I don't think this is a good solution

docker-compose.yml :

version: "3"
services:

  mysql-local:
    image: mysql/mysql-server:latest
    command: "--innodb_use_native_aio=0"
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
    ports:
      - "3306:3306"
    volumes:
      - $PWD/mysql/datadir:/var/lib/mysql
      - $PWD/mysql/conf.d:/etc/mysql/conf.d
    networks:
      - net_local
    container_name: mysql-local

  php-local:
    image: local:hyperf. # build from phpswoole/swoole:php8.1-alpine
    restart: always
    ports:
      - "9501-9510:9501-9510"
    volumes:
      - $PWD/../:/var/www
    links:
      - mysql-local
      - mq-local
      - etcd-local
      - es-local
    depends_on:
      - mysql-local
      - mq-local
      - etcd-local
      - es-local
    networks:
      - net_local
    tty: true
    container_name: php-local

  redis-local:
    image: redis:7.0.9
    restart: always
    ports:
      - "6379:6379"
    networks:
      - net_local
    container_name: redis-local

  mq-local:
    image: rabbitmq:management-alpine
    hostname: rabbit
    ports:
      - "5672:5672"
      - "15672:15672"
    environment:
      - RABBITMQ_DEFAULT_USER=root
      - RABBITMQ_DEFAULT_PASS=123456
    volumes:
      - ./rabbitmq/data:/var/lib/rabbitmq
    restart: always
    networks:
      - net_local
    container_name: mq-local

  etcd-local:
    hostname: etcd
    image: bitnami/etcd:latest
    volumes:
      - "./etcd/data:/bitnami/etcd/data"
    environment:
      - ALLOW_NONE_AUTHENTICATION=yes
      - ETCD_ADVERTISE_CLIENT_URLS=http://0.0.0.0:2379
    ports:
      - "2379:2379"
      - "2380:2380"
    networks:
      - net_local
    container_name: etcd-local

  etcdkeeper-local:
    hostname: etcdkeeper
    image: evildecay/etcdkeeper:v0.7.6
    ports:
      - "8099:8080"
    links:
      - etcd-local
    networks:
      - net_local
    container_name: etcdkeeper-local

  es-local:
    image: elasticsearch:8.7.1
    ports:
      - "9200:9200"
      - "9300:9300"
    volumes:
      - ./es/data:/usr/share/elasticsearch/data
      - ./es/log:/usr/share/elasticsearch/logs
      - ./es/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
    environment:
      TZ: Asia/Shanghai
      discovery.type: single-node
      ES_JAVA_OPTS: "-Xms512m -Xmx512m"
      ELASTIC_PASSWORD: "123456"
    networks:
      - net_local
    container_name: es-local

  kibana-local:
    image: kibana:8.7.1
    ports:
      - "5601:5601"
    depends_on:
      - es-local
    links:
      - es-local
    networks:
      - net_local
    container_name: kibana-local

networks:
  net_local:
    driver: bridge

Information

Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check

> /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
[2023-05-22T10:59:54.453948000Z][com.docker.diagnose][I] set path configuration to OnHost
Starting diagnostics

[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0038: is the connection to Docker working?
[FAIL] DD0014: are the backend processes running? 1 error occurred:
    * com.docker.vpnkit is not running

[PASS] DD0007: is the backend responding?
[PASS] DD0008: is the native API responding?
[FAIL] DD0009: is the vpnkit API responding? dial unix vpnkit.diag.sock: connect: connection refused
[PASS] DD0010: is the Docker API proxy responding?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0033: does the host have Internet access?
[PASS] DD0018: does the host support virtualization?
[PASS] DD0001: is the application running?
[WARN] DD0017: can a VM be started? vm has not started: vm has not started
[WARN] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0011: are the LinuxKit services running?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0031: does the Docker API work?
[PASS] DD0032: do Docker networks overlap with host IPs?

Please note the following 2 warnings:

1 : The check: can a VM be started?
    Produced the following warning: vm has not started: vm has not started

The Docker engine runs inside a Linux VM. Therefore we must be able to start Virtual Machines.

2 : The check: is the LinuxKit VM running?
    Produced the following warning: vm is not running: vm has not started

The Docker engine runs inside a Linux VM. Therefore the VM must be running.

Please investigate the following 1 issue:

1 : The test: can a VM be started?
    Failed with: vm has not started: vm has not started

The Docker engine runs inside a Linux VM. Therefore we must be able to start Virtual Machines.

Steps to reproduce the behavior

  1. start by docker compose up -d
  2. wait a long time...(maybe one day, tow days?) or restart kibana-local many times
  3. run docker compose down
ElanUtta commented 1 year ago

I'm getting this same error, but it depends on the container. It just can't stop or be deleted, anything that resolves is to restart the docker, but this occurs every time.

zyxkad commented 1 year ago

I have this issue too, it there a way to actually force kill and remove a container? docker rm --force is not work for me

$ docker rm -f ef21e590981d84c54d3
Error response from daemon: Could not kill running container ef21e590981d84c54d3f3dfc61ca4bc7e43433bf15e888e0ab42f9575088595f, cannot remove - tried to kill container, but did not receive an exit event
jaredcat commented 1 year ago

Yep keeps happening to me out of the blue. Had this compose working for years before.

work00013 commented 9 months ago

I have save problem but in a kubernetes cluster (v1.22 - kubeadm) with docker 20.10.24. Do you find the problem?