Getting Error on Kendo UI Folder Upload - ERR_HTTP2_PROTOCOL_ERROR

3 Answers 1631 Views
Upload
swapnil
Top achievements
Rank 1
Iron
swapnil asked on 25 May 2021, 12:24 AM

I am using Telerik Kendo File Upload for uploading folder. In Production environment, few users are complaining issue with Folder Upload, during upload few files get errored out, using Developer tool in the console tab it logs "ERR_HTTP2_PROTOCOL_ERROR" error as attached for the failed files.

When i am trying i am not getting this error and all folders are getting uploaded properly. I asked user to share the files for which they are facing error and when i tried it uploaded successfully. When user tried again uploading same files which errored out it got succeeded today which were failing yesterday but sill there are files which is giving the same error.

I went through a post where it say the problem could be due to use of HTTP/2 and when they switched to HTTP /1.1 it worked fine. We are also using HTTP/2 but we don't have option of going back to HTTP/1.1. Link below :

 

https://www.telerik.com/forums/problems-with-multi-file-upload-and-http-2

 

Any suggestions ?

 

3 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 27 May 2021, 01:24 PM

Hello Swapnil,

I would suggest you take a look at the StackOverflow thread linked below where such an error is discussed:

https://stackoverflow.com/questions/58215104/whats-the-neterr-http2-protocol-error-about

As you will see there could be all kinds of reasons behind such error, from server configuration to sending large data or files, or invalid headers, etc. None of this is specifically related to the Kendo Upload widget. I would suggest you check if some of the described issues in the linked StackOverflow thread could be a reason for the observed problem. 

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

0
swapnil
Top achievements
Rank 1
Iron
answered on 16 Jun 2021, 08:43 PM
Hi Neli,

I was able to get rid of ERR_HTTP2_PROTOCOL_ERROR error by doing below steps :

SETTINGS_MAX_CONCURRENT_STREAMS (0x3):
Indicates the maximum number of concurrent streams that the sender will allow. This limit is directional: it applies to the number of streams that the sender permits the receiver to create. Initially, there is no limit to this value. It is recommended that this value be no smaller than 100, so as to not unnecessarily limit parallelism.
A value of 0 for SETTINGS_MAX_CONCURRENT_STREAMS SHOULD NOT be treated as special by endpoints. A zero value does prevent the creation of new streams; however, this can also happen for any limit that is exhausted with active streams. Servers SHOULD only set a zero value for short durations; if a server does not wish to accept requests, closing the connection is more appropriate.

Add “Http2MaxConcurrentClientStreams” under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters In Registry and restart server. Set this value to 100 or >100

After doing above step this error went away but now i am seeing error - ERR_CONNECTION_RESET which is happening on upload folder. Is their any known issue/limitation with KendoUI Upload folder with this type of error, some sample code below :



$("#folders").kendoUpload({
async: {
saveUrl: baseAddrs + "/" + "DragAndDrop/ChunkSave",
removeUrl: baseAddrs + "/" + "DragAndDrop/remove",
chunkSize: 100000000,
autoUpload: true,
concurrent: true,

},
upload: onUpload,
directory: true,
directoryDrop: true,
complete: onComplete,
success: onFileSuccess,
error: onError


});

public ActionResult ChunkSave(IEnumerable<HttpPostedFileBase> files, string metaData)
{
try
{
ChunkMetaData somemetaData = new DataContractJsonSerializer(typeof(ChunkMetaData)).
ReadObject(new MemoryStream(Encoding.UTF8.GetBytes(metaData))) as ChunkMetaData;
StringBuilder errorMsgBuilder = new StringBuilder();
bool ignoreFile = false;
bool returnErrorMessage = false;
if (files != null)
{
foreach (var file in files)
{
StoreFile(file, somemetaData);

}

private string StoreFile(HttpPostedFileBase file, ChunkMetaData metaData)
{
string errorMessage = string.Empty;

CachedData data = null;
if (RepositoryManager.IsInPermenentStore(metaData.Key))
data = (CachedData)RepositoryManager.GetPermenantObject(metaData.Key);
else
{
RepositoryManager.PutObject(metaData.Key, data);
f.Upload(file.InputStream, data.EntityID, fullPath, data.Domain, data.Org, data.EntityID, metaData.EntityType);
}

This is my web.config :

<httpRuntime requestValidationType="SARQA.NET.BaseCode.NoValidationRequestValidator" maxRequestLength="1048576" executionTimeout="600" targetFramework="4.7.1" />
0
Neli
Telerik team
answered on 21 Jun 2021, 10:21 AM

Hello Swapnil,

Could you please test the behavior with a smaller value for the chunkSize?

I would suggest you check the configured value of the maxAllowedContentLength. You could check the links below where such issue is discussed:

https://stackoverflow.com/questions/8129362/err-connection-reset-the-connection-was-reset-when-uploading-a-large-file

- https://stackoverflow.com/questions/4548305/maximum-value-of-maxrequestlength

You could set the maxRequestLength as described in the thread below:

https://stackoverflow.com/questions/27428375/xmlhttprequest-err-connection-reset-while-uploading-large-2-mo-more-files?noredirect=1&lq=1

I hope this helps.

Regards,
Neli
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Upload
Asked by
swapnil
Top achievements
Rank 1
Iron
Answers by
Neli
Telerik team
swapnil
Top achievements
Rank 1
Iron
Share this question
or