File upload error - AxiosError: Request failed with status code 500

I just had an error when upload a xlsx file. it shows error " AxiosError: Request failed with status code 500". My app is working well on 7/27 but there must be some overnight changes that trigger this one.

The strange thing is there is NO error if I run it on Firefox. Chrome and Edge both have this error…any help? And I tried to downgrade to version 1.23 and 1.24, both are not working.

I get same error. However the situation is different.

When I try to upload from app hosted at streamlit.io , everyting works fine.

Soon as when I upload from a wordpress page hosted on a different domain, which embed this app, things does NOT work.

And I get exact same error.

Anyone knows what could be wrong ?

Could this because

Hi @Dawei @John_K, :wave:

Thanks for reporting this behavior.

I’m not too sure, so I’ve sent it to the devs. Please bear in mind that you may not have a response before Monday.

Thanks for your patience!

Charly

Hi @Charly_Wargnier,

Having the same issue. I have 2 separate frontends (one is react hosted on AWS amplify and the other is nextjs hosted on vercel). Each embeds a streamlit app, which itself requires a file upload. Up till a few days ago, these were working normally. But for some reason, now I also get the same error - “AxiosError: Request failed with status code 500”. The timeline seems to match what @John_K reported above. Is this a streamlit cloud side issue or something I have to change in my app?

Thank you!

Most probably code issue/changes from Streamlit Cloud side. We’re still investigating.

Thanks for your patience,

Best,
Charly

1 Like

Any resolution with this? I’m getting the same error

Same story here, upload form is working on Firefox but not on Chrome/Edge (on Windows 10, but other users experienced the same behaviour on mobile browsers).

Hi @shivam-singhal / @nzylakffa,

I’ve liaised with the devs and the issue is still under investigation.

We’ll come back to you as soon as we have more information on a resolution.

Thanks for your patience,

Best,
Charly

Hey @shivam-singhal ,

I’ve tried this feature out and it works fine on React or Next-based interfaces. Feel free to check out my project here with that same feature enabled: https://pneumoscan.vercel.app/

The code chunk I used to embed it had an api query of embedded set to true: > <iframe

      className="mt-4 w-full h-screen"
      src={"https://devtechjr-pneumoscan-model-app-drswsb.streamlit.app/?embedded=true"}
    ></iframe>

Please try this out and let me know if it works!

Hope this helped!

any update on this problem? I use iframe and put it on 2 websites, all resulted errors, but works normally on streamlit cloud.

1 Like

@faizhalas @Anirudh_Vangara @piclem

I’ve liaised with our devs and requested an update.

Thank you for bearing with us! :slight_smile:

Charly

1 Like

Thank you sir!

1 Like

@000 @faizhalas @Anirudh_Vangara @piclem

Some feedback from @kajarenc, one of our Software engineers:

After investigation, my best understanding is that file_uploader fails for apps deployed in Streamlit Cloud because of a misconfigrued _xsrf token, the interesting thing is that xsrf protection is disabled for all Cloud apps, but for some reason old apps still running with --enableXsrfProtection=true and just rebooting it doesn’t change it. But creating a container from scrach (attempt to deploy that app with a different domain?) solves that problem.

So the solution for Streamlit Cloud apps will be either try to redeploy the app (not just reboot), or explicitly specify:

[server] enableXsrfProtection = false

in app config.toml

If you’re still facing the issue, could you please try one of these solutions?

Best,
Charly

2 Likes

problem solved sir!