6

I am tried to connect redis 6.0+, this is the Python celery redis broker url I am config now:

broker_url = redis://:default:123456@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5
celery_result_backend = redis://:default:123456@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5

but when I start the celery using this command:

root@pydolphin-service-6fc4b98f54-msfql:~/pydolphin# celery -A dolphin.tasks.tasks worker --loglevel=INFO -n worker2 -Q non_editor_pick_and_diff_pull --concurrency 2
/usr/local/lib/python3.9/site-packages/celery/platforms.py:834: SecurityWarning: You're running the worker with superuser privileges: this is
absolutely not recommended!

Please specify a different user using the --uid option.

User information: uid=0 euid=0 gid=0 egid=0

warnings.warn(SecurityWarning(ROOT_DISCOURAGED.format(

-------------- celery@worker2 v5.1.2 (sun-harmonics) --- ***** ----- -- ******* ---- Linux-3.10.0-1160.31.1.el7.x86_64-x86_64-with-glibc2.28 2021-08-08 20:45:35

  • *** --- * ---
  • ** ---------- [config]
  • ** ---------- .> app: tasks:0x7fb4f6c2dd90
  • ** ---------- .> transport: redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5
  • ** ---------- .> results: redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5
  • *** --- * --- .> concurrency: 2 (prefork)

-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker) --- ***** ----- -------------- [queues] .> non_editor_pick_and_diff_pull exchange=non_editor_pick_and_diff_pull(direct) key=non_editor_pick_and_diff_pull

[tasks] . pydolphin.dolphin.tasks.cert-tasks . pydolphin.dolphin.tasks.tasks

[2021-08-08 20:45:35,540: ERROR/MainProcess] consumer: Cannot connect to redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5: WRONGPASS invalid username-password pair or user is disabled.. Trying again in 2.00 seconds... (1/100)

[2021-08-08 20:45:37,547: ERROR/MainProcess] consumer: Cannot connect to redis://:**@cruise-redis-headless.reddwarf-cache.svc.cluster.local:6379/5: WRONGPASS invalid username-password pair or user is disabled.. Trying again in 4.00 seconds... (2/100)

^C worker: Hitting Ctrl+C again will terminate all running tasks!

worker: Warm shutdown (MainProcess)

I am sure the user name and password correct because I could login redis using the redis-cli command. where is the problem and what should I do to fix it?

Dolphin
  • 929
  • 5
  • 21
  • 40

1 Answers1

8

It was probably the ":" before the username in the URL. Should have been

redis://default:123456@cruise-redis...

The case when you might use a leading colon in the URL is when connecting with a password but no username. Then it would look like this:

redis://:somepass@host...
polo-language
  • 266
  • 2
  • 7