full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Error running docker compose

Open daddydrac opened this issue 3 years ago • 8 comments

ERROR: for akt_flower_1  Cannot start service flower: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "--broker=amqp://guest@queue:5672//": stat --broker=amqp://guest@queue:5672//: no such file or directory: unknown

ERROR: for proxy  Cannot start service proxy: driver failed programming external connectivity on endpoint akt_proxy_1 (9f435975e1e50df3035943f827308355da1df9d8c9d015c80906aa88c2a846dd): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

ERROR: for flower  Cannot start service flower: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "--broker=amqp://guest@queue:5672//": stat --broker=amqp://guest@queue:5672//: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

daddydrac avatar Sep 14 '21 13:09 daddydrac

I'm having the same issue

vfsaez avatar Sep 15 '21 06:09 vfsaez

same issue but I changed

image: mher/flower

to

image: mher/flower:0.9.7

in docker-compose.yml

scipioni avatar Sep 17 '21 12:09 scipioni

Same problem. No changes in queue or flower container.

ERROR: for fastapitest_flower_1  Cannot start service flower: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "--broker=amqp://guest@queue:5672//": stat --broker=amqp://guest@queue:5672//: no such file or directory: unknown

ERROR: for flower  Cannot start service flower: OCI runtime create failed: container_linux.go:367: starting container process caused: exec: "--broker=amqp://guest@queue:5672//": stat --broker=amqp://guest@queue:5672//: no such file or directory: unknown
ERROR: Encountered errors while bringing up the project.

andreybotanic avatar Sep 21 '21 08:09 andreybotanic

@scipioni suggested change "fixes" the issue. It would be nice to know why it is an issue to begin with, though.

spetz83 avatar Oct 29 '21 16:10 spetz83

Since the way celery is written has changed, the easiest way to solve this problem is to pass the value as an environment variable. The easiest way to solve this problem is to add CELERY_BROKER_URL as an environment variable to flower in docker-compose.yml. Please remove the existing command.

flower:
...
    environment:
        - CELERY_BROKER_URL=amqp://guest@queue:5672//
...

okamop avatar Nov 05 '21 07:11 okamop

Ok I’ll try that. Thanks.

On Fri, Nov 5, 2021 at 2:36 AM okamoto @.***> wrote:

Since the way celery is written has changed, the easiest way to solve this problem is to pass the value as an environment variable. This can be resolved with the environment variable CELERY_BROKER_URL.

environment: - @.***:5672//

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/420#issuecomment-961683059, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHVQHGCMGWSBZ442BXGBXTUKOCRBANCNFSM5EAE5Y7A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

daddydrac avatar Nov 05 '21 08:11 daddydrac

To add onto okamop's answer;
According to Flower's Docker page

Important Please note that from version 1.0.1 Flower uses Celery 5 and has to be invoked in the same style as celery commands do.

The key takeaway here is that the Celery app's arguments have to be specified after the celery command and Flower's arguments have to be specified after the flower sub-command.

This is the template to follow::

celery [celery args] flower [flower args]

With the fix in this commit

- ENTRYPOINT ["flower"]
+ CMD ["celery flower"] 

Which means we also need to delete the command: block for Flower to start correctly.

I ran into a Flower 0.9.7 issue that is resolved in their latest container image and couldn't continue using version 0.9.7.

  flower:
    image: mher/flower
    networks:
      - ${TRAEFIK_PUBLIC_NETWORK?Variable not set}
      - default
    env_file:
      - .env
    environment:
      - CELERY_BROKER_URL=amqp://guest@queue:5672//
    deploy:
      labels:
        - traefik.enable=true
        - traefik.docker.network=${TRAEFIK_PUBLIC_NETWORK?Variable not set}
        - traefik.constraint-label=${TRAEFIK_PUBLIC_TAG?Variable not set}
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.rule=Host(`flower.${DOMAIN?Variable not set}`)
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.entrypoints=http
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-http.middlewares=${STACK_NAME?Variable not set}-https-redirect
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.rule=Host(`flower.${DOMAIN?Variable not set}`)
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.entrypoints=https
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls=true
        - traefik.http.routers.${STACK_NAME?Variable not set}-flower-https.tls.certresolver=le
        - traefik.http.services.${STACK_NAME?Variable not set}-flower.loadbalancer.server.port=5555

I don't know about the "Broker tab" comment and dropped it.

eddebc avatar Feb 06 '22 19:02 eddebc

same issue but I changed

image: mher/flower

to

image: mher/flower:0.9.7

in docker-compose.yml

I googled for hours but unfortunately I couldn't find a solution until I found yours. Thank you.

mbnoimi avatar Jul 13 '22 13:07 mbnoimi