Apply async api endpoint shows unknown task
mrn-aglic opened this issue · comments
Describe the bug
I'm trying to call a task using Flower API endpoint:
curl -X POST -d '{"args":[1,2]}' http://localhost:5555/api/task/async-apply/hello_flower.app.add
However, in the log output I can see:
[W 220913 20:02:18 web:1787] 404 POST /api/task/async-apply/hello_flower.app.add (192.168.160.1): Unknown task 'hello_flower.app.add'
The task is loaded in celery. I can execute it with the api endpoint:
/api/task/send-task/hello_flower.app.add
To Reproduce
Steps to reproduce the behavior:
- Start a celery app with redis, a celery worker, scheduler and flower in docker-compose
- Send a post request to the flower api endpoint
- See the docker container logs
Expected behavior
The task is started and the result is returned.
I figured it out. Flower needs the code in order to execute tasks via the apply and async-apply endpoints.
Perhaps this should be included in the documentations (at least I wasn't able to find it).
Even though I mentioned the code of the application I was getting the same error
command: PYTHONPATH=$PWD/src celery -A web.APP flower --logging=none --port=$PORT
Flower: 2.0.0
Celery: 5.3.0
When the flower was started my tasks were getting registered as per logs. But If I connect with the following command tasks are not listed
command: celery --broker=$borker_url flower --port=$PORT
@mher can you help me with this?