flower icon indicating copy to clipboard operation
flower copied to clipboard

Upgrading to Celery 5.0.0 breaks flower due to change in celery.bin.base module.

Open mikkothegeeko opened this issue 6 years ago • 73 comments

If you run flower with Celery 5.0.0 or if you use the docker image, it will say it cannot import "Command".

Steps to reproduce the behavior:

  1. pip install celery==5.0.0 THEN
  2. flower --version OR
  3. flower -A proj --broker=redis://redis OR
  4. flower

image

The Command class is no longer part of the base module: https://docs.celeryproject.org/en/v5.0.0/reference/celery.bin.base.html

Which means it can no longer import and inherit Command:

from __future__ import absolute_import
from __future__ import print_function

import os
import sys
import atexit
import signal
import logging

from pprint import pformat

from logging import NullHandler

from tornado.options import options
from tornado.options import parse_command_line, parse_config_file
from tornado.log import enable_pretty_logging
from celery.bin.base import Command

from . import __version__
from .app import Flower
from .urls import settings
from .utils import abs_path, prepend_url
from .options import DEFAULT_CONFIG_FILE, default_options


logger = logging.getLogger(__name__)


class FlowerCommand(Command):
    # ...

mikkothegeeko avatar Sep 25 '20 01:09 mikkothegeeko

Same problem here

ifokeev avatar Sep 29 '20 13:09 ifokeev

Same problem here as well

eliorc avatar Sep 30 '20 08:09 eliorc

Same problem here also.

kdiri avatar Sep 30 '20 10:09 kdiri

Same for me, needed downgrade to 4.4.7

packetflow avatar Sep 30 '20 10:09 packetflow

Same here, also had to downgrade sadly

zufj avatar Sep 30 '20 12:09 zufj

Same for me, dowgraded celery to 4.4.7 as @packetflow

cesarFrias avatar Oct 02 '20 22:10 cesarFrias

Same problem for me

PedroCaicedoDev avatar Oct 03 '20 03:10 PedroCaicedoDev

Hello All,

A work around if you don't want to downgrade all of celery is to use a docker container for flower:

  flower:
    image: mher/flower
    command: ["--app your_app", "--url_prefix=flower", "--broker=redis://redis"]
    ports:
      - 5555:5555
    restart: unless-stopped

mikkothegeeko avatar Oct 04 '20 03:10 mikkothegeeko

Why was the issue closed? Is this resolved?

waldner avatar Oct 04 '20 09:10 waldner

This issue should not be closed because not solved

Regards

sogloarcadius avatar Oct 04 '20 11:10 sogloarcadius

@mbayabo @mher Please keep one of the #1031 or #1029 open.

mandarvaze avatar Oct 05 '20 05:10 mandarvaze

@mbayabo @mher Please keep one of the #1031 or #1029 open.

I didn't close this.

mikkothegeeko avatar Oct 06 '20 01:10 mikkothegeeko

@mbayabo I guess you accidentally clicked the "close and comment" button https://github.com/mher/flower/issues/1029#event-3837160460 but you should be able to re-open this issue.

chrisburr avatar Oct 06 '20 04:10 chrisburr

@chrisburr Oh I see.

mikkothegeeko avatar Oct 06 '20 05:10 mikkothegeeko

Same problem for me, even using the docker image. Should I use a specific tag?

Hello All,

A work around if you don't want to downgrade all of celery is to use a docker container for flower:

  flower:
    image: mher/flower
    command: ["--app your_app", "--url_prefix=flower", "--broker=redis://redis"]
    ports:
      - 5555:5555
    restart: unless-stopped

AlessandroStaffolani avatar Oct 08 '20 14:10 AlessandroStaffolani

I solved creating a custom docker image in which I install flower and celery (version 4.4.7) using pip and then using my docker image.

FROM python:3.8.2-slim-buster

RUN apt-get update && apt-get install -y gcc python3-dev

RUN pip install --no-cache-dir -Iv flower redis celery==4.4.7

EXPOSE 5555

ENTRYPOINT ["flower"]

AlessandroStaffolani avatar Oct 08 '20 16:10 AlessandroStaffolani

You can use 0.9.5 tag with docker image

mher avatar Oct 08 '20 16:10 mher

You can use 0.9.5 tag with docker image

This one is working too. Thanks

AlessandroStaffolani avatar Oct 08 '20 17:10 AlessandroStaffolani

You can use 0.9.5 tag with docker image

This gets around this issue but then we run into the permissions issue if using persistent=True (which I think is fixed in latest). Any workaround besides creating another Dockerfile?

michaelefisher avatar Oct 20 '20 01:10 michaelefisher

creating a docker image seems to connect but can't seem to access the GUI via localhost:5555 any clues?

edit: tried the custom image suggested by @ale8193 but having the same issue, it seems to be running properly but can´t access GUI

tritium01 avatar Oct 26 '20 02:10 tritium01