ValueError: An application is trying to access Ray objects whose owner is unknown

Hi, I am trying out Ray and ran into an unexpected error for a very simple Python program.

import ray
from concurrent.futures import ProcessPoolExecutor

def print_it(ref):
    ray.init("auto")
    print(ray.get(ref))

def main():
    ray.init()
    ref = ray.put("something")
    with ProcessPoolExecutor() as executor:
        executor.submit(print_it, ref).result()
    import time
    time.sleep(10)
    ray.shutdown()

if __name__ == "__main__":
    main()

This program is a minimum reproducer. The Exception I get when I run this is:

Mon Aug 25 21:11:50 $ python testscript.py
2025-08-25 21:12:09,663 INFO worker.py:1927 – Started a local Ray instance.
2025-08-25 21:12:10,528 INFO worker.py:1747 – Connecting to existing Ray cluster at address: 127.0.0.1:51851…
2025-08-25 21:12:10,534 INFO worker.py:1927 – Connected to Ray cluster.
concurrent.futures.process._RemoteTraceback:
“”"
Traceback (most recent call last):
File “/Users/cmastrangelo/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/process.py”, line 264, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/cmastrangelo/testscript.py”, line 6, in print_it
print(ray.get(ref))
^^^^^^^^^^^^
File “/Users/cmastrangelo/.venv/lib/python3.12/site-packages/ray/_private/auto_init_hook.py”, line 22, in auto_init_wrapper
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File “/Users/cmastrangelo/.venv/lib/python3.12/site-packages/ray/_private/client_mode_hook.py”, line 104, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “/Users/cmastrangelo/.venv/lib/python3.12/site-packages/ray/_private/worker.py”, line 2858, in get
values, debugger_breakpoint = worker.get_objects(object_refs, timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/Users/cmastrangelo/.venv/lib/python3.12/site-packages/ray/_private/worker.py”, line 932, in get_objects
] = self.core_worker.get_objects(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “python/ray/_raylet.pyx”, line 3194, in ray._raylet.CoreWorker.get_objects
File “python/ray/includes/common.pxi”, line 91, in ray._raylet.check_status
ValueError: An application is trying to access Ray objects whose owner is unknown(00ffffffffffffffffffffffffffffffffffffff0100000001e1f505 ). Please make sure that all Ray objects you are trying to access are part of the current Ray session. Note that object IDs generated randomly (ObjectID.from_random()) or out-of-band (ObjectID.from_binary(…)) cannot be passed as a task argument because Ray does not know which task created them. If this was not how your object ID was generated, please file an issue at GitHub · Where software is built
“”"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/Users/cmastrangelo/testscript.py”, line 18, in
main()
File “/Users/cmastrangelo/testscript.py”, line 12, in main
executor.submit(print_it, ref).result()
File “/Users/cmastrangelo/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py”, line 456, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File “/Users/cmastrangelo/.local/share/uv/python/cpython-3.12.9-macos-aarch64-none/lib/python3.12/concurrent/futures/_base.py”, line 401, in __get_result
raise self._exception
ValueError: An application is trying to access Ray objects whose owner is unknown(00ffffffffffffffffffffffffffffffffffffff0100000001e1f505 ). Please make sure that all Ray objects you are trying to access are part of the current Ray session. Note that object IDs generated randomly (ObjectID.from_random()) or out-of-band (ObjectID.from_binary(…)) cannot be passed as a task argument because Ray does not know which task created them. If this was not how your object ID was generated, please file an issue at GitHub · Where software is built

I am running on a Macbook, Using Python 3.12, and Ray 2.48.0

Ray ObjectRefs cannot be passed across processes that are not managed by Ray, so I’d suggest using Ray to orchestrate the processes instead of the ProcessPoolExecutor.

There is a util library that’s a drop in replacement for multiprocessing pool: Distributed multiprocessing.Pool — Ray 2.49.2

Correct. Ray ObjectRefs cannot be reliably passed between processes not managed by Ray, such as those created by Python’s ProcessPoolExecutor. Instead, you should use Ray’s own process orchestration, specifically ray.util.multiprocessing.Pool, which is a drop-in replacement for Python’s multiprocessing.Pool and is designed to work seamlessly with Ray’s distributed object store and task management. This approach ensures proper serialization and management of ObjectRefs across distributed tasks and nodes.

For usage, simply replace multiprocessing.Pool with ray.util.multiprocessing.Pool in your code. This will distribute your tasks across a Ray cluster, allowing you to scale from a single node to multiple nodes without changing your code structure. For more details, see the official documentation at Distributed multiprocessing.Pool — Ray.

Would you like more detail or a code example?

Sources:

Hint: Mention @RunLLM in the post for followups.