Error with st.fragment

If you’re creating a debugging post, please include the following info:

  1. Are you running your app locally or is it deployed?
  2. If your app is deployed:
    a. Is it deployed on Community Cloud or another hosting platform?

b. https://www.luzhishen.chat
3. Share the link to your app’s public GitHub repository (including a requirements file).
4. 2024-11-14 11:30:10.596 Uncaught app exception
Traceback (most recent call last):
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/fragment.py”, line 117, in get
return self._fragments[key]
~~~~~~~~~~~~~~~^^^^^
KeyError: ‘57651bf8044d637daa5479a771319387’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 550, in code_to_exec
wrapped_fragment = self._fragment_storage.get(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/fragment.py”, line 119, in get
raise FragmentStorageKeyError(str(e))
streamlit.errors.FragmentStorageKeyError: “‘57651bf8044d637daa5479a771319387’”

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/exec_code.py”, line 88, in exec_func_with_error_handling
result = func()
^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 563, in code_to_exec
raise RuntimeError(
RuntimeError: Could not find fragment with id 57651bf8044d637daa5479a771319387
.
5. Share the Streamlit and Python versions.

This issue may be the same reported here:

It got some attention by the Streamlit team here:

In my case, I get this error when interacting with a fragment after restarting the Streamlit app. @raethlein had recommended using a try/except around the fragment to contain the blast radius, however, that is not working for me.

Streamlit v1.40.1

1 Like