保存的间歇性例外

时间:2016-07-13 17:54:01

标签: database dotnetnuke 2sxc

对于拥有大型网站的客户,我们一直在大量投资2sxc。我们已经构建了许多自定义应用,并在默认的内容应用中添加了不少内容类型。

大约一个月前,我们开始看到在保存前端数据和在Content App中保存ContentTypes时速度缓慢(但仅限于此)。该网站需要20 - 30秒才能保存。现在它变得更糟,并开始间歇性地抛出异常。保存不会超过30秒。在其他时间它是60秒。间歇性内容无法保存,我们收到下面列出的错误消息和例外。

但是,我们在其他应用中保存内容没有任何问题,例如Blog应用和我们的自定义应用。表现很好。此外,2sxc模块通常似乎对前端用户来说很好。

我们在DNN 7.4.2上运行2sxc 8.4.5。

这是最初的错误消息:

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

DNN事件日志中出现两个例外。对于每次保存失败,它们都会出现两次。

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 个答案:

答案 0 :(得分:0)

感谢RaphaelMüller,这个问题已经解决了。他建议在数据库上重建索引。完成后,内容保存从45秒加上超时到1.5秒。男孩是我的脸红。哦,生活和学习。教训很简单:确保您的数据库有一个包含重建索引的维护计划。

以下是可能遇到此问题的人的一些有用链接。

这是一个重建数据库中所有索引的脚本。理论上,脚本不应该锁定您的数据库或网站,但任何事情都是可能的,因此最好在非工作时间执行。在我的DNN数据库上运行大约需要5分钟,大约2.5 Gb。 https://gallery.technet.microsoft.com/scriptcenter/Script-for-rebuilding-all-8d079754

Michelle Ufford的索引碎片整理脚本是一种高级解决方案。我已成功在我的舞台服务器上运行它,它似乎受到社区的欢迎。 http://sqlfool.com/2011/06/index-defrag-script-v4-1/

以下是有关计划索引重建的频率的有用讨论。 How Often should the indexes be re-build in sql-server DB?