# Failed to create runtime\_env for Ray client server: \[Errno 2\] No such file or directory

**URL:** <https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927>\
**Category:** Kubernetes\
**Created:** [February 4, 2022, 7:22pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927 "2022-02-04T19:22:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Championzb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/championzb/32/2087_2.png) [@Championzb](https://discuss.ray.io/u/Championzb)\
**Post date:** [February 4, 2022, 7:22pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/1 "2022-02-04T19:22:33Z")

</div>

Hi,

I follow the step [here](https://docs.ray.io/en/latest/cluster/kubernetes.html) to install Ray in Kubernetes using helm.  
The python version is 3.7.7 and ray version is 1.9.2.

I port-forwarded the svc 10001 to my local and run the following script:

```auto
import ray
import requests

runtime_env = {"pip": ["requests", "ray[serve]"]}
ray.init(address="ray://127.0.0.1:10001", runtime_env=runtime_env)

@ray.remote
def reqs():
    return requests.get("https://www.ray.io/")

if __name__ == " __main__":
    print(ray.get(reqs.remote()))

```

Getting this error:

```auto
ConnectionAbortedError: Initialization failure from server:
Traceback (most recent call last):
  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/util/client/server/proxier.py", line 624, in Datapath
    client_id, job_config):
  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/util/client/server/proxier.py", line 281, in start_specific_server
    specific_server=specific_server,
  File "/home/ray/anaconda3/lib/python3.7/site-packages/ray/util/client/server/proxier.py", line 234, in _create_runtime_env
    "Failed to create runtime_env for Ray client "
RuntimeError: Failed to create runtime_env for Ray client server: [Errno 2] No such file or directory: '/tmp/ray/session_2022-02-04_08-56-23_262496_116/runtime_resources/conda/c390bf3cf7e61e5e2ee55126ce55ec8f1eb8e565'

```

The same script works against a local ray server. Any ideas?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![ckw017](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ckw017/32/1683_2.png) [@ckw017](https://discuss.ray.io/u/ckw017)\
**Post date:** [February 10, 2022, 7:03pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/2 "2022-02-10T19:03:46Z")

</div>

@Championzb can you try rerunning and checking the contents of the `/tmp/ray/session_***/runtime_resources` directory on the head node (match `session_***` to the path in the error you’re seeing)

cc @architkulkarni any guesses here?

---

<div class="post-metadata">

**Author:** ![architkulkarni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/architkulkarni/32/10_2.png) [@architkulkarni](https://discuss.ray.io/u/architkulkarni)\
**Post date:** [February 10, 2022, 8:03pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/3 "2022-02-10T20:03:25Z")

</div>

@Championzb Sorry you’re running into this, I’m not sure what the problem could be off the top of my head… Is it possible to see if the issue persists on Ray 1.10.0?

Also, are there any relevant logs in `/tmp/ray/session_***/logs` on the head node? For example, `dashboard_agent.log` or `ray_client_server` logs?

---

<div class="post-metadata">

**Author:** ![Championzb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/championzb/32/2087_2.png) [@Championzb](https://discuss.ray.io/u/Championzb)\
**Post date:** [February 10, 2022, 8:10pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/4 "2022-02-10T20:10:51Z")

</div>

Hey @ckw017 @architkulkarni , thank you for the response. I’ve found the issue. By default, head node was deployed with 512Mi memory. After increasing it to 2Gi, the issue is gone.

---

<div class="post-metadata">

**Author:** ![architkulkarni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/architkulkarni/32/10_2.png) [@architkulkarni](https://discuss.ray.io/u/architkulkarni)\
**Post date:** [February 10, 2022, 10:02pm UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/5 "2022-02-10T22:02:22Z")

</div>

That’s great! Any idea what exactly was running up against the memory limit? What gave you the idea to increase the memory? It could be helpful for us to know as we improve our error messages and failure handling.

---

<div class="post-metadata">

**Author:** ![Championzb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/championzb/32/2087_2.png) [@Championzb](https://discuss.ray.io/u/Championzb)\
**Post date:** [February 11, 2022, 12:46am UTC](https://discuss.ray.io/t/failed-to-create-runtime-env-for-ray-client-server-errno-2-no-such-file-or-directory/4927/6 "2022-02-11T00:46:57Z")

</div>

Hi @architkulkarni ? No ideas, I am just running very simple script. Just accidentally notice the memory increased on dashboard when I run the job.
