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
Bash -C Variable Does Not Get Assigned
Run Shell Command and Don't Wait for Return
Find Command Find Directories That Were Created After a Certain Date Under Linux/Cygwin
Which Capabilities Are Needed for Statx to Stop Giving Eperm
How to Increase the Maximum Number of Characters That Ksh Variable Accepts
Significance of Address 0X8048080
Using Scanf into Global or Local Variables (On the Stack), 32-Bit Calling Convention
Converting a Visual Studio Makefile to a Linux Makefile
How to Draw 2D Diagram in Linux
How to Share a Register Between Threads
How to Read from Text File Line-By-Line and Split the Line by a Character
Shell Script to Delete Files When Disk Is Full
Are the 'Dot' and 'Dot Dot' Files in Unix and Linux Real Files
Shell Script Issue with Filenames Containing Spaces
Grep for String and Open at the Corresponding Line