Multiple file uploads - failed to load resource (400/502)

Summary

We’re using a file upload widget with accept_multiple_files=True and sporadically getting either:

Failed to load resource: the server responded with a status of 400 (Invalid session_id: <number here>)
or
Failed to load resource: the server responded with a status of 502 (Bad Gateway)

while trying to upload several files (several being anything above ~10). Files are Fastq (.gz) files, the largest of which is ~85mb (our max file upload size is set to 200mb). Failures are sporadic but is seemingly dependent on the number of files uploaded.

The app is currently deployed to AWS as an auto-scaled and load-balanced ElasticBeanstalk application. We have tried enabling sticky sessions based on a similar issue here: st.file_uploader returns HTTP code 400 with invalid session_id when deployed on Kubernetes · Issue #4173 · streamlit/streamlit · GitHub with no luck.

Is this a misbehavior of the file upload widget itself when handling several files? Just looking for some direction for this :slightly_smiling_face:. Thanks!

Steps to reproduce

Code snippet:

selected_files = st.file_uploader("Select Fastq file pairs for upload:", help="Each pair must contain R1 + R2 files", type="gz", accept_multiple_files=True)

Once selected files are populated, the user clicks an Upload button that reads the files into temporary storage, among a few other checks for correct filename info, etc. This part is not coming into play because the files are not passing the file_uploader portion.

Debug info

  • Streamlit version: 1.13.0
  • Python version: 3.10.8

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.