# Ray.init(remote address) terminates the parent process

**URL:** <https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156>\
**Category:** Uncategorized\
**Created:** [March 7, 2021, 6:51am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156 "2021-03-07T06:51:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gil\_Vernik](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gil_vernik/32/237_2.png) [@Gil\_Vernik](https://discuss.ray.io/u/Gil_Vernik)\
**Post date:** [March 7, 2021, 6:51am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156/1 "2021-03-07T06:51:48Z")

</div>

My code executed from a Process that I started. The code simply connects to the Ray cluster

```
    try:
    print ("Before Ray init")
    ray.init(address='IP:PORT', _redis_password='123', logging_level=logging.DEBUG)
    print ("After Ray init")
except Exception as e:
    print (e)

```

When this code executed, the Process is terminated right after `ray.init..` and line `After Ray init` is never printed. However when i replace

```
ray.init(address='IP:PORT', _redis_password='123', logging_level=logging.DEBUG)

```

with

```
ray.init()

```

Then Process doesn’t terminates and line `After Ray init` is printed.  
Any ideas what might cause this issue? Anything in my environment is wrong?

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [March 8, 2021, 12:19am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156/2 "2021-03-08T00:19:14Z")

</div>

Quick Question - Are you on windows?

---

<div class="post-metadata">

**Author:** ![Gil\_Vernik](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gil_vernik/32/237_2.png) [@Gil\_Vernik](https://discuss.ray.io/u/Gil_Vernik)\
**Post date:** [March 8, 2021, 4:01am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156/3 "2021-03-08T04:01:31Z")

</div>

No…it’s Linux based, I run a process from Docker image  
I use Ray 2.2.0.dev0, Python 3.7.7

---

<div class="post-metadata">

**Author:** ![Gil\_Vernik](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gil_vernik/32/237_2.png) [@Gil\_Vernik](https://discuss.ray.io/u/Gil_Vernik)\
**Post date:** [March 8, 2021, 8:35am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156/4 "2021-03-08T08:35:37Z")

</div>

To give more details, this is the code i am running

```
def test(val):
  class T():
    def __init__ (self):
        pass;
    def run(self):
        print ("before Ray init")
        ray.init(address='IP:PORT', _redis_password='123')
        print ("after Ray init")

    import ray
    from multiprocessing import Process
    jr = T()
    jrp = Process(target=jr.run)
    jrp.start()
    jrp.join(100)
    print('JR process finished')
    if jrp.is_alive():
      print ("Alive")
    else:
     print ("Dead process")

```

So when i run it, i am getting prints

```
before Ray init
INFO worker.py:665 -- Connecting to existing Ray cluster at address: IP:PORT
JR process finished
Dead process

```

I wonder, is this something related the env? I execute this code form a remote machine. Some permissions may be? I don’t know what ray.init(…) expects to have and then some issue may cause the process to die.

---

<div class="post-metadata">

**Author:** ![Gil\_Vernik](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/gil_vernik/32/237_2.png) [@Gil\_Vernik](https://discuss.ray.io/u/Gil_Vernik)\
**Post date:** [March 8, 2021, 11:34am UTC](https://discuss.ray.io/t/ray-init-remote-address-terminates-the-parent-process/1156/5 "2021-03-08T11:34:37Z")

</div>

so i guess it all failed for me since i did `ray.init(adress=..)` outside of the Ray cluster, and ray.init(…) only works internally to Ray cluster
