docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
33.71k stars 5.19k forks source link

docker compose down showing Error while Removing device or resource busy #10607

Open rezwanahmedsami opened 1 year ago

rezwanahmedsami commented 1 year ago

Description

docker compose down showing Error while Removing device or resource busy

Error response from daemon: container 495416062dfa74da85bc221fb6c402a9acde091bbb60871714b72d2461ba8fe2: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/f2de2aafa84d2864edc00259a1c2b9abb8b08764c795b7936ba73732de0a5ec4/merged: device or resource busy

[root@server Rb-ListingsSearchEngine]# lsof /var/lib/docker/overlay2/f2de2aafa84d2864edc00259a1c2b9abb8b08764c795b7936ba73732de0a5ec4/merged
[root@server Rb-ListingsSearchEngine]# docker rm -f rb-listingssearchengine-app-1
Error response from daemon: container 495416062dfa74da85bc221fb6c402a9acde091bbb60871714b72d2461ba8fe2: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/f2de2aafa84d2864edc00259a1c2b9abb8b08764c795b7936ba73732de0a5ec4/merged: device or resource busy```

In my centos 7 server, and it's persistant issue

### Steps To Reproduce

_No response_

### Compose Version

```Text
Docker Compose version v2.18.1

Docker Environment

Client: Docker Engine - Community
 Version:    24.0.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.4
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.18.1
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 2
  Running: 1
  Paused: 0
  Stopped: 1
 Images: 2
 Server Version: 24.0.1
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3dce8eb055cbb6872793272b4f20ed16117344f8
 runc version: v1.1.7-0-g860f061
 init version: de40ad0
 Security Options:
  seccomp
   Profile: builtin
 Kernel Version: 3.10.0-1160.90.1.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.05GiB
 Name: server.rightdev.co.uk
 ID: 76e3bbdc-6b75-4dda-9657-f08b0d7815e5
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

Anything else?

No response

glours commented 1 year ago

Hello @rezwanahmodsami I saw in your logs that you're using docker rm -f rb-listingssearchengine-app-1 to generate the issue, is it because it's produce the same issue as docker compose down? If so you just demonstrate that your issue is on the docker engine side and not directly related to Compose.

Can you give us an example with a compose file and the all the steps to reproduce the issue?

rezwanahmedsami commented 1 year ago

Hello @rezwanahmodsami I saw in your logs that you're using docker rm -f rb-listingssearchengine-app-1 to generate the issue, is it because it's produce the same issue as docker compose down? If so you just demonstrate that your issue is on the docker engine side and not directly related to Compose.

Can you give us an example with a compose file and the all the steps to reproduce the issue?

I done docker compose down

see that:

[+] Running 1/1
 ✘ Container rb-listingssearchengine-app-1  Error while Removing           5.9s
Error response from daemon: container b5c891ee14cfc3a432073791905deb528932a31d6d83359aa4f02497970a5d97: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/96dc905d7868a402bc2d8b1ad74250ceb652f7f1ccfba1db8585d10d2e97e4f1/merged: device or resource busy
[root@server Rb-ListingsSearchEngine]# ls

This is my docker compose yml file:


version: '3'

services:
  app:
    build: .
    restart: always
    ports:
      - "4111:5000"
    volumes:
      - .:/app
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      - FLASK_ENV=production```