Re: "413 Request Entity Too Large" Shopify blocking requests over 1MB?

Solved

"413 Request Entity Too Large" Shopify blocking requests over 1MB?

noahfromfolds
Shopify Partner
17 2 6

I'm uploading files to my server using axios, and it works perfectly on requests under 1MB.

However, when I upload over 1MB to my server in a single request my request is blocked and a 413 error is thrown. It shows it's from NGINX in the response:

response (1).png

The request doesn't reach my server and is blocked client side. Any help would be appreciated.

Founder / CEO of Folds Page Builder | Available for free at: https://apps.shopify.com/folds
Accepted Solutions (2)

Morek
Shopify Partner
835 73 176

This is an accepted solution.

Hi @noahfromfolds 

Hope you're having a great day!

You said you were uploading files to your server. So this error has nothing to do with Shopify but rather your server.

Take a look at the Shopify file uploading requirements:

Uploading-and-managing-files-·-Shopify-Help-Center.png

The 413 status code indicates that the request was larger than the server can handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.

You should increase the value of parameters memory_limit, post_max_size, or upload_max_filesize in your server configuration.

If you found this comment useful, hit the 'Like' and 'Accepted solution' buttons.

If you're looking for a Shopify developer or just want to connect, don't hesitate to reach out!
Portfolio: https://mmorek.com/
LinkedIn: https://www.linkedin.com/in/mmorek
WhatsApp: Whatsapp me!

View solution in original post

noahfromfolds
Shopify Partner
17 2 6

This is an accepted solution.

After countless days of debugging I finally figured it out. I even started to refactor my entire code just to figure it where it was coming from.

Just like after figuring out most bugs, I feel like it was under my nose the entire time.

Shopify serve wasn't working properly for me a few days ago so I switched to a local tunnel package: http://localtunnel.github.io/www/. I only did some tests a day later with uploads so I didn't realize it was coming from that package.

Localtunnel was blocking all the requests over 1 MB, and once I switched back to ngrok everything worked perfectly. I was correct with the assumption the error was not coming from my application, however I incorrectly guessed it was Shopify when it was actually the local tunnel package.

Thank you for the help @Morek, I appreciate it 🙂

Founder / CEO of Folds Page Builder | Available for free at: https://apps.shopify.com/folds

View solution in original post

Replies 3 (3)

Morek
Shopify Partner
835 73 176

This is an accepted solution.

Hi @noahfromfolds 

Hope you're having a great day!

You said you were uploading files to your server. So this error has nothing to do with Shopify but rather your server.

Take a look at the Shopify file uploading requirements:

Uploading-and-managing-files-·-Shopify-Help-Center.png

The 413 status code indicates that the request was larger than the server can handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.

You should increase the value of parameters memory_limit, post_max_size, or upload_max_filesize in your server configuration.

If you found this comment useful, hit the 'Like' and 'Accepted solution' buttons.

If you're looking for a Shopify developer or just want to connect, don't hesitate to reach out!
Portfolio: https://mmorek.com/
LinkedIn: https://www.linkedin.com/in/mmorek
WhatsApp: Whatsapp me!
noahfromfolds
Shopify Partner
17 2 6

This is an accepted solution.

After countless days of debugging I finally figured it out. I even started to refactor my entire code just to figure it where it was coming from.

Just like after figuring out most bugs, I feel like it was under my nose the entire time.

Shopify serve wasn't working properly for me a few days ago so I switched to a local tunnel package: http://localtunnel.github.io/www/. I only did some tests a day later with uploads so I didn't realize it was coming from that package.

Localtunnel was blocking all the requests over 1 MB, and once I switched back to ngrok everything worked perfectly. I was correct with the assumption the error was not coming from my application, however I incorrectly guessed it was Shopify when it was actually the local tunnel package.

Thank you for the help @Morek, I appreciate it 🙂

Founder / CEO of Folds Page Builder | Available for free at: https://apps.shopify.com/folds
Morek
Shopify Partner
835 73 176

Hi @noahfromfolds 

Hope you're having a great day!

You're welcome. I'm happy you've found a solution.

Have a good luck.

If you're looking for a Shopify developer or just want to connect, don't hesitate to reach out!
Portfolio: https://mmorek.com/
LinkedIn: https://www.linkedin.com/in/mmorek
WhatsApp: Whatsapp me!