Docker Overlay2: Error Walking File System: Oserror [Errno 40] Too Many Levels of Symbolic Links

Docker overlay2: error walking file system: OSError [Errno 40] Too many levels of symbolic links

UPDATE #5

Found the cause: lib uvicorn[standard] is the cythonized version of itself. Once I removed it all errors were gone. So I'll move this to uvicorn's github.

@jordanvrtanoski Thank you once again for your help!

Python, Starlette & Docker error walking file system: OSError [Errno 40] Too many levels of symbolic links:

The /dev/fd is special pseudo-device filesystem that is showing the VFS handles or simply said the open files of the PID that is examining the device. Trough a coincidence of the build and the running processes in the container, your image has a link to the /dev/fd the same /dev/fd that it's trying to read.

However, this it's not unusual to end in loops if you follow symbolink links on the pseudo-devices, so when using find -L as a super user you should exclude the /dev, /sys and /proc when searching and following links with -xdev

use

find -L ./ -xdev -mindepth 15

why /var/lib/docker/overlay2 grows too large and restart solved it

If the docker filesystem is growing, that often indicates container logs, or filesystem changes in the container. Logs you can see with docker logs and filesystem changes are shown with docker diff. Since you see a large diff folder, it's going to be the latter.

Those filesystem changes will survive a restart of the container, they get cleaned when the container is removed and replaced with a new container. So if restarting the container resolves it, my suspicion is your application is deleting the files on disk, but still has the file handles open to the kernel, possibly still writing to those file handles.

The other option is the stop or start of your application is deleting the files.



Related Topics



Leave a reply



Submit