# Ray.init() suddenly stopped working

**URL:** <https://discuss.ray.io/t/ray-init-suddenly-stopped-working/15424>\
**Category:** Dashboard, Monitoring & Debugging\
**Created:** [August 2, 2024, 8:09am UTC](https://discuss.ray.io/t/ray-init-suddenly-stopped-working/15424 "2024-08-02T08:09:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amitha\_Acharya](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/amitha_acharya/32/6381_2.png) [@Amitha\_Acharya](https://discuss.ray.io/u/Amitha_Acharya)\
**Post date:** [August 2, 2024, 8:09am UTC](https://discuss.ray.io/t/ray-init-suddenly-stopped-working/15424/1 "2024-08-02T08:09:36Z")

</div>

**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)

---

<div class="post-metadata">

**Author:** ![Sam\_Chan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sam_chan/32/5011_2.png) [@Sam\_Chan](https://discuss.ray.io/u/Sam_Chan)\
**Post date:** [August 6, 2024, 6:51am UTC](https://discuss.ray.io/t/ray-init-suddenly-stopped-working/15424/2 "2024-08-06T06:51:37Z")

</div>

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](http://anyscale.com) \> slack me on Ray Slack as well and we can debug together.

---

<div class="post-metadata">

**Author:** ![Amitha\_Acharya](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/amitha_acharya/32/6381_2.png) [@Amitha\_Acharya](https://discuss.ray.io/u/Amitha_Acharya)\
**Post date:** [August 13, 2024, 1:13pm UTC](https://discuss.ray.io/t/ray-init-suddenly-stopped-working/15424/3 "2024-08-13T13:13:58Z")

</div>

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