Error with the reloader #7840
Replies: 5 comments
-
I believe this is an issue with uvicorn on Windows. I think if you use the asyncio event loop the issue goes away. I can’t easily look for them now but I recall one or two recent issues where this was raised and solved. @euri10 might know more? |
Beta Was this translation helpful? Give feedback.
-
Yep it's encode/uvicorn#509
Le mer. 4 déc. 2019 à 3:35 AM, dmontagu <notifications@github.com> a écrit :
… I believe this is an issue with uvicorn on Windows. I think if you use the
asyncio event loop the issue goes away. I can’t easily look for them now
but I recall one or two recent issues where this was raised and solved.
@euri10 <https://github.com/euri10> might know more?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#767?email_source=notifications&email_token=AAINSPSJHROB5UMSXWMFA3TQW4JQBA5CNFSM4JU7VFM2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF3QOWQ#issuecomment-561448794>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAINSPVW53S7ZTH2MTAZSALQW4JQBANCNFSM4JU7VFMQ>
.
|
Beta Was this translation helpful? Give feedback.
-
I encountered this issue too. I turned to use docker and it won't bother. Here's what I found, hope it helps: use tiangolo/uvicorn-gunicorn and use set volume in the docker-compose.yml
|
Beta Was this translation helpful? Give feedback.
-
It seems this should be solved in recent versions of Uvicorn. Did you solve your problem @WassimBenzarti ? |
Beta Was this translation helpful? Give feedback.
-
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues. |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Whenever I do
Then change the file index, I get an error like this
To Reproduce
uvicorn api.index:app --reload
./
.Expected behavior
Reload the application, and continue to work as normal.
Environment
python -c "import fastapi; print(fastapi.__version__)" email-validator not installed, email fields will be treated as str. To install, run: pip install email-validator 0.44.0
Logs
uvicorn index:app --reload
?[32mINFO?[0m: Uvicorn running on ?[1mhttp://127.0.0.1:8000?[0m (Press CTRL+C to quit)
?[32mINFO?[0m: Started reloader process [?[36m?[1m1232?[0m]
?[33mWARNING?[0m: email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
?[32mINFO?[0m: Started server process [?[36m13256?[0m]
?[32mINFO?[0m: Waiting for application startup.
?[32mINFO?[0m: Application startup complete.
?[33mWARNING?[0m: Detected file change in 'index.py'. Reloading...
?[33mWARNING?[0m: email-validator not installed, email fields will be treated as str.
To install, run: pip install email-validator
?[32mINFO?[0m: Started server process [?[36m1064?[0m]
?[31mERROR?[0m: Accept failed on a socket
socket: <asyncio.TransportSocket fd=592, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)>
Traceback (most recent call last):
File "C:\Users\wass1\AppData\Local\Programs\Python\Python38\Lib\asyncio\proactor_events.py", line 817, in loop
f = self._proactor.accept(sock)
File "C:\Users\wass1\AppData\Local\Programs\Python\Python38\Lib\asyncio\windows_events.py", line 545, in accept
self._register_with_iocp(listener)
File "C:\Users\wass1\AppData\Local\Programs\Python\Python38\Lib\asyncio\windows_events.py", line 714, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 87] The parameter is incorrect
?[32mINFO?[0m: Waiting for application startup.
?[32mINFO?[0m: Application startup complete.
Beta Was this translation helpful? Give feedback.
All reactions