# AttributeError In serve.deployment due to Starlette change

**URL:** <https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461>\
**Category:** Ray Serve\
**Created:** [January 18, 2024, 5:36pm UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461 "2024-01-18T17:36:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![goldenbear10](https://avatars.discourse-cdn.com/v4/letter/g/bbe5ce/32.png) [@goldenbear10](https://discuss.ray.io/u/goldenbear10)\
**Post date:** [January 18, 2024, 5:36pm UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/1 "2024-01-18T17:36:16Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

When I was going through the example [deployment here](https://docs.ray.io/en/latest/ray-air/examples/gptj_serving.html), I encountered the following error:

```auto
(ProxyActor pid=72777) Exception raised in creation task: The actor died because of an error raised in its creation task, ray::SERVE_CONTROLLER_ACTOR:SERVE_PROXY_ACTOR-ad75394cb4890da5d959354be7dbb3b11222d6a38aee9a4a7e4cbc17:ProxyActor. __init__ () (pid=72777, ip=127.0.0.1, actor_id=e32e002ebd1165433748a33501000000, repr=<ray.serve._private.proxy.ProxyActor object at 0x117b33af0>)
(ProxyActor pid=72777) File "/Users/stuartjaffe/miniforge3/envs/ray_mlflow/lib/python3.9/concurrent/futures/_base.py", line 446, in result
(ProxyActor pid=72777) return self.__get_result()
(ProxyActor pid=72777) File "/Users/stuartjaffe/miniforge3/envs/ray_mlflow/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
(ProxyActor pid=72777) raise self._exception
(ProxyActor pid=72777) File "/Users/stuartjaffe/miniforge3/envs/ray_mlflow/lib/python3.9/site-packages/ray/serve/_private/proxy.py", line 1202, in __init__
(ProxyActor pid=72777) self.wrapped_http_proxy, **middleware.options
(ProxyActor pid=72777) AttributeError: 'Middleware' object has no attribute 'options'

```

This occurred on a M1 Mac (via miniforge) and on a AWS Linux EC2 instance. I figured it was an issue with `Starlette` and downgraded to `Starlette v0.34.0` and the issue went away. Could you look into this bug? It seems that with `Starlette v0.35.0` [there was an update](https://github.com/encode/starlette/pull/2381) to the Middleware that is causing the issue. Thanks!

---

<div class="post-metadata">

**Author:** ![Sihan\_Wang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sihan_wang/32/2570_2.png) [@Sihan\_Wang](https://discuss.ray.io/u/Sihan_Wang)\
**Post date:** [January 18, 2024, 5:39pm UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/2 "2024-01-18T17:39:14Z")

</div>

Hi @goldenbear10 , we will fix the starlette issue in ray 2.10. Thank you for raising the issue!

---

<div class="post-metadata">

**Author:** ![muhajirdev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/muhajirdev/32/5633_2.png) [@muhajirdev](https://discuss.ray.io/u/muhajirdev)\
**Post date:** [January 20, 2024, 2:57am UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/3 "2024-01-20T02:57:19Z")

</div>

When will 2.10 be released?

In the meantime, what’s a good way to fix this issue? thank you

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/juan/32/5670_2.png) [@Juan](https://discuss.ray.io/u/Juan)\
**Post date:** [January 29, 2024, 1:18am UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/4 "2024-01-29T01:18:21Z")

</div>

Getting this same issue just today. is there any way to fix the option error ?  
AttributeError: ‘Middleware’ object has no attribute ‘options’

---

<div class="post-metadata">

**Author:** ![eoakes](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/eoakes/32/7825_2.png) [@eoakes](https://discuss.ray.io/u/eoakes)\
**Post date:** [January 29, 2024, 2:23am UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/5 "2024-01-29T02:23:41Z")

</div>

Hi folks, this will be fixed in an upcoming 2.9.2 release. In the meantime you can downgrade starlette and things should work as expected: `pip install "starlette<=0.34.0"`.

---

<div class="post-metadata">

**Author:** ![brandonscript](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/brandonscript/32/5677_2.png) [@brandonscript](https://discuss.ray.io/u/brandonscript)\
**Post date:** [January 29, 2024, 8:53pm UTC](https://discuss.ray.io/t/attributeerror-in-serve-deployment-due-to-starlette-change/13461/6 "2024-01-29T20:53:06Z")

</div>

Great to hear, waiting for 2.10 would have been a wee bit heavy-handed 😉

Thank you!
