I have an app deployed with Digital Ocean, using Streamlit 1.30.0 and Python 3.10.0. I am having some trouble debugging “AxiosError: Network Error”. Here is the code to upload the file.
uploaded_file = st.file_uploader("Upload initial data for the new dataset",
type=['csv', 'xlsx'], disabled=not valid_dataset_name(new_dataset_name))
if uploaded_file:
try:
progress_text = "Uploading dataset file."
uploads_progress = st.progress(10, text=progress_text)
# Check the type of file.
if uploaded_file.type == "text/csv":
data = pd.read_csv(uploaded_file, header=0)
elif uploaded_file.type == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":
data = pd.read_excel(uploaded_file, header=0, sheet_name=None)
data = pd.concat(data.values(), ignore_index=True)
When I upload a small file (around) 65 KB, the behavior is as expected; however, if the file to be uploaded is considerably larger (around 1.1GB), it yields “AxiosError: Network Error”, as shown below.
I think this could be a limitation of a allowed packet size between your app and NGINX on Digital Ocean. I faced a similar problem on one of my app deployed on Kubernetes and I had to increase the limits on NGINX to allow a bigger file to be uploaded. I had made changes on the ingress yaml as below to allow files upto 200 MB.
I’ve also experienced this, for an Excel file that is 100MB in size.
Hosted on Azure Web Service.
However, when debugging, I’m not able to replicate the bug. I have tried using a different laptop and also tried another wifi network, but neither gave me the AxiosError. It still showed AxiosError on the previous laptop though.
I restarted the laptop with AxiosError, and it miraculously disappeared. Not sure where the bug is coming from…?
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.