312 questions
0
votes
0
answers
39
views
Can you spawn a regular thread in an eventlet green thread?
We have a python, django, Gunicorn setup with eventlet workers. I have a long running task that causes a HTTP request timeout and I want to offload it to a regular python thread (threading.Thread). I ...
0
votes
2
answers
145
views
Celery with RabbitMQ and Eventlet Not Working with Boto3 Client & Timestream
I am trying to use Celery with RabbitMQ and Eventlet to handle asynchronous tasks in my Python application. One of my tasks involves uploading files to an S3 bucket using the Boto3 client. However, I ...
1
vote
0
answers
38
views
SocketIO Port not exposed in AWS Elastic Beanstalk
I have implemented a flask Application, that hosts a socket server.
But I am not able to connect to socket when deployed on Elastic Beanstalk.
from flask_socketio import SocketIO, emit, join_room, ...
0
votes
0
answers
217
views
celery cannot connect to redis in docker:kombu.exceptions.OperationalError: Error -3 connecting to redis:6379. Lookup timed out
I'm building a Websocket service in Django, and I chose celery to push messages。But when I run celery using eventlet on the online server, the following error occurred:
Traceback (most recent call ...
2
votes
1
answer
400
views
Flask-socketIO with Gunicorn on the cloud not working
I've build a test app (testing for RESTfull Api) to process some POST requests from another app.
When both apps are run localy from PyCharm everything works ok - POST request activates a function ...
0
votes
0
answers
27
views
Bug of 'eventlet' for 'celery' on Windows 10
my env:
Windows 10, Celery 5.3.6, eventlet 0.36.1
question:
I meet the same question on celery-issues. And I try celery -A [task] worker -l info -P eventlet, but I even can not connect redis. The ...
0
votes
0
answers
123
views
code 400, message Bad request version in Python socketio server
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client.
when i use the http it works fine client is able to connect to ...
1
vote
2
answers
296
views
Trouble sending data from Socket.IO server to client in Python
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client. Despite successful connections between the client and server, I'm ...
1
vote
1
answer
2k
views
Understanding Gunicorn Worker and Thread Configuration for Flask-SocketIO with Eventlet
I'm developing a Flask web application that uses SocketIO and am facing issues with configuring Gunicorn, particularly with the number of workers and threads. My server runs on Ubuntu with 32GB DDR4 ...
1
vote
0
answers
764
views
Flask | Socketio | Gevent or Eventlet | Windows IIS.....do these things work together?
I have a flask application that I implemented socketio on. In the local debugger it works. Through IIS the connections are not stable. Here is a snip of the console:
console_image
The logs show my ...
0
votes
0
answers
216
views
The size of gevent/eventlet pool with python-socketio in production
Context
Right now I have a simple production setup of python-socketio served on top of eventlet according to the documentation.
This application interacts mainly with Redis using official redis-py ...
0
votes
1
answer
226
views
Flask Socket-IO Emitting Across Google Cloud Run Container Instances
I have been developing a web application that uses a flask web server, flask socket-io, and flask sessions. Previously I was deploying with via a docker image to Google Cloud Run. Google cloud run ...
1
vote
0
answers
727
views
Unable to deploy minimal flask app using Socket.io, Gunicorn, and eventlet
I am attempting to deploy a Flask-Socket.io app using Gunicorn and eventlet as per the documentation: https://flask-socketio.readthedocs.io/en/latest/deployment.html.
I have both Gunicorn and eventlet ...
1
vote
1
answer
533
views
Celery, Django, Eventlet, django-celery-beat "raise NotImplementedError("unsupported platform")"
Celery, Eventlet, django-celery-beat for a project, but when give the bellow command
celery -A app worker -P eventlet -c 100 -l info --logfile=celery.log
I get the following error
(sample_app) ...
0
votes
1
answer
1k
views
eventlet issue with ubuntu 20.04 running RYU
I really need your kind help with this problem.
I recently upgraded ubuntu 18.04 to 20.04 and with it, I can't run the ryu controller that is based on python because it shows this import error:
...
1
vote
0
answers
146
views
Flask eventlet Dispatchermiddleware SSL
I have this Python code and i want to use SSL for the connection.
import socketio
from eventlet import listen, wrap_ssl
from eventlet.wsgi import server
from flask import Flask
from werkzeug....
3
votes
1
answer
156
views
Celery Eventlet OSError: Load averages are unobtainable
Our django celery server is running with concurrency value of 500 with eventlet as execution pool. Recently, we encountered this issue and restarting the server fixed it. I am attaching the traceback ...
0
votes
1
answer
149
views
How i can get the client ip when it connects to socketio and when they request a page on the website? - python
how i can get the client IP in eventlet + WSGI, socketio when someone connects to the web socket AND when the client request any page on the site?? i tried what i can find in the internet, it doesn't ...
0
votes
1
answer
353
views
how to disable eventlet logging? - python
i need to disable the logging in eventlet for a WSGI server, i tried several things i found online, nothing worked
code :
import eventlet
import socketio
import logging
sio= socketio.Server()
app = ...
0
votes
1
answer
533
views
Deploy Flask-SocketIO Application using Eventlet and Docker
I have a simple flask application that demonstrates how to stream webcam video using the client's webcam. When I run the application locally everything runs fine but when I try to deploy the ...
0
votes
1
answer
1k
views
Error when importing flask_socket-io : AttributeError: module 'collections' has no attribute 'MutableMapping'
With a python file that is just:
from flask_socketio import SocketIO
I get the error:
> python .\app.py
Traceback (most recent call last):
File "C:\{...}\server\app.py", line 127, in &...
12
votes
2
answers
8k
views
Eventlet + DNS Python Attribute Error: module "dns.rdtypes" has no attribute ANY
I know that someone will face this problem. I had this problem today, but I could fix it promptly, and I want to share my solution:
Problem:
from flask_socketio import SocketIO
You will receive an ...
5
votes
0
answers
3k
views
How to serve Flask app on waitress and socket.io using eventlet server simultaneously?
I'm using waitress server to deploy the flask app for production. I'm also using flask's socketio along with the eventlet server which requires its own app run.
Currently only serving app on waitress:
...
0
votes
1
answer
2k
views
Cannot get celery to run task with Flask-SockeIO and eventlet monkey patching
Update 2:
The solution is in how monkey patching actually gets done. See my answer below.
Update 1:
The issue is the monkey patching of eventlet. Monkey patching is pretty magic to me, so I don't ...
2
votes
0
answers
1k
views
Celery with eventlet or gevent doesn't work properly
I'm running Celery using code, like this:
if __name__ == '__main__':
worker = celery.Worker()
worker.setup_defaults(
loglevel=logging.INFO,
pool='eventlet',
concurrency=...
3
votes
0
answers
158
views
Is there a way to see which libraries are being monkey patched when running celery with eventlet pool in a Django application?
I am currently running a Django project that offloads work to celery background workers.
For CPU-bound tasks the fork pool is working great running like so:
celery -A myApp worker -l INFO -E -n worker ...
0
votes
0
answers
908
views
Python urllib3 module could it be monkeypatched by eventlet?
I use Python eventlet pool and requests module to speed up my HTTPS request.
But it makes the requests process slower, I try to find the answer to the question these days.
I find some use cases for ...
0
votes
1
answer
211
views
Python greenthread and requests module only process 10 requests at each time?
I am using Python 2.7.5. and try to use co-routine Greenthreads (Python eventlet) and Python requests module to speed up my REST API request.
I know The Python requests module uses poolmanager object (...
1
vote
0
answers
318
views
Flask MQTT high CPU usage
I'm using Flask on a project on an embedded system and I'm having performance issues. I'm running gunicorn with one eventlet worker by running:
gunicorn -b 0.0.0.0 --worker-class eventlet -w 1 'app:...
2
votes
1
answer
1k
views
Cannot disable logging on flask_socketio and eventlet server
I have a flask_socketio app with eventlet that runs on Windows, but I can't figure out how to disable the large amounts of log messages. So far I've looked at Disabling logger in flask-socketio and ...
2
votes
1
answer
643
views
wsgi error: Address already in use - socketio/django/apache2
My project is created with React (create-react-app), React router (no webpack), -- Django (rest) and Socketio with eventlet on the backend.
I have 3 problems with deployment with apache2 - Everything ...
0
votes
0
answers
1k
views
Why isn't gunicorn working with my Flask app?
I have a simple Flask app set up which runs with the command flask run. I'd like to be able to run this app in a Docker container, which I'm trying to do using a gunicorn server. However, when I try ...
1
vote
1
answer
2k
views
How to deploy flask with socketio to heroku and have it upgrade to websockets
Locally, it works. Socketio upgrades to websocket instead of resorting to polling.
This is obvious from the logs:
...
FYnWEW0ufWGO7ExdAAAA: Received request to upgrade to websocket
...
0
votes
1
answer
2k
views
Flask-SocketIO: Background task is started twice in reloader mode
I'm trying to use background tasks with flask-socketio and run into two problems:
when in reloader mode, the background task is started twice
when changing the code, flask reloads but the background ...
0
votes
1
answer
2k
views
How to solve ValueError('Invalid async_mode specified') for flask-socketio?
I'm testing a flask-socketio server in bitbucket pipeline. It failed with the following messages:
Traceback (most recent call last):
File "/root/.local/share/virtualenvs/build-3vGKWv3F/lib/...
0
votes
0
answers
773
views
Flask-SocketIO via Reverse Proxy (IIS) - Websocket Upgrade Unsuccessful
The Problem
I recently posted a question trying to understand how to implement a Flask-SocketIO setup on an IIS webserver (I could only get it to work on my local development server). I was pointed ...
0
votes
1
answer
5k
views
eventlet throws error on import in docker
I have been having some odd issues with docker today. I described one issue @ pathlib: cannot import name 'Sequence' from 'collections'. I didn't really need one of the packages that ...
5
votes
1
answer
6k
views
AttributeError: '_UnixSelectorEventLoop' object has no attribute '_signal_handlers'
I've been upgrading our Django/Python app to Python 3.9.7 and Django 3.2.7 (from Python 3.5 and Django 1.11.23).
Currently if I try to run python manage.py createsuperuser
I get the following error
...
2
votes
1
answer
817
views
Is python `threading.local` safe across requests with `Gunicorn` and `eventlet`?
We're running a Django project with gunicorn and eventlet.
I'd like to use threading.local to stash some http request data for use later in that thread (with some custom middleware). I'm wondering if ...
1
vote
0
answers
387
views
SSL Error with stackstorm sensor connection to redis
Getting these errors while connecting to redis with SSL. A normal action runs fine, sensor seems to be having problem. I did try to use the fixes mentioned in https://github.com/eventlet/eventlet/...
0
votes
1
answer
401
views
Sending and receiving events successfully with socket.io, but nothing is happening
I'm trying to get my webapp to send messages and I can't figure out why it isn't working. There are no errors that I can see, it's just that the actions in my event.py function aren't happening. I am ...
0
votes
1
answer
718
views
getting realtime output of the 'top' linux command in a web browser with flask python
Currently, I am in the process of building an application that is capable of executing shell commands and fetching the results to a web browser.
My problem is that the results display fine on the ...
2
votes
0
answers
220
views
Python Bigquery to_dataframe function is blocked when gunicorn is run with worker class gevent
When I run my flask app with worker-class=gevent on gunicorn, the server blocks.
gunicorn command
gunicorn app:app --workers=5 --worker-class=gevent --threads=5 --timeout=1800 --log-level=DEBUG
...
0
votes
1
answer
235
views
Async sleep() not working in "connect" event but working in custom event
I used flask-socketio to implement websocket. I used the eventlet/socketio sleep() function, which supposed to work asynchronously. And this is working in my custom event but when it is under the ...
1
vote
0
answers
624
views
django async ORM sync_to_async executor swap out concurrent.futures.ThreadPoolExecutor when using gevent
This is just a long way of asking: "How does sync_to_async work with blocking IO, and gevent/psycogreen"?
For example:
from myapp.models import SomeModel
from asgiref.sync import ...
33
votes
3
answers
27k
views
Gunicorn ImportError: cannot import name 'ALREADY_HANDLED' from 'eventlet.wsgi' in docker
I had a working code running flask with gunicorn (eventlet worker) in docker. It's also working in production, but on my machine, it started doing this. I can't find anything on google about this ...
0
votes
1
answer
1k
views
Having trouble with flask-SocketIO and eventlet
I am developing my final degree project and I am facing some problems with Python, Flask, socketIO and background threads.
My solution takes some files as input, process them, makes some calculations, ...
1
vote
0
answers
469
views
Gunicorn + eventlet use redis connection in SIGTERM signal handler
I'm facing an issue related to using an active I/O connection in the SigTerm handler using gunicorn eventlet server.
server.py
def exit_with_grace(*args):
conn = get_redis_connection()
conn....
0
votes
2
answers
2k
views
"Flask-SocketIO is Running under Werkzeug" despite using socketio.run()
I'm having trouble running Flask & SocketIO with Eventlet despite using socketio.run(), any suggestions are appreciated. I'm currently on Python 3.9 and I've tried multiple different versions of ...
0
votes
1
answer
2k
views
Closing flask-socket io server programmatically
I am new to server development so please be kind...
I am developing a test application that starts a flask-socketio server and after interacting with a clients, it needs to shutdown and open another ...