HotcakesCommerce / hotcakes-commerce-core

The core of the e-commerce part of the overall solution. This is an ecommerce shopping cart solution built on top of the DNN (DotNetNuke) CMS. Anyone can do commerce online now!
https://mmmcommerce.com
MIT License
68 stars 55 forks source link

SI: Occasional Unhandled Exception w/ `HccClientDependency` Class #393

Open WillStrohl opened 2 years ago

WillStrohl commented 2 years ago

Describe the bug

It's unclear why this is happening, but occasionally, the exceptions below are seen and could create a fatal error to crash the site in some cases.

Software Versions

To Reproduce

Steps to reproduce the behavior:

  1. Install and run the site
  2. Sit and wait... 🤷🏽‍♂️

Expected behavior

The site just runs without exceptions.

Actual behavior

The errors below can be logged and potentially crash a site. Unfortunately, there's not a known path of steps to reproduce this issue, even after inspecting the IIS log files.

This may be due to a standard bot attempting to index the site. No other logs occur when I'm able to find these exceptions.

If this is indeed related, the actual behavior includes crashing the application pool and causing a HTTP 503 error to be displayed.

Screenshots

None.

Error log

2022-02-22 09:12:07,880 [OMITTED][Thread:12][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. --->   System.ArgumentException: Item has already been added. Key in dictionary: 'HccPageHeaderProvider'  Key being added: 'HccPageHeaderProvider'  
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)  
   at System.Collections.Hashtable.Add(Object key, Object value)  
   at System.Configuration.Provider.ProviderCollection.Add(ProviderBase provider)  
   at ClientDependency.Core.FileRegistration.Providers.FileRegistrationProviderCollection.Add(ProviderBase provider)  
   at Hotcakes.Modules.Core.Admin.AppCode.HccPageHeaderProvider.Register(ClientDependencySettings cdSettings) in C:\Work\HCC-core\hcc-core\Website\DesktopModules\Hotcakes\Core\Admin\AppCode\HccClientDependency.cs:line 90  
   at Hotcakes.Modules.Core.Admin.AppCode.BaseMasterPage.OnInit(EventArgs e) in C:\Work\HCC-core\hcc-core\Website\DesktopModules\Hotcakes\Core\Admin\AppCode\BaseMasterPage.cs:line 62  
   at System.Web.UI.Control.InitRecursive(Control namingContainer)  
   at System.Web.UI.Control.InitRecursive(Control namingContainer)  
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.HandleError(Exception e)  
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.ProcessRequest()  
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)  
   at System.Web.UI.Page.ProcessRequest(HttpContext context)  
   at ASP.desktopmodules_hotcakes_core_admin_orders_vieworder_aspx.ProcessRequest(HttpContext context)  
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)  
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  
2022-02-22 09:12:07,896 [AH-WEB01][Thread:11][FATAL] DotNetNuke.Web.Common.Internal.DotNetNukeHttpApplication - System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. --->  
 System.ArgumentException: Item has already been added. Key in dictionary: 'HccBodyProvider'  Key being added: 'HccBodyProvider'
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)  
   at System.Collections.Hashtable.Add(Object key, Object value)  
   at System.Configuration.Provider.ProviderCollection.Add(ProviderBase provider)  
   at ClientDependency.Core.FileRegistration.Providers.FileRegistrationProviderCollection.Add(ProviderBase provider)  
   at Hotcakes.Modules.Core.Admin.AppCode.HccBodyProvider.Register(ClientDependencySettings cdSettings) in C:\Work\HCC-core\hcc-core\Website\DesktopModules\Hotcakes\Core\Admin\AppCode\HccClientDependency.cs:line 143  
   at Hotcakes.Modules.Core.Admin.AppCode.BaseMasterPage.OnInit(EventArgs e) in C:\Work\HCC-core\hcc-core\Website\DesktopModules\Hotcakes\Core\Admin\AppCode\BaseMasterPage.cs:line 63  
   at System.Web.UI.Control.InitRecursive(Control namingContainer)  
   at System.Web.UI.Control.InitRecursive(Control namingContainer)  
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.HandleError(Exception e)  
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  
   at System.Web.UI.Page.ProcessRequest()  
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)  
   at System.Web.UI.Page.ProcessRequest(HttpContext context)  
   at ASP.desktopmodules_hotcakes_core_admin_orders_vieworder_aspx.ProcessRequest(HttpContext context)  
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()  
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)  
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)  

Additional context

Reported by a Hotcakes Cloud client.