nicolaayan / EpiserverCmsAudit

MIT License
9 stars 20 forks source link

BlockTypeAudit - ArgumentException #18

Open willroscoe opened 4 years ago

willroscoe commented 4 years ago

Hi, When running the package we are noticing the following exception:

System.ArgumentException

Message: The parameters dictionary contains a null entry for parameter 'contentTypeId' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult BlockTypeAudit(Int32)' in 'N1990.Episerver.Cms.Audit.Controllers.BlockTypesController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters

Any help would be much appreciated. Thanks Will

fernandowolff commented 2 years ago

Had the same issue. Ended up being due to the "aspnet:RequestQueueLimitPerSession" app setting, which has a default value of 50. If you have more blocks/pages/visitor groups than that, the requests made by the plugin will be blocked, resulting in those errors. Fix was to add a customization for this setting on web.config:

    <appSettings>
          <add key="aspnet:RequestQueueLimitPerSession" value="150"/>
    </appSettings>

The "150" will vary according to your needs.

Although this stops 99% of the error occurrences, I still can see 1 occurrence every time I open one of the tabs for seeing blocks, pages or visitor groups. Seems to be because of the first request, that is sent with no contentTypeId defined. But all the following requests succeed with no problem, and seems that no content type is missing. So seems that first wrong request does not matter.

Note: I know, it is annoying having that one occurrence every time.

Source: https://stackoverflow.com/questions/59938410/the-request-queue-limit-of-the-session-is-exceeded

vigneshwarks commented 2 years ago

Hi @nicolaayan, We faced the similar issue. Validation has been added to ensure that first call doesn't fails. Please check this PR [(https://github.com/nicolaayan/EpiserverCmsAudit/pull/23 )]

Thanks.