Intermittant Exceptions On Save

2019-09-14 22:00发布

We have been investing heavily in 2sxc for a client with a large site. We've built a number of custom apps and added quite a few content types to the default Content App.

About a month ago we started seeing slowness when saving front end data and saving ContentTypes in the Content App (but only there). The site would take 20 - 30 seconds to save. Now it's gotten worse and started throwing exceptions intermittently. Save is no faster than 30 seconds. At other times it's 60 seconds. Intermittently the content fails to save and we get the error message and exceptions listed below.

However we have no problems saving content within other apps like the Blog app and our custom apps. Performance there is fine. Also 2sxc modules in general seem to render fine for front end users.

We are running 2sxc 8.4.5 on DNN 7.4.2.


Here is the initial Error Message:

Had an error talking to the server (status 400)
Message: Bad Request
Detail: Error getting List of Stream.
Stream Name: Default
DataSource Name: QuickCache

Failed to load resource: the server responded with a status of 400 (Bad Request)
POST [removed]/en-us/desktopmodules/2sxc/api/eav/entities/savemany?appId=2 400 (Bad Request)
(anonymous) @ VM2141:2
(anonymous) @ set.min.js?sxcver=8.9.1.13916:103
n @ set.min.js?sxcver=8.9.1.13916:99
(anonymous) @ set.min.js?sxcver=8.9.1.13916:96
(anonymous) @ set.min.js?sxcver=8.9.1.13916:131
$eval @ set.min.js?sxcver=8.9.1.13916:145
$digest @ set.min.js?sxcver=8.9.1.13916:142
$apply @ set.min.js?sxcver=8.9.1.13916:146
(anonymous) @ set.min.js?sxcver=8.9.1.13916:276
Sf @ set.min.js?sxcver=8.9.1.13916:37
d @ set.min.js?sxcver=8.9.1.13916:37

There are two exceptions that appear in the DNN Event Log. Both of them appear twice for each failure to save.


General Exception
AbsoluteURL:/en-us/desktopmodules/2sxc/api/eav/entities/savemany
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:7888b675-2f38-4664-96ab-786b27b3406c
AssemblyVersion:
PortalId:-1
UserId:-1
TabId:-1
RawUrl:
Referrer:
UserAgent:
ExceptionHash:QVy9pjR7G9IFD3vpE650/A==
Message:Error getting List of Stream. Stream Name: Default DataSource Name: QuickCache
StackTrace:
   at ToSic.Eav.DataSources.DataStream.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 143
   at ToSic.Eav.DataSources.BaseDataSource.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\BaseDataSource.cs:line 132
   at ToSic.Eav.Import.Import.RunImport(IEnumerable`1 newAttributeSets, IEnumerable`1 newEntities) in C:\Projects\eav-server\ToSic.Eav\ImportExport\Import.cs:line 71
   at ToSic.Eav.WebApi.EntitiesController.SaveMany(Int32 appId, List`1 items) in C:\Projects\eav-server\ToSic.Eav.WebApi\EntitiesController.cs:line 204
   at ToSic.SexyContent.EAVExtensions.EavApiProxies.EntitiesController.SaveMany(Int32 appId, List`1 items) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\WebApi\EavApiProxies\EntitiesController.cs:line 109
   at lambda_method(Closure , Object , Object[] )
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass13.b__c(Object instance, Object[] methodParameters)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.<>c__DisplayClass5.b__4()
   at System.Threading.Tasks.TaskHelpers.RunSynchronously[TResult](Func`1 func, CancellationToken cancellationToken)
InnerMessage:An error occurred while executing the command definition. See the inner exception for details.
InnerStackTrace:
   at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable.GetEnumerator()
   at ToSic.Eav.BLL.DbLoadIntoEavDataStructure.GetAppDataPackage(Int32[] entityIds, Int32 appId, IDeferredEntitiesList source, Boolean entitiesOnly) in C:\Projects\eav-server\ToSic.Eav\BLL\DbLoadIntoEavDataStructure.cs:line 179
   at ToSic.Eav.DataSources.SqlSources.EavSqlStore.GetDataForCache(IDeferredEntitiesList targetCacheForDeferredLookups) in C:\Projects\eav-server\ToSic.Eav\DataSources\SqlSources\EavSqlStore.cs:line 68
   at ToSic.Eav.DataSources.Caches.BaseCache.EnsureCache() in C:\Projects\eav-server\ToSic.Eav.DataSources\Caches\BaseCache.cs:line 126
   at ToSic.Eav.DataSources.Caches.BaseCache.GetList() in C:\Projects\eav-server\ToSic.Eav.DataSources\Caches\BaseCache.cs:line 46
   at ToSic.Eav.DataSources.DataStream.get_LightList() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 135
Source:ToSic.Eav.DataSources
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:

Page Load Exception
AbsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:c5449323-0a0a-486f-98cd-9849243fff19
AssemblyVersion:7.4.2
PortalId:0
UserId:-1
TabId:56
RawUrl:/en-us/
Referrer:http://www.cui.edu/en-us/
UserAgent:Mozilla/5.0 (iPhone; CPU iPhone OS 9_3_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13F69 Safari/601.1
ExceptionHash:301KQ/ilLzYrwILN4yfdXA==
Message:Error getting List of Stream. Stream Name: Default DataSource Name: PublishingFilter
StackTrace:
InnerMessage:Error getting List of Stream. Stream Name: Default DataSource Name: PublishingFilter
InnerStackTrace:
   at ToSic.Eav.DataSources.DataStream.get_List() in C:\Projects\eav-server\ToSic.Eav.DataSources\DataStream.cs:line 98
   at ToSic.Eav.DataSources.BaseDataSource.get_List() in C:\Projects\eav-server\ToSic.Eav.DataSources\BaseDataSource.cs:line 127
   at ToSic.SexyContent.ContentGroup.get_Template() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\ContentGroup.cs:line 71
   at ToSic.SexyContent.ContentBlock.ModuleContentBlock..ctor(ModuleInfo moduleInfo, IEnumerable`1 overrideParams) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\ContentBlock\ModuleContentBlock.cs:line 77
   at ToSic.SexyContent.View.get_SxcI() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 18
   at ToSic.SexyContent.View.get_UserMayEditThisModule() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 90
   at ToSic.SexyContent.View.Page_Load(Object sender, EventArgs e) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\View.ascx.cs:line 28
   at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:

1条回答
再贱就再见
2楼-- · 2019-09-14 22:51

Thanks to Raphael Müller this issue has been solved. He suggested rebuilding indexes on the database. Once that was done the content saves went from 45 seconds plus with timeouts down to 1.5 seconds. Boy is my face red. Oh well live and learn. The lesson is simple: Make sure your database has a maintenance plan that includes the rebuilding of indexes.

Here are some helpful links for those who might encounter this issue.

Here is a script to rebuild all indexes in a database. In theory the script should not lock your database or website but anything is possible so it's best to execute off hours. It took 5 minutes to run on my DNN database which is around 2.5 Gb. https://gallery.technet.microsoft.com/scriptcenter/Script-for-rebuilding-all-8d079754

Michelle Ufford's Index Defrag Script is an advanced solution. I've run it on my stage server successfully and it seems to be well received by the community. http://sqlfool.com/2011/06/index-defrag-script-v4-1/

Here is a helpful discussion on how often to schedule your index rebuilds. How Often should the indexes be re-build in sql-server DB?

查看更多
登录 后发表回答