Oh no. Error running app. Sudden change in app performance without changing code

Hey there, thanks for sharing your question and all those troubleshooting steps! :blush: It sounds like your Streamlit app is running into resource limits or possibly a memory leak, especially since it gets stuck during Excel file creation and then crashes with the “Oh no. Error running app.” message. This is a common issue on Streamlit Community Cloud, even if your files are well below the upload limit. The error and “Connecting…” status typically indicate your app is exceeding the platform’s memory (2.7GB max), CPU, or storage limits, or possibly hitting a bug in the latest Streamlit version. Rebooting and clearing cache are good first steps, but if the underlying issue persists (like a memory leak or inefficient data handling), the app will crash again after a short time.

To address this, try the following:

  • Use st.cache_data or st.cache_resource to cache expensive computations or data/model loading, so they only run once per session.
  • Profile your app’s memory usage to identify leaks or heavy operations (see resource limits guide and common app problems: resource limits).
  • Move large datasets or intermediate results to a database or external storage if possible.
  • Restrict cache size with ttl or max_entries to avoid unbounded memory growth.
  • If you’re using pandas/openpyxl to generate Excel files, ensure you’re not holding large DataFrames in memory longer than needed.
  • If the problem persists, try simplifying the Excel generation logic or splitting it into smaller steps.
  • For more persistent issues, deleting and redeploying the app sometimes helps clear stuck states.
    If you can, please share a minimum reproducible example (with dummy data) so the community can help debug further. Community members—feel free to jump in with your insights!

Sources: