0

I am trying to tackle an issue I am where uploading files on a web-app that are above 30 MB are receiving a gateway timeout error.

Prior to that, the system was receiving a 404.13 Error, so I changed the web.config file to support much larger files by changing the maxAllowedContentLength, this had worked initially. However, now it is receiving that 504 Error.

The way the system works:

  1. A file is selected and uploaded to the web app using a third party uploader tool (this part works without issues).

  2. That (IFormFile) is then processed by the web app to determine what type of file it is, and how to process it.

  3. Once complete, that file stream is sent to an Amazon S3 bucket in a PutObjectAsync request.

I believe the issue is occurring on step three, but this is hard to diagnose as it does not occur in a local environment. What is strange is that I can upload a 29 MB file without issue, and it is processed quickly, but the moment I go above that, it seems to hang on that last step. Has anyone had a similar issue before? What steps did you take to resolve it?

Edit: Previously 404.13 error.

Vy Do
  • 46,709
  • 59
  • 215
  • 313
  • Check the 2nd answer here https://stackoverflow.com/questions/38698350/increase-upload-file-size-in-asp-net-core – Roman Ryzhiy Sep 03 '20 at 14:41
  • Thanks Roman, I have tried this already. Like I said, that fixed the initial 404 error, but I am receiving the 504 now. – Lucas Trestka Sep 03 '20 at 14:46
  • Does this answer your question? [Multipart body length limit exceeded exception](https://stackoverflow.com/questions/40364226/multipart-body-length-limit-exceeded-exception) – Roar S. Sep 03 '20 at 14:51
  • 1
    You are doing all those actions in your controller endpoint? Time it with a stop watch. I bet you it's dying around the 2 minute mark every time. Try it with a 50 MB file to ensure consistency. – Andy Sep 03 '20 at 15:27
  • how are you hosting it? iis? – Daniel A. White Sep 03 '20 at 16:56
  • IIS has a default file limit of 30MB, you can change it, follow this : https://stackoverflow.com/a/18531025/2514526 – Samuel Rondeau-Millaire Sep 03 '20 at 20:10

1 Answers1

0

We figured out that the issue was not related to IIS or AWS directly. Instead, we were encoding video files into a desired format on the server prior to upload to AWS S3. This process took too long for larger files, and resulted in the Gateway timeout error.

Andy, you were correct. It was happening at exactly the two minute mark, that is (default) what we have the server timeout configured to.