You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The Sanic server is in most of the attempts not able to start with multiple workers. Seems like the socket is not ready to bind and windows, therefore, throws an exception. This may be different on unix systems.
Code snippet
Sanic Hello World
from sanic import Sanic
from sanic.response import json
app = Sanic()
@app.route("/")
async def test(request):
return json({"hello": "world"})
if __name__ == "__main__":
app.run(host="127.0.0.1", port=8000, workers=2)
Expected behavior
Sanic starts and is ready to serve with multiple workers.
[2019-04-03 10:16:35 +0200] [11836] [ERROR] Unable to start server
Traceback (most recent call last):
File "lib\site-packages\sanic\server.py", line 745, in serve
http_server = loop.run_until_complete(server_coroutine)
File "Python36_64\Lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "Python36_64\Lib\asyncio\base_events.py", line 1065, in create_server
sock.listen(backlog)
OSError: [WinError 10022] An invalid argument was supplied
[2019-04-03 10:16:35 +0200] [4444] [WARNING] Sanic tried to use loop.add_signal_handler but it is not implemented on this platform.
This is a dupe of #1517 - as per the note there, window support is best effort and not guaranteed. While I'm leaving that open for review, I'm closing this one as redundant.
Describe the bug
The Sanic server is in most of the attempts not able to start with multiple workers. Seems like the socket is not ready to bind and windows, therefore, throws an exception. This may be different on unix systems.
Code snippet
Sanic Hello World
Expected behavior
Sanic starts and is ready to serve with multiple workers.
Environment
Additional context
[2019-04-03 10:16:32 +0200] [13992] [INFO] Goin' Fast @ http://127.0.0.1:8005
[2019-04-03 10:16:35 +0200] [11836] [ERROR] Unable to start server
Traceback (most recent call last):
File "lib\site-packages\sanic\server.py", line 745, in serve
http_server = loop.run_until_complete(server_coroutine)
File "Python36_64\Lib\asyncio\base_events.py", line 468, in run_until_complete
return future.result()
File "Python36_64\Lib\asyncio\base_events.py", line 1065, in create_server
sock.listen(backlog)
OSError: [WinError 10022] An invalid argument was supplied
[2019-04-03 10:16:35 +0200] [4444] [WARNING] Sanic tried to use loop.add_signal_handler but it is not implemented on this platform.
[2019-04-03 10:16:35 +0200] [4444] [INFO] Starting worker [4444]
The text was updated successfully, but these errors were encountered: