FastAPI root_path "/" killed my haystack rest_api Docker deployments #6766
-
Hi @ZanSara, In short: Suddenly the REST API responded "Not Found" to each and every request. When digging deeper, I noticed, that setting root_path="/" for FastAPI requires a double slash to access all the routes. Here are examples (notice the double slashes in the last curl command):
Maybe it helps? Maybe I am doing something wrong? (Could be a change in FastAPI's behaviour?) Best, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
Hello! This seems definitely to be a change in FastAPI, specifically in Starlette. I might have found even the PR that introduces this change: encode/starlette#2400 I'm surprised it wasn't highlighted more on their end, since it seems to be a breaking change. It might be worth letting them know about your setup and the fact that the recent release broke it. |
Beta Was this translation helpful? Give feedback.
-
Hey @ZanSara and @TobiasOtto - a user on Discord also experienced something similar with FastAPI and found a solution as far as I know. I will ask them whether they can check out this discussion. |
Beta Was this translation helpful? Give feedback.
-
Hey Tobias, But if you're using pre-baked Docker Image, then no it's not possible to do I guess. |
Beta Was this translation helpful? Give feedback.
-
Update @TobiasOtto Seems that there was a breaking change in fast API, additionally, my bad, but seems you and @lambda-science are on different Haystack versions so you are actually talking about the Haystack Rest API that comes with 1.x.. For 1.x, we're pinning the fast API version now for Edit: It's pinned now 👍 |
Beta Was this translation helpful? Give feedback.
-
Thanks for all your answers :-) |
Beta Was this translation helpful? Give feedback.
Update @TobiasOtto
Seems that there was a breaking change in fast API, additionally, my bad, but seems you and @lambda-science are on different Haystack versions so you are actually talking about the Haystack Rest API that comes with 1.x..
For 1.x, we're pinning the fast API version now for
rest_api
and you can retry once that's done. Hopefully this will fix your issue..Edit: It's pinned now 👍