Streamlit Application multiple UI bugs solved by an unidentified config in streamlit

Hello, I have a question. I am developing a Streamlit application in AWS hosted on ECS.
At first, I was running on version 1.29.0, which is very old, so I migrated to the latest version(as of today, it is 1.49.0)

In my application, I am deploying a chat interface with AWS Bedrock with chat history, user management, and file uploads.

After initial redeployment, I fixed the first issues I had until I got into other UI bugs, and I could not determine what was the root cause for them.

for example:

  • I had user sessions created, and when I was creating a new session, the UI represented the previous session

  • File uploads did not work at all (I was uploading a file, and it did not even show that it was uploaded)

  • Logging out kept the user input on the screen at the login page

  • The custom theme I set in config.toml did not work

When I looked into the logs of the ECS, it showed me an error:

OSError: [Errno 30] Read-only file system: '/home/nonroot/.streamlit/machine_id_v4'

I did not understand what this file was, so I recreated the solution hosted on an EC2 in the Amazon Linux 2 distro.

In there, I saw that in my home dir a file called machine_id_v4 under .streamlit was created, and it contained a UUID value in it. I added to the Docker file this “machine_id_v4” file
via command: COPY machine_id_v4 /root/.streamlit/machine_id_v4
With the same UUID value, and for some reason, all the bugs I mentioned above here disappeared, and the application worked fine.

I want to know if anyone stumbled upon issues close to mine, and if someone can explain what this file is because nothing on Google search helped me to find out, nor issues here, and how it was connected to the UI bugs I had.

I am quite new to Streamlit, so maybe there is something I missed here.

I am now quite sure how to reproduce this issue since I do not understand what this file is and how it is connected to the Streamlit application structure.