FastAPI How to fix error walking file system: OSError [Errno 40] Too many levels of symbolic links: '/sys/class/vtconsole/vtcon0/subsystem?

Viewed 2184

I have FastAPI (Python) with uvicorn[standard]. And I have this error:

error walking file system: OSError [Errno 40] Too many levels of symbolic links: '/sys/class/vtconsole/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0/subsystem/vtcon0'

If I use just uvicorn, everything is okay, but I need uvicorn[standard]. How to fix it?

I use it in Docker.

2 Answers

I had a similar error.

error walking file system: FileNotFoundError

I added the --reload-dir as suggested by @amoskaliov

Updated my docker-entrypont.sh to:

/wait && uvicorn pm.asgi:application --host 0.0.0.0 --port 8000  \
--reload \
--reload-dir ./dir1 \
--reload-dir ./dir2 \
--reload-dir ./dir3

You can add the following to your Dockerfile:

RUN pip install uvicorn -y
RUN pip install uvicorn[standard]
Related