File upload cancels with timeout for large files

Roland Kirpal asked on March 16, 2016 10:35

Hello,

When I upload large files (more than 200 MB) as a file page in the Kentico page tree, the upload cancels after a while with a timeout error.

This is the error message I get:

[DataConnection.HandleError]: 

Query: 

INSERT INTO CMS_Attachment ([AttachmentName], [AttachmentExtension], [AttachmentSize], [AttachmentMimeType], [AttachmentBinary], [AttachmentImageWidth], [AttachmentImageHeight], [AttachmentDocumentID], [AttachmentGUID], [AttachmentLastHistoryID], [AttachmentSiteID], [AttachmentLastModified], [AttachmentIsUnsorted], [AttachmentOrder], [AttachmentGroupGUID], [AttachmentFormGUID], [AttachmentHash], [AttachmentTitle], [AttachmentDescription], [AttachmentCustomData], [AttachmentSearchContent]) VALUES (@AttachmentName, @AttachmentExtension, @AttachmentSize, @AttachmentMimeType, @AttachmentBinary, @AttachmentImageWidth, @AttachmentImageHeight, @AttachmentDocumentID, @AttachmentGUID, @AttachmentLastHistoryID, @AttachmentSiteID, @AttachmentLastModified, @AttachmentIsUnsorted, @AttachmentOrder, @AttachmentGroupGUID, @AttachmentFormGUID, @AttachmentHash, @AttachmentTitle, @AttachmentDescription, @AttachmentCustomData, @AttachmentSearchContent); SELECT SCOPE_IDENTITY() AS [ID]

Caused exception: 

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

My problem is like this:

https://devnet.kentico.com/forums/f52/fp6/t17663/upload-file-timing-out-%28even-with-maxrequestlen

I did as the article mentioned. I also read this article:

https://devnet.kentico.com/articles/few-hints-for-large-file-uploads,-authentication-cookies-and-advice-of-delivery

I changed my web.config to the following settings:

<httpRuntime executionTimeout="60000" maxRequestLength="2097151"/>

and also added

  <security>
    <requestFiltering>
      <requestLimits maxAllowedContentLength="2147483648"/>
    </requestFiltering>
  </security>

Nevertheless, I still get timeouts when uploading files. Are any more settings in the web.config that could lead to this timeout? I'm no expert with web.config.

Any help is appreciated.

Thank you, Roland

Correct Answer

Dawid Jachnik answered on March 16, 2016 13:24

Hello,

i think with asp.net you have everything correct, the error you show means that timeout is on the database not on server level. Do you have good connection between application server and database ?

Maybe try increase the database timeout in connection string,

5 votesVote for this answer Unmark Correct answer

Recent Answers


Roland Kirpal answered on March 16, 2016 15:18 (last edited on March 16, 2016 15:18)

Hello Dawid,

Thank you for your valuable advice!

After increasing all timeouts it seems that increasing the connection string timeout did the trick.

Again thanks alot for your help! :)

Roland

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.