Search code examples
docker-composeceleryflower

Celery Flower UNAUTHENTICATED_API not working


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


Solution

  • Had the same problem and it was just a small detail in my case. Try to make sure you have add the env variable the right way, it can be with the command:

    export FLOWER_UNAUTHENTICATED_API="true"
    

    or in a .env file as:

    FLOWER_UNAUTHENTICATED_API=true
    

    attention to the lowercase and no space around the equal sign