Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 346
Alex Poloz Avatar asked Mar 20 '21 16:03

Alex Poloz


1 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
like image 114
jmunsch Avatar answered Oct 23 '22 05:10

jmunsch