I am working on a project using celery workers and Flower to monitor those workers. Both the worker and Flower are running as images inside one container. I want to change attributes of the worker using Flower, but trying to change values via the Flower web UI invokes the following error: FLOWER_UNAUTHENTICATED_API environment variable is required to enable API without authentication
I am starting the worker with celery -A app.celery.celery_worker.celery worker --loglevel=info and Flower with celery -A app.celery.celery_worker.celery flower --port=${PORT} --conf=app/celery/flowerconfig.py
I tried to set up a flowerconfig file with FLOWER_UNAUTHENTICATED_API = True at the path specified in the celery flower command. Still, when using the web UI of Flower to change values, the same error message pops up and Flower outputs 401 POST /api/worker/pool/grow/celery@615b8e2b9e60 (172.18.0.1): FLOWER_UNAUTHENTICATED_API environment variable is required to enable API without authentication
I ran into the same issue and I worked around it by specifying the '--basic-auth' option, where you can specify a user and a password when starting Celery Flower (Flower 2.0.0 Authentication Documentation). So the full command to start Flower would be as follows
celery
-A app.celery.celery_worker.celery
flower
--port=${PORT}
--basic-auth=user:pwd
--conf=app/celery/flowerconfig.py
When you open the Flower interface in the browser you then get asked for these credentials and the interactions should work again. If you need a more sophisticated authentication, other options are also listed in the documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With