Hi , I’m new to Render , and I hosted a simple chat room server by flask on Render , I used these modules:
1-flask socket io
2-flask
2-gunicorn
The server script on render always get error from gunicorn , I do not know why , and this is the error which I get every ten seconds :
Traceback (most recent call last):
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py”, line 134, in handle
Mar 5 05:55:33 PM self.handle_request(listener, req, client, addr)
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/workers/sync.py”, line 177, in handle_request
Mar 5 05:55:33 PM respiter = self.wsgi(environ, resp.start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/flask/app.py”, line 1536, in call
Mar 5 05:55:33 PM return self.wsgi_app(environ, start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/flask_socketio/init.py”, line 42, in call
Mar 5 05:55:33 PM return super().call(environ, start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/middleware.py”, line 63, in call
Mar 5 05:55:33 PM return self.engineio_app.handle_request(environ, start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/socketio/server.py”, line 434, in handle_request
Mar 5 05:55:33 PM return self.eio.handle_request(environ, start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/server.py”, line 286, in handle_request
Mar 5 05:55:33 PM packets = socket.handle_get_request(
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/socket.py”, line 92, in handle_get_request
Mar 5 05:55:33 PM return getattr(self, ‘upgrade’ + transport)(environ,
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/socket.py”, line 151, in _upgrade_websocket
Mar 5 05:55:33 PM return ws(environ, start_response)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/async_drivers/_websocket_wsgi.py”, line 15, in call
Mar 5 05:55:33 PM ret = self.app(self)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/socket.py”, line 225, in _websocket_handler
Mar 5 05:55:33 PM p = websocket_wait()
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/socket.py”, line 156, in websocket_wait
Mar 5 05:55:33 PM data = ws.wait()
Mar 5 05:55:33 PM ^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/engineio/async_drivers/_websocket_wsgi.py”, line 32, in wait
Mar 5 05:55:33 PM return self.ws.receive()
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/simple_websocket/ws.py”, line 96, in receive
Mar 5 05:55:33 PM if not self.event.wait(timeout=timeout):
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/usr/local/lib/python3.11/threading.py”, line 629, in wait
Mar 5 05:55:33 PM signaled = self._cond.wait(timeout)
Mar 5 05:55:33 PM ^^^^^^^^^^^^^^^^^^^^^^^^
Mar 5 05:55:33 PM File “/usr/local/lib/python3.11/threading.py”, line 327, in wait
Mar 5 05:55:33 PM waiter.acquire()
Mar 5 05:55:33 PM File “/opt/render/project/src/.venv/lib/python3.11/site-packages/gunicorn/workers/base.py”, line 204, in handle_abort
Mar 5 05:55:33 PM sys.exit(1)
However I can connect to the server websocket which run on Render , but it reconnect every 10 seconds , also I can not make second connection on websocket, when I connect to websocket , my firend can not connect to it and he get timeout error !!
what should I do ?
Can you please hep me ?