Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot connect to redis://redis:6379/0 #4480

Closed
ENate opened this issue Jul 23, 2023 · 1 comment
Closed

Cannot connect to redis://redis:6379/0 #4480

ENate opened this issue Jul 23, 2023 · 1 comment
Labels

Comments

@ENate
Copy link

ENate commented Jul 23, 2023

What happened?

Unable to connect celery to redis on docker-compose

What should've happened instead?

Expected celery to connect to redis running on docker-compose

Additional details

When I run the following command on a newly generated django template

cd template_project
docker-compose -f local.yml

celery -A config.celery_app worker -l info ```

the following logs are produced:

WARNING/MainProces] path/to/miniconda3/envs/django/lib/python3.11/site-packages/celery/worker/consumer/consumer.py:498: CPendingDeprecationWarning: The broker_connection_retry configuration setting will no longer determine
whether broker connection retries are made during startup in Celery 6.0 and above.
If you wish to retain the existing behavior for retrying connections on startup,
you should set broker_connection_retry_on_startup to True.
warnings.warn(

2023-07-23 13:56:13,324: ERROR/MainProcess] consumer: Cannot connect to redis://redis:6379/0: Error -3 connecting to redis:6379. Temporary failure in name resolution..
Trying again in 2.00 seconds... (1/100)

[2023-07-23 13:56:15,331: ERROR/MainProcess] consumer: Cannot connect to redis://redis:6379/0: Error -3 connecting to redis:6379. Temporary failure in name resolution..
Trying again in 4.00 seconds... (2/100)

[2023-07-23 13:56:19,341: ERROR/MainProcess] consumer: Cannot connect to redis://redis:6379/0: Error -3 connecting to redis:6379. Temporary failure in name resolution..
Trying again in 6.00 seconds... (3/100)

- Host system configuration:

  - Version of cookiecutter CLI (get it with `cookiecutter --version`):  2.2.3
  - OS name and version:

istributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

    On Linux, run

    ```bash
    lsb_release -a 2> /dev/null || cat /etc/redhat-release 2> /dev/null || cat /etc/*-release 2> /dev/null || cat /etc/issue 2> /dev/null
    ```

    On MacOs, run

    ```bash
    sw_vers
    ```

    On Windows, via CMD, run

    ```
    systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
    ```

    ```bash
    # Insert here the OS name and version

    ```

  - Python version, run `python3 -V`:
  - Docker version (if using Docker), run `docker --version`:
  - docker-compose version (if using Docker), run `docker-compose --version`:
  - ...

- Options selected and/or [replay file](https://cookiecutter.readthedocs.io/en/latest/advanced/replay.html):
  On Linux and macOS: `cat ${HOME}/.cookiecutter_replay/cookiecutter-django.json`
  (Please, take care to remove sensitive information)

```json

Logs:
$ cookiecutter https://github.com/cookiecutter/cookiecutter-django
project_name [Project Name]: ...
Thanks
@ENate ENate added the bug label Jul 23, 2023
@ENate
Copy link
Author

ENate commented Jul 23, 2023

It seems I have to run this command in the docker env. Could be best to add this to the doc.

@ENate ENate closed this as completed Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant