[Serve] Ray Serve, RayActorError: The actor died unexpectedly before finishing this task

Ray version 0.8.4, trying to follow this blog:

from ray import serve

ray.init(address='auto', ignore_reinit_error=True)

{'node_ip_address': '192.168.1.245',
 'redis_address': '192.168.1.245:31850',
 'object_store_address': '/tmp/ray/session_2021-04-22_15-13-17_065173_59871/sockets/plasma_store',
 'raylet_socket_name': '/tmp/ray/session_2021-04-22_15-13-17_065173_59871/sockets/raylet',
 'webui_url': 'localhost:8265',
 'session_dir': '/tmp/ray/session_2021-04-22_15-13-17_065173_59871'}

serve.init()

---------------------------------------------------------------------------
RayActorError                             Traceback (most recent call last)
<ipython-input-5-5812526156a6> in <module>
----> 1 serve.init()

~/blankenv/lib/python3.8/site-packages/ray/serve/api.py in init(kv_store_connector, kv_store_path, blocking, start_server, http_host, http_port, ray_init_kwargs, gc_window_seconds, queueing_policy, policy_kwargs)
    118     try:
    119         ray.util.get_actor(SERVE_MASTER_NAME)
--> 120         global_state = GlobalState()
    121         return
    122     except ValueError:

~/blankenv/lib/python3.8/site-packages/ray/serve/global_state.py in __init__(self, master_actor_handle)
     96 
     97         # Connect to all the table
---> 98         bootstrap_config = ray.get(
     99             self.master_actor_handle.get_bootstrap_state_dict.remote())
    100         kv_store_connector = bootstrap_config[BOOTSTRAP_KV_STORE_CONN_KEY]

~/blankenv/lib/python3.8/site-packages/ray/worker.py in get(object_ids, timeout)
   1513                     raise value.as_instanceof_cause()
   1514                 else:
-> 1515                     raise value
   1516 
   1517         # Run post processors.

RayActorError: The actor died unexpectedly before finishing this task.

Unsure how to fix this. Is this a version error?

Hi @Carterbouley , you’re on a really old version of ray. Today, I expect, ray 1.3 will be released, and you should go back and check out the instructions for that. In particular what you’ll find is that serve.start(detached=True) is used to fire up a serve instance that doesn’t die when the wrapping script finishes.

1 Like