Skip to content
Advertisement

Docker overlay2 resource is busy

I need some help with docker! 😀

When I have to deploy my application, sometimes I have this error

Cannot create container for service db: error creating overlay mount to /var/lib/docker/overlay2/<HASH>-init/merged: no such file or directory

OR

container <HASH>: driver "overlay2" failed to remove root filesystem: unlinkat /var/lib/docker/overlay2/<HASH>/merged: device or resource busy

This is my docker info output:

Client:
 Debug Mode: false

Server:
 Containers: 17
  Running: 17
  Paused: 0
  Stopped: 0
 Images: 223
 Server Version: 19.03.5
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 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: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
 runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
 init version: fec3683
 Kernel Version: 3.10.0-1062.el7.x86_64
 Operating System: CentOS Linux 7 (Core)
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.09GiB
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Live Restore Enabled: false

Everytime that the resource is busy error appears, I move the HASH’s directory in /var/lib/docker/(containers OR overlay2) to HASH_old directory and retry to deploy the application, used to work, but now the no such file or directory error always shows up, even after moving all the folders to _old.

Advertisement

Answer

Shutdown the buggy containers and run docker system prune -af, that will remove unused containers and images. After that just try to build and deploy, should work

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement