St.plotly_chart throws attribute error in Cloud Run and not in Community Cloud

I decided to deploy our dashboard on Cloud run in a docker container. I got it working but it throws an error in plotly_chart that it does not throw in community cloud. As far as I can see, its not in my code.

AttributeError
Traceback:
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py”, line 600, in _run_script
exec(code, module.dict)
File “/cl-dashboard-internal/pages/27_Engagement_Improvement.py”, line 60, in
uic.funnel_change_by_language_chart(
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py”, line 165, in wrapper
return cached_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py”, line 196, in call
return self._get_or_create_cached_value(args, kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py”, line 221, in _get_or_create_cached_value
return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/cache_utils.py”, line 277, in _handle_cache_miss
computed_value = self._info.func(*func_args, **func_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/cl-dashboard-internal/ui_components.py”, line 682, in funnel_change_by_language_chart
st.plotly_chart(fig, use_container_width=True)
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/metrics_util.py”, line 397, in wrapped_func
result = non_optional_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/elements/plotly_chart.py”, line 527, in plotly_chart
return self.dg._enqueue(“plotly_chart”, plotly_chart_proto)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/streamlit/delta_generator.py”, line 486, in _enqueue
caching.save_element_message(
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/init.py”, line 47, in save_element_message
CACHE_DATA_MESSAGE_REPLAY_CTX.save_element_message(
File “/usr/local/lib/python3.12/site-packages/streamlit/runtime/caching/cached_message_replay.py”, line 314, in save_element_message
raise AttributeError

Hi! I’m facing the same problem, did you find a fix for it? I temporarily removed caching but that is not ideal…

Removed

@st.cache_data(ttl="3h")
def ...

I did not get an answer, and suspected if I removed that too it would go away, but this feature really needs caching - it has some long compute times.

Oh, and it actually is throwing the error in both platforms.

This was found to be a bug and will be fixed in Streamlit 1.36