mher / flower

Real-time monitor and web admin for Celery distributed task queue

Home Page:https://flower.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Apply async api endpoint shows unknown task

mrn-aglic opened this issue · comments

commented

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:

  1. Start a celery app with redis, a celery worker, scheduler and flower in docker-compose
  2. Send a post request to the flower api endpoint
  3. See the docker container logs

Expected behavior
The task is started and the result is returned.

commented

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?