Flower: Flower not working with Rabbitmq in Docker

Created on 31 Oct 2020  路  3Comments  路  Source: mher/flower

Describe the bug
When opening the Flower Dashboard, nothing is shown.., is still loading

To Reproduce

  1. Use this docker-compose.yml
version: '3'

services:
  rabbitmq:
    image: rabbitmq:3-management
    ports:
      - '5672:5672'
      - '15672:15672'

  flower:
    image: mher/flower:0.9.5
    restart: unless-stopped
    command: ["flower", "--address=0.0.0.0", "--broker=amqp://guest:guest@localhost:5672/","--port=5555", "--logging=DEBUG"]  
    depends_on:
      - rabbitmq
    ports:
      - 5555:5555
  1. run celery worker localy.
  2. run docker-compose up
  3. Open http://localhost:5555

Expected behavior

  1. Flower showing rabbitmq connection in container logs.
  2. can access Flower Dashboard on http://localhost:5555

Actual behavior

  1. output of : docker logs 'flower-container':
[D 201031 16:49:20 selector_events:59] Using selector: EpollSelector
[I 201031 16:49:20 command:138] Visit me at http://0.0.0.0:5555
[I 201031 16:49:20 command:145] Broker: amqp://guest:**@localhost:5672//
[I 201031 16:49:20 command:146] Registered tasks:
    ['celery.accumulate',
     'celery.backend_cleanup',
     'celery.chain',
     'celery.chord',
     'celery.chord_unlock',
     'celery.chunks',
     'celery.group',
     'celery.map',
     'celery.starmap']
[D 201031 16:49:20 command:150] Settings: {'cookie_secret': b'YNt2bjOgRoWMf4Ifq/VxCPeJ94+IPE/fm7UkGmQDrCA=',
     'debug': False,
     'login_url': '/login',
     'static_path': '/usr/local/lib/python3.8/site-packages/flower/static',
     'static_url_prefix': '/static/',
     'template_path': '/usr/local/lib/python3.8/site-packages/flower/templates'}
[D 201031 16:49:20 control:31] Updating all worker's cache...
[D 201031 16:49:25 events:152] Enabling events...
  1. access to http://localhost:5555 still loading:

Screenshot 2020-10-31 at 17 52 53

bug

Most helpful comment

Hi,
this statement seems correct to me

when the broker is network unreachable

Change in your docker-compose.yml file the line command to use in the broker url 'rabbitmq' instead of 'localhost'.
(docker image is not aware of localhost and docker-compose is building a network with the declared services as hosts ([https://docs.docker.com/compose/networking/]))
from

command: ["flower", "--address=0.0.0.0", "--broker=amqp://guest:guest@localhost:5672/","--port=5555", "--logging=DEBUG"]

to

command: ["flower", "--address=0.0.0.0", "--broker=amqp://guest:guest@rabbitmq:5672/","--port=5555", "--logging=DEBUG"]

HTH
GG

All 3 comments

This is the behavior when the broker is network unreachable or not in external_links definition. It works when flower can reach rabbitmq.

Hi,
this statement seems correct to me

when the broker is network unreachable

Change in your docker-compose.yml file the line command to use in the broker url 'rabbitmq' instead of 'localhost'.
(docker image is not aware of localhost and docker-compose is building a network with the declared services as hosts ([https://docs.docker.com/compose/networking/]))
from

command: ["flower", "--address=0.0.0.0", "--broker=amqp://guest:guest@localhost:5672/","--port=5555", "--logging=DEBUG"]

to

command: ["flower", "--address=0.0.0.0", "--broker=amqp://guest:guest@rabbitmq:5672/","--port=5555", "--logging=DEBUG"]

HTH
GG

thank you so much changing from localhost to rabbitmq solved my issue

Was this page helpful?
0 / 5 - 0 ratings