I have a web app that I created using Streamlit and deployed on Azure Web App Service. Previously, I did not experience any issues, but recently, after I started using @st.dialog(" ") and @st.cache_resource for logging, I began encountering an error. It’s important to note that I’m not using any fragments in my code.
Occasionally, when I open the web app, I encounter the following error:
RuntimeError: Could not find fragment with id 528f508d48a849e97fb463d969cf2108
Traceback:
File "/tmp/8dccee146dcecba/antenv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 85, in exec_func_with_error_handling
result = func()
^^^^^^
File "/tmp/8dccee146dcecba/antenv/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 560, in code_to_exec
raise RuntimeError
Interestingly, the error disappears if I refresh the page, but it tends to pop up later again. I have encountered the error in the Azure Web App log stream as well:
Connected!
2024-09-11T21:15:49 Welcome, you are now connected to log-streaming service.Starting Log Tail -n 10 of existing logs ----/appsvctmp/volatile/logs/runtime/container.log
2024-09-11T17:34:06.8741032Z raise RuntimeError(
2024-09-11T17:34:06.8741074Z RuntimeError: Could not find fragment with id 528f508d48a849e97fb463d969cf2108
Does anyone have any suggestions on how to diagnose or resolve this issue? Any insights would be greatly appreciated!
Streamlit version: Streamlit, version 1.38.0
Python version: Python 3.11.2
A dialog is a fragment, so that’s likely to be the fragment in question.
There were fragment bug fixes in both version 1.39.0 and 1.40.0. Would it be possible for you to confirm if this still happens on the latest version of Streamlit?
@mathcatsand I am currently using streamlit 1.40.0 and regularly get these errors:
Traceback (most recent call last):
File "...\streamlit\runtime\scriptrunner\script_runner.py", line 88, in exec_func_with_error_handling
result = func()
File "...\streamlit\runtime\scriptrunner\script_runner.py", line 563, in code_to_exec
raise RuntimeError(
RuntimeError: Could not find fragment with id c0737d868aa8bcf378c7f91d8bd89269
2024-12-17 10:54:25.355 Uncaught app exception
Traceback (most recent call last):
File "...\streamlit\runtime\scriptrunner\script_runner.py", line 117, in get
return self._fragments[key]
KeyError: 'c0737d868aa8bcf378c7f91d8bd89269'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "...\streamlit\runtime\scriptrunner\exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "...\streamlit\runtime\scriptrunner\script_runner.py", line 563, in code_to_exec
raise RuntimeError(
RuntimeError: Could not find fragment with id c0737d868aa8bcf378c7f91d8bd89269
Would love to know how to traceback, just getting this error is frustrating.
This happens locally for me. My code is pretty long but even a simple code like the below triggers it. At times when using nested fragments, unclear which fragment is causing the error. Very frustrating.
@st.fragment
def right_container():
st.write("**CV Section**")
if "cv_data" not in st.session_state:
st.session_state["cv_data"] = []
## cv sections
with st.expander("Contact Details"):
parts_cols = st.columns(2)
parts_cols[0].text_input("first name", placeholder="first name")
parts_cols[1].text_input("last name", placeholder="last name")
parts_cols[0].text_input("phone number", placeholder="phone number")
right_container()
What steps do I need to do to reproduce the error? I’m unable to reproduce the error with that code snippet (after adding the Streamlit import statement).
Not entirely sure. Though often it seems to occur after periods of inactivity even when the page is in current view. So if I don’t interact with the page in view (displayed on screen) for some minutes, then click a button the error comes .
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.