# Internal server error and RuntimeError on Streamlit Cloud

**URL:** <https://discuss.streamlit.io/t/internal-server-error-and-runtimeerror-on-streamlit-cloud/122897>\
**Category:** Community Cloud\
**Tags:** debugging\
**Created:** [October 20, 2026, 7:57am UTC](https://discuss.streamlit.io/t/internal-server-error-and-runtimeerror-on-streamlit-cloud/122897 "2026-10-20T07:57:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![katsshared](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@katsshared](https://discuss.streamlit.io/u/katsshared)\
**Post date:** [October 20, 2026, 7:57am UTC](https://discuss.streamlit.io/t/internal-server-error-and-runtimeerror-on-streamlit-cloud/122897/1 "2026-10-20T07:57:08Z")

</div>

If to click Chess Editor menu on the sidebar and download button then the error message: “500 Internal server error” is displayed.

Error messages:

`File "/home/adminuser/venv/lib/python3.14/site-packages/streamlit/web/server/starlette/starlette_gzip_middleware.py", line 105, in send_with_compression`

`await super().send_with_compression(message)`

`File "/home/adminuser/venv/lib/python3.14/site-packages/starlette/middleware/gzip.py", line 125, in send_with_compression`

`await self.send(message)`

`File "/home/adminuser/venv/lib/python3.14/site-packages/starlette/middleware/sessions.py", line 89, in send_wrapper`

`await send(message)`

`File "/home/adminuser/venv/lib/python3.14/site-packages/starlette/middleware/errors.py", line 161, in _send`

`await send(message)`

`File "/home/adminuser/venv/lib/python3.14/site-packages/uvicorn/protocols/http/httptools_impl.py", line 473, in send`

`raise RuntimeError(f"Expected ASGI message 'http.response.start', but got '{message['type']}'.")`

`RuntimeError: Expected ASGI message 'http.response.start', but got 'http.response.body'.`

> **[Four Chess Knights](https://four-chess-knights-hydnhexwvpyom8t88tg94v.streamlit.app/OrPlayPgnGame)**
>
> This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈

> **[GitHub - Katsshared/four-chess-knights](https://github.com/Katsshared/four-chess-knights)**
>
> Contribute to Katsshared/four-chess-knights development by creating an account on GitHub.

Python 3.13

pyvips==3.1.1  
pyvips-binary==8.18.4  
streamlit==1.58.0  
streamlit-image-coordinates==0.4.0  
stockfish==5.2.0  
python-chess==1.999  
python-gettext  
matplotlib==3.10.8  
validators==0.35.0

---

<div class="post-metadata">

**Author:** ![AgentStreamy](https://sea2.discourse-cdn.com/streamlit/user_avatar/discuss.streamlit.io/agentstreamy/32/75102_2.png) [@AgentStreamy](https://discuss.streamlit.io/u/AgentStreamy)\
**Post date:** [October 20, 2026, 7:57am UTC](https://discuss.streamlit.io/t/internal-server-error-and-runtimeerror-on-streamlit-cloud/122897/2 "2026-10-20T07:57:25Z")

</div>

Welcome to the Streamlit community and thanks for your detailed question! 😊 The error “500 Internal server error” with the traceback involving starlette\_gzip\_middleware and ASGI message types is a known issue that can occur with certain Streamlit and Python versions, especially when using binary file downloads or custom components. This is often triggered by incompatibilities between Streamlit, Starlette, and Uvicorn, or by the way file downloads are handled in the app code.

A similar error was reported and fixed in Streamlit 1.61.1, so upgrading Streamlit to the latest version is recommended. Your current setup uses streamlit==1.58.0 and Python 3.13, which may not be fully compatible with all dependencies. Also, ensure that your download logic uses st.download\_button and that files are read fully into memory before passing to the button, as issues can arise if file handles are not managed correctly or if the file is not available at the time of the HTTP request. For more, see the [Streamlit download docs](https://docs.streamlit.io/knowledge-base/using-streamlit/how-download-file-streamlit) and [related GitHub issue](https://github.com/streamlit/streamlit/issues/16358).

Sources:

- [Streamlit 1.61 runs into error when launching streamlit hello: connection failed with status 500](https://github.com/streamlit/streamlit/issues/16358)
- [Streamlit download docs](https://docs.streamlit.io/knowledge-base/using-streamlit/how-download-file-streamlit)

---

<div class="post-metadata">

**Author:** ![katsshared](https://avatars.discourse-cdn.com/v4/letter/k/e480ec/32.png) [@katsshared](https://discuss.streamlit.io/u/katsshared)\
**Post date:** [October 20, 2026, 8:21am UTC](https://discuss.streamlit.io/t/internal-server-error-and-runtimeerror-on-streamlit-cloud/122897/3 "2026-10-20T08:21:35Z")

</div>

After updating Streamlit to version 1.61.1 got an error message:

```auto

```

`ImportError: cannot import name 'UseColumnWith' from 'streamlit.elements.image'`

`(/home/adminuser/venv/lib/python3.14/site-packages/streamlit/elements/image.py)`

The module streamlit\_image\_coordinates is developed by Streamlit team. What to do? Is there a new version that works?

streamlit-image-coordinates==0.4.0
