question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failure to connect to Redis when running in a docker container

See original GitHub issue

When running in a docker container, the address resolution results with the docker container IP and not the physical machine’s IP, which results in the following traceback (*** are hidden fields for security reasons):

020-11-11 14:48:28,960	INFO worker.py:672 -- Connecting to existing Ray cluster at address: ***:***
2020-11-11 14:48:28,968	WARNING services.py:218 -- Some processes that the driver needs to connect to have not registered with Redis, so retrying. Have you run 'ray start' on this node?
2020-11-11 14:48:29,977	WARNING services.py:218 -- Some processes that the driver needs to connect to have not registered with Redis, so retrying. Have you run 'ray start' on this node?
2020-11-11 14:48:30,986	WARNING services.py:218 -- Some processes that the driver needs to connect to have not registered with Redis, so retrying. Have you run 'ray start' on this node?
2020-11-11 14:48:31,996	WARNING services.py:218 -- Some processes that the driver needs to connect to have not registered with Redis, so retrying. Have you run 'ray start' on this node?
2020-11-11 14:48:33,005	WARNING services.py:218 -- Some processes that the driver needs to connect to have not registered with Redis, so retrying. Have you run 'ray start' on this node?
Traceback (most recent call last):
  File "***", line 39, in <module>
    ray.init(address='***:***', _redis_password='***')
  File "/usr/local/lib/python3.6/dist-packages/ray/worker.py", line 779, in init
    connect_only=True)
  File "/usr/local/lib/python3.6/dist-packages/ray/node.py", line 179, in __init__
    redis_password=self.redis_password))
  File "/usr/local/lib/python3.6/dist-packages/ray/_private/services.py", line 211, in get_address_info_from_redis
    redis_address, node_ip_address, redis_password=redis_password)
  File "/usr/local/lib/python3.6/dist-packages/ray/_private/services.py", line 194, in get_address_info_from_redis_helper
    "Redis has started but no raylets have registered yet.")
RuntimeError: Redis has started but no raylets have registered yet.

Ray version and other system information (Python version, TensorFlow version, OS): Ray installed via https://docs.ray.io/en/master/development.html#building-ray-python-only on both latest master and releases/1.0.1

  • Running in a docker container

Reproduction (REQUIRED)

Please provide a script that can be run to reproduce the issue. The script should have no external library dependencies (i.e., use fake or mock data / environments):

ray start --block --head --port=*** --redis-password=*** --node-ip-address=*** --gcs-server-port=6005 --dashboard-port=6006 --node-manager-port=6007 --object-manager-port=6008 --redis-shard-ports=6400,6401,6402,6403,6404,6405,6406,6407,6408,6409 --min-worker-port=6100 --max-worker-port=6299 --include-dashboard=false

then in python: ray.init(address='***:***', _redis_password='***')

  • I have verified my script runs in a clean environment and reproduces the issue.
  • I have verified the issue also occurs with the latest wheels.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ijrsvtcommented, Nov 11, 2020

@roireshef Quick question, what networking options are you applying to the Docker container?

0reactions
defangc23commented, Jan 7, 2021

encounter the same issue: ray docker containers can not find each other.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fails to connect to redis, when running inside of docker ...
Hey, the library works like a charm, thanks a lot. My application is a microservice, which connects to a redis database, which is...
Read more >
Cannot connect to redis running as container with boot2docker
1 Answer 1 · You could give the image a name so you would not need to work with ids: docker build -t...
Read more >
can't connect to redis at localhost - Docker Desktop for Windows
I have just setup redis using docker in windows and I am trying to write a simple .Net console app to connect to...
Read more >
Docker could not connect to redis at 127.0.0.1:6379 - Bobcares
Wondering how to resolve Docker could not connect to redis at 127.0.0.1:6379: connection refused error? We can help you.
Read more >
Docker-compose: redis container won't connect
However, after i run docker-compose run redis , the container runs fine but I am not able to see port 6379 exposed on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found