# Certain Ray CLI commands complain about invalid GCS address

**URL:** <https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565>\
**Category:** Uncategorized\
**Created:** [January 23, 2025, 1:08am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565 "2025-01-23T01:08:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jleben](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jleben/32/7574_2.png) [@jleben](https://discuss.ray.io/u/jleben)\
**Post date:** [January 23, 2025, 1:08am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/1 "2025-01-23T01:08:34Z")

</div>

Certain Ray CLI commands that take the `--address` argument (or the RAY\_ADDRESS env var) complain like this:

```auto
ValueError: Invalid gcs_address: http://10.212.131.238:8265/

```

This is the case at least for: `ray monitor` and `ray status`. However, `ray job submit` and `ray summary tasks` for example work fine.

What might be the reason for the error and how can I avoid it?

---

<div class="post-metadata">

**Author:** ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)\
**Post date:** [January 23, 2025, 10:17pm UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/2 "2025-01-23T22:17:34Z")

</div>

Hello! I did a bit of searching on the docs and I think this is what’s going on here.

The `ray monitor` and `ray status` commands expect a direct address to the Ray cluster, typically in the format of `ip:port` (e.g., `10.0.0.1:6379` ), rather than a URL with a protocol like `http://`(`ray job submit` or `ray summary` are designed to listen to https:// endpoints, which is why they don’t throw an error).

For the commands where there is an error, they are expecting a different format, such as `10.212.131.238:8265` instead of `http://10.212.131.238:8265/`. This _should_ resolve the issue for commands like `ray monitor` and `ray status`.

So, I think you can try using `https://` for any dashboard commands, and the `<ip>:<port>` format for any cluster interactions. Let me know if this fixes the issue for you. 🙂

---

<div class="post-metadata">

**Author:** ![jleben](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jleben/32/7574_2.png) [@jleben](https://discuss.ray.io/u/jleben)\
**Post date:** [January 24, 2025, 1:46am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/3 "2025-01-24T01:46:49Z")

</div>

Hi Christina,

Thank you for your reply. I tried `ray status --address 10.212.131.238:8265` and got the error:

```auto
[2025-01-24 01:44:58,524 E 2803 2803] gcs_rpc_client.h:179: Failed to connect to GCS at address 10.212.131.238:8265 within 5 seconds

```

---

<div class="post-metadata">

**Author:** ![jleben](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jleben/32/7574_2.png) [@jleben](https://discuss.ray.io/u/jleben)\
**Post date:** [January 24, 2025, 1:48am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/4 "2025-01-24T01:48:52Z")

</div>

I also get the same error from `ray status --address 10.212.131.238:6379` (using the port that was set in `ray start --head --port=6379 ...`)

---

<div class="post-metadata">

**Author:** ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)\
**Post date:** [January 24, 2025, 2:52am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/5 "2025-01-24T02:52:46Z")

</div>

Hmmm, I’m assuming your Ray cluster is already running when you’re trying to connect?

1. Do you have any firewalls or network restrictions that might block access to the port? Can you try pinging it to see if pinging the IP / port works?
2. Are there any errors in the Ray logs at `tmp/ray/session_latest/logs/` (or wherever your logs are stored?)
3. Is it possible that there is another process on the port?

---

<div class="post-metadata">

**Author:** ![jleben](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jleben/32/7574_2.png) [@jleben](https://discuss.ray.io/u/jleben)\
**Post date:** [January 24, 2025, 7:47am UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/6 "2025-01-24T07:47:16Z")

</div>

Thanks for pointing me in the right direction Christina!

I had to allow connections on port 6379 for `ray status --address 10.212.154.239:6379` to work

Curiously, I also had to allow connections on port 41823 for `ray memory --address 10.212.154.239:6379` to work. However, it seems this port is chosen randomly at start, so after restarting my cluster the command failed again. Do you know perhaps which of the `ray start` options mentioned [here](https://docs.ray.io/en/latest/ray-core/configure.html#ports-configurations) would control this port so I can make it constant?

I should say it’s a rather unexpected and impractical behaviour that `ray status` and `ray job submit` expect address in a different format even though they will both use the address from the same environment variable if not given on command line. This makes it impossible to avoid the `--address` option for a subset of commands.

Is someone finds that helpful, as an alternative to specifying `--address`, I noticed all of these commands work without `--address` option or `RAY_ADDRESS` env var when run on the head node, which can be done from outside the cluster via `ray exec`, for example `ray exec config.yaml 'ray status'`. Some may find this more convenient than having to remember what to pass as `--address`.

Thank you for your help finding workarounds to my troubles!

---

<div class="post-metadata">

**Author:** ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)\
**Post date:** [January 27, 2025, 11:54pm UTC](https://discuss.ray.io/t/certain-ray-cli-commands-complain-about-invalid-gcs-address/21565/7 "2025-01-27T23:54:51Z")

</div>

Hi! I’m glad to hear you solved the port problems!

As for the `ray start` options, I think these would help make the port more constant:

- `--min-worker-port`: Minimum port number worker can be bound to. Default: 10002.
- `--max-worker-port`: Maximum port number worker can be bound to. Default: 19999.

So, for example, this will allow you to set a specific range of ports that Ray can use, making it easier to manage and predict which ports need to be open. Here is how you can specify these options:

```auto
bash
ray start --head --port=6379 --min-worker-port=10000 --max-worker-port=10010

```

This will limit the worker ports to the range 10000-10010, and you can open these ports in your firewall settings. So if you want to limit the ports to like 41823, I guess you can set the min and max to the same number?
