Flower: Monitor doesn't show any graphs

Created on 3 Feb 2015  路  11Comments  路  Source: mher/flower

I pip installed flower (0.7.3), ran celery -A myapp flower, opened http://localhost:5555 and poked around. Everything seems to work except for the Monitor tab:

monitor tab

The graphs are there (with one exception), and time seems to be passing, but no data values ever show up.

The one exception is the Broker graph:
broken Broker graph

One exception shows up in the JavaScript console:

  • Uncaught TypeError: Cannot read property 'length' of undefined - d3.layout.min.js?v=4d73dea16077b0d7d128ecf7a4c20752:1
  • s.zero - d3.layout.min.js?v=4d73dea16077b0d7d128ecf7a4c20752:1
  • g - d3.layout.min.js?v=4d73dea16077b0d7d128ecf7a4c20752:1
  • stackData - rickshaw.min.js?v=e5a082956547a4a6ead131fbc804e27e:1
  • Rickshaw.Graph.Renderer.Rickshaw.Class.create.domain - rickshaw.min.js?v=e5a082956547a4a6ead131fbc804e27e:1
  • discoverRange - rickshaw.min.js?v=e5a082956547a4a6ead131fbc804e27e:1
  • initialize - rickshaw.min.js?v=e5a082956547a4a6ead131fbc804e27e:1
  • Rickshaw.Graph - rickshaw.min.js?v=e5a082956547a4a6ead131fbc804e27e:1
  • create_graph - flower.js?v=a478736145993458f057736839132519:374
  • $.ajax.success - flower.js?v=a478736145993458f057736839132519:566
  • o - jquery-1.7.2.min.js?v=b8d64d0bc142b3f670cc0611b0aebcae:2
  • p.fireWith - jquery-1.7.2.min.js?v=b8d64d0bc142b3f670cc0611b0aebcae:2
  • w - jquery-1.7.2.min.js?v=b8d64d0bc142b3f670cc0611b0aebcae:4
  • d - jquery-1.7.2.min.js?v=b8d64d0bc142b3f670cc0611b0aebcae:4

I don't think this is a duplicate of #66 since everything's running on the same machine, so there can't be any clock sync issues.

I do think this is a duplicate of #310, but I somehow managed to overlook it before I typed up this issue and painstakingly formatted the JavaScript stack trace, so I'm going to go ahead and submit it anyway.

Most helpful comment

I am also facing the issue where i don't see any graphs on flower but the console for me shows this JS error Uncaught TypeError: Cannot read property 'length' of undefined.
flower_admin I am using flower==0.9.0 and I am using circus to daemonize it.

All 11 comments

For the record:

  • Workers tabs hows one worker, the "Completed Tasks" numbers are increasing
  • it also shows that my broker is amqp://guest:**@localhost:5672//
  • Tasks tab shows a bunch of tasks
  • Broker tab is empty

The XHR response for /monitor/broker returns 304 not modified with response {}.

The periodic XHR responses for /monitor/succeeded-tasks, failed-tasks and completion-time return 200 ok with respones containing zeroes.

The same (JS error, no broker graph, no data in other graphs) happens if I use flower's master.

Running flower instead of celery flower at least gives me log messages. Interesting ones include:

[W 150203 11:50:51 state:74] Substantial drift from celery@platonas may mean clocks are out of sync. Current drift is 7200 seconds. [orig: 2015-02-03 11:50:51.875199 recv: 2015-02-03 09:50:51.873759]

platonas _is_ localhost! 7200 seconds sounds suspiciously like my UTC offset. What's going on there?

[E 150203 11:51:06 broker:76] RabbitMQ management API call failed: [Errno 111] Connection refused
[E 150203 11:51:06 broker:77] Make sure RabbitMQ Management Plugin is enabled (rabbitmq-plugins enable rabbitmq_management)

This looks very relevant. It would be nice to see this kind of error on the web page.

I may be guilty of not reading enough documentation. I basically followed this brief usage guide in Celery's Monitoring and Management Guide.

After I did

sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart

now the Broker tab shows one broker ("celery"), and I can see the Broker graph (and there's no JS error), but the Succeeded/Failed/Task times graphs are still empty:
three out of four graphs remain empty

Attempts to get rid of the clock offset by starting flower with

TZ=UTC flower

failed: the "clock drift" is now computed as 3600 seconds, which leaves me utterly baffled.

BTW "rabbitmq-plugins enable rabbitmq_management" did not help with "celery flower" in the virtualenv where I have flower 1.7.3: same missing Broker graph. I get absolutely no log output from "celery flower", but that might be a bug in my Django settings.py logging configuration. (It creates logs/app.log.${pid} and logs/celery.log.${pid} when I run "celery flower", but both are empty.)

The clock drift issue is a bug in celery -- two different bugs, actually, since the nonsensical UTC-offset adjustment should cancel out but doesn't.

If I patch celery and completely remove the nonsensical UTC adjustment code, I get working graphs in Flower!

So, to summarize:

  • none of the above were bugs in Flower, but
  • lack of good error handling in Flower prevented me from figuring out what was wrong.

It would be nice if Flower reported issues (such as clock drift or missing rabbitmq plugins) with my Celery configuration on the web. I think I'll open a new issue for that.

Incidentally, if I add a pprint.pprint(body) to the body of EventReceiver.event_from_message(), I see

 u'utcoffset': -1

which is very interesting, since my timezone (Europe/Vilnius) has time.timezone // 3600 == -2 (and time.altzone // 3600 == -3).

I think TIME_ZONE = 'Europe/London' in my Django settings.py is overriding the timezone for the celery worker, which makes it differ from the timezone of Flower, which triggers the aforementioned Celery bug.

It would be nice if Flower reported issues (such as clock drift or missing rabbitmq plugins) with my Celery configuration on the web. I think I'll open a new issue for that.

327

same problem, I run an instance from docker official image.

I am also facing the issue where i don't see any graphs on flower but the console for me shows this JS error Uncaught TypeError: Cannot read property 'length' of undefined.
flower_admin I am using flower==0.9.0 and I am using circus to daemonize it.

Was this page helpful?
0 / 5 - 0 ratings