-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run uvicorn with multiple workers on Windows - WinError 87 #342
Comments
You'll need to run |
@tomchristie This results in another exception. Code snippet main.py
Executed command
Traceback
|
Can any windows users confirm if this issue is reproducible? |
@tomchristie still same issue. Stacktrace:
Uvicorn: 0.8.3 |
I can confirm this is also happening to me, Windows 10 Pro. |
Same error here. |
Is there a workaround for this? Gunicorn is not supported on windows at all.
|
Same issue for me also. |
Hi @tomchristie, I've also come across this in Hypercorn. I think pgjones/hypercorn@146e095 is a fix, but I've limited understanding and ability to test Windows systems. |
i updated to uvicorn==0.10.4 and still havin this issue
also tried from the command line i'm doing something wrong?
|
Still getting this same issue. Can somebody please help me: |
@AadiMehta
i'm using uvicorn 0.10.8 |
@ghostzero192
You can check in the subsequent messages, that only one worker process is spawned. @tomchristie Can you please help us with the solution or workaround to this issue? |
@tomchristie Can you please provide an update? |
Duplicated on #514 too. Would you mind checking out that issue - I’ve put some pointers on my latest comment there. Thanks. |
Hi @tomchristie thanks for your work on this server. However this error is still present on windows. Can you please provide an update when you are able to nail down the error when launching multiple workers on Windows10. Thanks I don't think this issue is closed. I would appreciate if you coul look into it and comment on it! many thanks! |
I think its a problem with the uvloop itslef. resources i found: |
Believe this to finally be fully resolved in 0.11.0 |
uvicorn 0.11.6 |
uvicorn 0.11.8 still see this issue. If this is a matter of uvloop/asncio not support lifespan on windows then |
@tomchristie This issue needs to be reopened. Tested Running uvicorn from command line Accept failed on a socket
socket: <asyncio.TransportSocket fd=824, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)>
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 834, in loop
f = self._proactor.accept(sock)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 549, in accept
self._register_with_iocp(listener)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 718, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 87] The parameter is incorrect
Accept failed on a socket
socket: <asyncio.TransportSocket fd=856, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 8000)>
Traceback (most recent call last):
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 834, in loop
f = self._proactor.accept(sock)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 549, in accept
self._register_with_iocp(listener)
File "C:\Users\username\AppData\Local\Programs\Python\Python39\lib\asyncio\windows_events.py", line 718, in _register_with_iocp
_overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
OSError: [WinError 87] The parameter is incorrect |
Anyone in @encode/maintainers with a Windows setup able to confirm if there's an action needed here? |
In my Windows10, I got it.
|
Has this issue been resolved? I'm experiencing the same issue here.
|
The same issue with Python 3.9.10 and uvicorn 0.17.6. |
same issue here, when increase number of workers |
Im also facing the same issue with uvicorn 0.17.6 |
It turns out that everyone has the same problem. I temporarily blocked this problem by changing the number of workers running on Windows to 1. Because it will eventually run on linux, windows is only for development. But I also hope to solve this problem |
same problem |
Getting same issue. Please can you help on this @pgjones @tomchristie .it will help for all people. |
Does this error also occur if you use Hypercorn with a number of workers? |
No, it doesn't. See #342 (comment). |
I believe the issue is related to the Python sockets lib on Windows. Windows effectively deadlocks a port during Python's initial socket configuration. So if you have multiple python threads or interpreters attempting to start listening to a socket at once, you'll get a The consensus seems to be to use |
same issue here |
same problem |
Does this still happens on uvicorn 0.18.2? #1454 was merged some time ago. |
Upgrading Uvicorn to "0.18.1" solved for me! |
Thanks @satish678 :) |
Describe the bug
Uvicorn doesn't seem to be able to start with multiple workers.
Code snippet
Starlette Hello World
Expected behavior
Uvicorn starts and is ready to serve with multiple workers.
Environment
Windows 10
Uvicorn: 0.6.1
Python: 3.7.2
Starlette: 0.11.4
Additional context
The text was updated successfully, but these errors were encountered: