Ray.init() suddenly stopped working

How severe does this issue affect your experience of using Ray?

  • High: It blocks me to complete my task.

i am a newbe in ray and had setup a small script on my laptop and started trying out ray. I ran a sample script like below and it was working fine. Now, today morning, all of a sudden, the ray.init() has started giving me below error. What changed overnight and how to resolve this? I had to show a demo to my team and this started coming up. This is happening with all my ray scripts.

  • Traceback (most recent call last):
    File “d:\StrategyBuilder\Renko_Standalone_I\Test.py”, line 43, in
    run_remote(100000)
    ^^^^^^^^^^^^^^^^^^
    File “d:\StrategyBuilder\Renko_Standalone_I\Test.py”, line 36, in run_remote
    ray.init()
    File “C:\Users\PC\AppData\Roaming\Python\Python312\site-packages\ray_private\client_mode_hook.py”, line 103, in wrapper
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
    File “C:\Users\PC\AppData\Roaming\Python\Python312\site-packages\ray_private\worker.py”, line 1674, in init
    _global_node = ray._private.node.Node(
    ^^^^^^^^^^^^^^^^^^^^^^^
    File “C:\Users\PC\AppData\Roaming\Python\Python312\site-packages\ray_private\node.py”, line 102, in init
    [primary_redis_ip, port] = external_redis[0].rsplit(“:”, 1)
    ^^^^^^^^^^^^^^^^^^^^^^^^
    ValueError: not enough values to unpack (expected 2, got 1)

import os
import time
import ray

Normal Python

def fibonacci_local(sequence_size):
fibonacci =
for i in range(0, sequence_size):
if i < 2:
fibonacci.append(i)
continue
fibonacci.append(fibonacci[i-1]+fibonacci[i-2])
return sequence_size

Ray task

@ray.remote
def fibonacci_distributed(sequence_size):
fibonacci =
for i in range(0, sequence_size):
if i < 2:
fibonacci.append(i)
continue
fibonacci.append(fibonacci[i-1]+fibonacci[i-2])
return sequence_size

Normal Python

def run_local(sequence_size):
start_time = time.time()
results = [fibonacci_local(sequence_size) for _ in range(os.cpu_count())]
duration = time.time() - start_time
print(‘Sequence size: {}, Local execution time: {}’.format(sequence_size, duration))

Ray

def run_remote(sequence_size):
# Starting Ray
ray.init()
start_time = time.time()
results = ray.get([fibonacci_distributed.remote(sequence_size) for _ in range(os.cpu_count())])
duration = time.time() - start_time
print(‘Sequence size: {}, Remote execution time: {}’.format(sequence_size, duration))

run_local(100000)
run_remote(100000)

can you try spinning up a hosted anyscale workspace and see if you can repro; it has some free trial credits through in and quickly helps troubleshoot whether this is infra level versus a ray issue.

hosted anyscale is great for this as it gives you a jupyter notebook experience to quickly validate ray logic in a controlled environment where all of the infra level is already taken care of/set up right for you.

you can sign up at anyscale.com > slack me on Ray Slack as well and we can debug together.

i tried to clear the %temp%/ray folder and the issue is resolved.