Closed dhowe closed 1 year ago
The link that you included in your question explains this.
The simplest deployment strategy is to start the web server by calling socketio.run(app) as shown in examples above. This will look through the packages that are installed for the best available web server start the application on it. The current web server choices that are evaluated are eventlet, gevent and the Flask development server.
Do you see? You are running gevent as web server instead of letting Flask-SocketIO pick the best choice. But then you aren't explicitly telling Flask-SocketIO to work with gevent, so the package looks at what you have installed in the order of precendence stated above. It finds eventlet in your venv, so it assumes that's what you are using.
Why do you have eventlet and gevent both installed? These are competing packages, you will never use both, it's one or the other. Pick the one you want, uninstall the other and then let's see if there are any errors left.
Thanks @miguelgrinberg! To answer your questions, I was using socketio.app for development. But for production wanted to use gunicorn/ gevent. I thought I only installed eventlet later in response to the error message.... but perhaps I had inadvertently installed it earlier, as things seem to work now that I've uninstalled it. Much appreciated...
Not fully sure this is a bug or a configuration issue. Everything works when I run the client and server locally, but on Digital Ocean I get the errors below. The error suggests using eventlet, but I get a whole different set of errors when I use it (and this is also not what is suggested in your guide.
As suggested in the guide, I start the process like this:
$ pipenv run gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 -b 0.0.0.0:5050 server.main:app
Pipenv versions follow below.
SERVER:
CLIENT:
Pipenv versions