# Unable to run example, returns error message

**URL:** <https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528>\
**Category:** Uncategorized\
**Created:** [February 27, 2023, 1:42am UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528 "2023-02-27T01:42:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dadi\_xuanyuan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dadi_xuanyuan/32/3976_2.png) [@dadi\_xuanyuan](https://discuss.ray.io/u/dadi_xuanyuan)\
**Post date:** [February 27, 2023, 1:42am UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528/1 "2023-02-27T01:42:49Z")

</div>

When I run this simple example, it always returns the error message.

```auto
from ray import tune
import ray

# 1. Define an objective function.
def objective(config):
    score = config["a"] ** 2 + config["b"]
    return {"score": score}

# 2. Define a search space.
search_space = {
    "a": tune.grid_search([0.001, 0.01, 0.1, 1.0]),
    "b": tune.choice([1, 2, 3]),
}

# 3. Start a Tune run and print the best result.

tuner = tune.Tuner(objective, param_space=search_space)
results = tuner.fit()
print(results.get_best_result(metric="score", mode="min").config)

```

Returned error message：

```auto
Exception: The current node has not been updated within 30 seconds, this could happen because of some of the Ray processes failed to startup.

```

What should I do to use ray？

---

<div class="post-metadata">

**Author:** ![justinvyu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/justinvyu/32/4309_2.png) [@justinvyu](https://discuss.ray.io/u/justinvyu)\
**Post date:** [February 27, 2023, 9:31pm UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528/2 "2023-02-27T21:31:01Z")

</div>

Hi @dadi_xuanyuan,

Are you running this example locally?

What’s your Ray cluster setup? What’s your OS?

---

<div class="post-metadata">

**Author:** ![dadi\_xuanyuan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dadi_xuanyuan/32/3976_2.png) [@dadi\_xuanyuan](https://discuss.ray.io/u/dadi_xuanyuan)\
**Post date:** [February 27, 2023, 11:59pm UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528/3 "2023-02-27T23:59:09Z")

</div>

Hi justinvyu ,  
My OS is windows,AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx 2.10 GHz and yes, I ran this example locally, using spyder. I am not familiar with ray tune, just ran the installer: pip install -U “ray[tune]” and ran the above example. I don’t know how to set up ray cluster, is there any easy setup example or tips?

---

<div class="post-metadata">

**Author:** ![justinvyu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/justinvyu/32/4309_2.png) [@justinvyu](https://discuss.ray.io/u/justinvyu)\
**Post date:** [February 28, 2023, 12:43am UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528/4 "2023-02-28T00:43:24Z")

</div>

Can you try [starting a local ray cluster via the command line](https://docs.ray.io/en/latest/ray-core/starting-ray.html#starting-ray-via-the-cli-ray-start), then running your script with `ray.init()` at the top?

This may be related to [[Bug] Exception: The current node has not been updated within 30 seconds, this could happen because of some of the Ray processes failed to startup. · Issue #19834 · ray-project/ray · GitHub](https://github.com/ray-project/ray/issues/19834), but it seems like a solution was not found. If you could create a new issue with a clear description of the hardware/software stack, that’d be great:

1. Python version
2. Conda?
3. Ray version
4. Hardware (GPUs?)

How are you running this on Spyder? What does that do compared to a regular python environment?

---

<div class="post-metadata">

**Author:** ![Jules\_Damji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jules_damji/32/4058_2.png) [@Jules\_Damji](https://discuss.ray.io/u/Jules_Damji)\
**Post date:** [March 14, 2023, 6:09pm UTC](https://discuss.ray.io/t/unable-to-run-example-returns-error-message/9528/5 "2023-03-14T18:09:06Z")

</div>

@dadi_xuanyuan any progress on running this locally as @justinvyu suggested?
