I’m a DevOps engineer working with AWS cloud, and I’m following a project where I need to deploy a Streamlit application on Internet through AWS.
We got the error: “Error: Request failed with status code 403” after uploading a file through the file_uploader. It turns out that the error was the Application Load Balancer in front of the server hosting Streamlit. The Application Load Balancer was protected by Web Application Firewall rules, and one of these blocks all the packets that has a body larger than 8 KB (typical of file upload). The name of the AWS WAF rule was SizeRestrictions_BODY.
By disabling this rule, everything worked fine. Don’t know if this can be helpful for whoever has issues in exposing Streamlit from cloud environments.
Do you have anything between your app and the users on Azure?
Try turning off XSRF protection by adding:
[server]
enableXsrfProtection = false
to streamlit/config.toml, or --server.enableXsrfProtection=false to the run command. Note that this is not really a recommended long-term / production use; I figure I am safe enough just by having an AD authentication requirement and a small & trusted user pool.
Here are some other topics on the problem, including my own. I have not been able to get a satisfying solution yet:
I have a low-confidence suspicion that this is caused by the _xsrf token not getting through. I opened up an issue here but I might be way off my base as webdev stuff is not my forte.
The same is here. First time in Streamlit and want to deploy a new project but get an error-Request failed with status code 403. Did anyone have a solution? I’ve tried to clear cache, it doesn’t help
Just started with streamlit and python , I am running the streamlit app locally but whenever I try to upload a pdf it gives me a error saying it is forbidden with the error code 403 , Can anyone help me out with this problem
Hello @Charly_Wargnier Streamlit Team, I am also facing the same issue , is there any bug in it, as per the previous comment you have mentioned regarding the url change and other thing. How do we get it resolved. Thanks in advance for help.
I have encountered the same issue AxiosError: Request failed with status code 403 for CSV uploads. This happened once I upgraded from 1.29 to 1.30. I have downgraded for now.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.