File size limit CMS 12

Vote:
 

We want to import multiple websites/media folders into one CMS instance, and have increased the max filesize using the appsettings:

    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 10737418240
      },

And using:

            services.Configure<FormOptions>(x =>
            {
                x.MultipartBodyLengthLimit = 10737418240;
            });

This seems to work for our local development environment, but when trying to do the same in DXP, we still get a 'Timed out, or max file size exceeded' error after about a minute. The file were trying to upload is around 1gb.

Theres this bug: https://world.optimizely.com/support/bug-list/bug/CMS-24180. But its stated this has been fixed in 12.10.0. We are using 12.13.1.

Are there any settings we missed that make it work in DXP?

#290913
Edited, Nov 01, 2022 12:59
Vote:
 

It sounds to me that this is because of the request time out, not size limitation. Could you increase the time out setting? 

#290914
Nov 01, 2022 13:44
Vote:
 

Ill give it a shot, but I'm not sure if thatll work. I've tried a different file (media folder vs pages), this one gave the same error but after 4+ minutes instead of 55 seconds. Both were around 900mb/1gb.

Do you know which setting needs to be changed for the timeout?

#290915
Nov 01, 2022 13:47
Vote:
 

Hmm. That's strange. Default timeout is like 110s if IIRC. 

Could you upload something like 100MB and succeeded?

#290917
Nov 01, 2022 14:21
Vote:
 

Ive tried a 380mb file which took 1.5min and succeeded. I then tried a 530mb file, which failed after 20sec 40sec, 2min and 4min.

#290920
Edited, Nov 01, 2022 15:18
Vote:
 

Could you enable debug logs on DXP and try to import. it should show better error message. Something like "[18:24:25 DBG] Connection id "..." bad request data: "Request body too large. The max request body size is 20971520 bytes." followed by the stack trace.

#290923
Nov 01, 2022 16:51
Vote:
 

You need to set the max size for kestrel as well.

public static IHostBuilder CreateHostBuilder(string[] args) =>
    Host.CreateDefaultBuilder(args)
        .ConfigureWebHostDefaults(webBuilder =>
        {
            webBuilder.ConfigureKestrel((context, options) =>
            {
                // Handle requests up to 50 MB
                options.Limits.MaxRequestBodySize = 52428800;
            })
            .UseStartup<Startup>();
        });

https://learn.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-6.0

#290924
Nov 01, 2022 16:53
Vote:
 

That doesnt make sense, since a file of 300mb was uploaded fine, and the default size is 30mb. I've added the setting anyway and it still fails for large files.

So far, Ive added the following settings:

Program.cs (tried both usekestrel and configurekestrel):

webBuilder.ConfigureKestrel((context, options) =>
{
    options.Limits.MaxRequestBodySize = 107374182400;
})

Startups.cs:

services.Configure<FormOptions>(x => { x.MultipartBodyLengthLimit = 107374182400; });

Appsettings.json:

  "EPiServer": {
    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 107374182400
      }
    }
  }
#290977
Nov 02, 2022 9:52
Vote:
 
    "CmsUI": {
      "Upload": {
        "FileSizeLimit": 10737418240
      },

Not sure it'll solve your problem, but shouldn't "Upload" be "UploadOptions" here?

https://docs.developers.optimizely.com/content-cloud/v12.0.0-content-cloud/docs/cmsui-section-replace-when-cms-22234-goes-out#uploadoptions

#291231
Nov 07, 2022 20:56
Chris Sharp - Nov 08, 2022 2:47
No... "Upload" is correct here.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.