When using Community Cloud and streamlit==1.56.0 , I often get this message in the terminal. It doesn’t seem to hurt the app, but is there anything to do to avoid having that message print out?
2026-06-02 05:10:36.284 MediaFileHandler: Missing file 98db75f85e010fed2d6bd7ee98bece6c7fc096c0a40ecdc08b180995.png
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/memory_media_file_storage.py", line 152, in get_file
return self._files_by_id[file_id]
~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: '98db75f85e010fed2d6bd7ee98bece6c7fc096c0a40ecdc08b180995'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/adminuser/venv/lib/python3.14/site-packages/streamlit/web/server/media_file_handler.py", line 95, in validate_absolute_path
self._storage.get_file(absolute_path)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/home/adminuser/venv/lib/python3.14/site-packages/streamlit/runtime/memory_media_file_storage.py", line 154, in get_file
raise MediaFileStorageError(
f"Bad filename '{filename}'. (No media file with id '{file_id}')"
) from e
streamlit.runtime.media_file_storage.MediaFileStorageError: Bad filename '98db75f85e010fed2d6bd7ee98bece6c7fc096c0a40ecdc08b180995.png'. (No media file with id '98db75f85e010fed2d6bd7ee98bece6c7fc096c0a40ecdc08b180995')
Hey there, thanks for bringing this up and welcome to the Streamlit community!
This “MediaFileHandler: Missing file” message means Streamlit is trying to serve a media file (like an image) that no longer exists in its in-memory storage. This is common on Community Cloud, especially if files are dynamically generated or uploaded, since files in memory are cleared on app reruns, user disconnects, or when the app goes to sleep. It usually doesn’t break your app, but it does clutter your logs.
To avoid this, make sure any files you want to serve are either:
- Stored in your repo (for static files), or
- Saved to a persistent external storage (like S3) and referenced by URL, or
- Served from the
./static/ directory with static file serving enabled (see docs).
If you’re generating files on the fly, consider using in-memory objects (like BytesIO) directly with Streamlit elements, and avoid referencing files by filename after a rerun. For more details on why this happens and best practices, check out the Streamlit architecture docs.
If you have a minimum reproducible example or a public repo, please share it so the community can help debug further! And if anyone else has tips or workarounds, feel free to jump in! 
Sources:
What Gemini told me when I asked about the same issue with my app (after I kept getting the error despite fixing all of the supposed possible issues) is that it’s almost certainly a web crawler pinging for an image (in my case, the site logo and favicon) that is or was hosted on Github and thus dynamically named by Streamlit – the “or was” being relevant because even after I switched from a local file to a static URL, I keep occasionally getting the error. Not sure if there’s a way to fix the problem.