New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 health check when navigating directly to a subpage #7074
Comments
Hey @Raytray, thanks for reporting this! This is behavior that's known but unfortunately a bit tricky to fix. The main difficulty is that making these endpoint calls tied to the root can be hard as it's not always entirely clear what the root of an app is in every deployment scenario. For example, a Streamlit app being served behind a reverse proxy (that may be transparent to the streamlit server/client) with root at Of course, if we have enough people complaining that this additional 404 when navigating directly to a subpage is a huge issue for their apps, we can bump up the priority on this. |
What are the consequences of the 404s? Is there a loss of functionality? If not, why are these endpoints called to begin with? I'm trying to track down badly behaving subpages, and hope to rule out these 404s. |
This ends up causing pages to refresh constantly due to those 404s. Is there any workaround? Other than making sure people don't navigate straight to a sub-page? |
we are actually having bad user experience due to 400 on |
I can see also that the content of _stcore/host-config is |
we have deployed streamlit in ecs task behind a load balancer. Is it enough to open only 443 port? I would say yes give that it works in a freshly open browser but then it gets stuck on 400 on wss if streamlit is redeployed |
the response is a 400 bad request |
It might be the same root cause that prevents my app to load static files when (including main.js) when the user refreshes a page with browser refresh.
I am not sure why is this issue just popped up, but it used to work fine, and in fact, on other pages of the same app the static files are loaded from the correct URLs and without error:
If we cannot expect a fix for this bug, I would really appreciate some help how to work around the issue (I cannot tell all my users to visit the root of the app, and also cannot tell them not to use browser refresh on a page) For context
|
Checklist
Summary
On multiple page applications, when navigating directly to a subpage, the healthcheck and allowed message origins check is issued twice.
https://doc-mpa-hello.streamlit.app/Mapping_Demo?utm_medium=oembed page will receive 404 on the following
https://doc-mpa-hello.streamlit.app/~/+/Mapping_Demo/_stcore/health
https://doc-mpa-hello.streamlit.app/~/+/Mapping_Demo/_stcore/allowed-message-origins
and 200 OK on
https://doc-mpa-hello.streamlit.app/~/+/_stcore/health
https://doc-mpa-hello.streamlit.app/~/+/_stcore/allowed-message-origins
Reproducible Code Example
No response
Steps To Reproduce
Expected Behavior
Expected to only see the 200 OK requests and those 404 requests to never be made.
Current Behavior
Currently see two 404 requests and two 200 requests.
404 on the following
https://doc-mpa-hello.streamlit.app/~/+/Mapping_Demo/_stcore/health
https://doc-mpa-hello.streamlit.app/~/+/Mapping_Demo/_stcore/allowed-message-origins
and 200 OK on
https://doc-mpa-hello.streamlit.app/~/+/_stcore/health
https://doc-mpa-hello.streamlit.app/~/+/_stcore/allowed-message-origins
Is this a regression?
Debug info
No response
Additional Information
Maybe solved by making these two consts tied to the root and not relative?
streamlit/frontend/app/src/connection/WebsocketConnection.tsx
Lines 48 to 53 in d6d8f62
The text was updated successfully, but these errors were encountered: