Search code examples
dotnetnuke2sxc

2SXC - SearchIndexException: Search: Error while indexing module


I'm getting the dreaded DNN Error "An unexpected error has occurred" with a link to return to the site. There's no other information displayed here so I checked the logs under \Portals\_default\Logs\ and found this:

2019-09-26 10:15:02.052-05:00 [XXXXXX][D:4][T:84][ERROR] DotNetNuke.Services.Exceptions.Exceptions - ToSic.SexyContent.Search.SearchIndexException: Search: Error while indexing module 450 on tab 44, portal 0 ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at ToSic.Eav.Security.Permissions.PermissionCheckBase.DoesPermissionAllow(IEntity permissionEntity, Char[] desiredActionCode) in C:\Projects\eav-server\ToSic.Eav.Core\Security\Permissions\PermissionCheckBase.cs:line 119
    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
    at ToSic.SexyContent.SxcInstance.get_UserMayEdit() in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\SxcInstance_Render.cs:line 17
    at ToSic.SexyContent.ContentBlocks.ModuleContentBlock..ctor(IInstanceInfo instanceInfo, Log parentLog, ITenant tenant, IEnumerable`1 overrideParams) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\ContentBlocks\ModuleContentBlock.cs:line 66
    at ToSic.SexyContent.Environment.Dnn7.Search.SearchController.GetModifiedSearchDocuments(IInstanceInfo instance, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Search\SearchController.cs:line 53
    at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Environment\Dnn7\DnnBusinessController.cs:line 98
    --- End of inner exception stack trace ---
    at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Environment\Dnn7\DnnBusinessController.cs:line 102
    at DotNetNuke.Services.Search.ModuleIndexer.IndexSearchDocuments(Int32 portalId, ScheduleHistoryItem schedule, DateTime startDateLocal, Action`1 indexer)
2019-09-26 10:15:02.069-05:00 [XXXXXX][D:4][T:84][ERROR] DotNetNuke.Services.Exceptions.Exceptions - ToSic.SexyContent.Search.SearchIndexException: Search: Error while indexing module 451 on tab 20, portal 0 ---> System.NullReferenceException: Object reference not set to an instance of an object.
    at ToSic.Eav.Security.Permissions.PermissionCheckBase.DoesPermissionAllow(IEntity permissionEntity, Char[] desiredActionCode) in C:\Projects\eav-server\ToSic.Eav.Core\Security\Permissions\PermissionCheckBase.cs:line 119
    at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
    at ToSic.SexyContent.SxcInstance.get_UserMayEdit() in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\SxcInstance_Render.cs:line 17
    at ToSic.SexyContent.ContentBlocks.ModuleContentBlock..ctor(IInstanceInfo instanceInfo, Log parentLog, ITenant tenant, IEnumerable`1 overrideParams) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\ToSic.Sxc\SexyContent\ContentBlocks\ModuleContentBlock.cs:line 66
    at ToSic.SexyContent.Environment.Dnn7.Search.SearchController.GetModifiedSearchDocuments(IInstanceInfo instance, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Search\SearchController.cs:line 53
    at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Environment\Dnn7\DnnBusinessController.cs:line 98
    --- End of inner exception stack trace ---
    at ToSic.SexyContent.Environment.Dnn7.DnnBusinessController.GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDate) in C:\Projects\2sxc-dnn742\Website\DesktopModules\ToSIC_SexyContent\2sxc Dnn\Environment\Dnn7\DnnBusinessController.cs:line 102
    at DotNetNuke.Services.Search.ModuleIndexer.IndexSearchDocuments(Int32 portalId, ScheduleHistoryItem schedule, DateTime startDateLocal, Action`1 indexer)

Unfortunately, I haven't touched the site at all since a demo I did at the beginning of August where I created a sample post which means I have no idea what I did to cause the error. I didn't get any error messages at that time and after getting approval from the big wigs, I shifted my focus to other projects and don't recall doing anything usual or bumping into any errors. But I try to access the site today and I get these errors related to 2SXC.

What do these errors mean and how can I fix the issue to restore my site?

Update: I'm running DNN 9.1.1 and 2SXC 09.32.01 with the News app 03.01.04

Update 2: I just notices this error too:

2019-09-27 11:17:08.567-05:00 [XXXXXX][D:2][T:10][ERROR] DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.PageLoadException: Unhandled error loading page. ---> System.Web.HttpParseException: The file '/DesktopModules/DDRMenu/Menu.ascx' does not exist. ---> System.Web.HttpParseException: The file '/DesktopModules/DDRMenu/Menu.ascx' does not exist. ---> System.Web.HttpException: The file '/DesktopModules/DDRMenu/Menu.ascx' does not exist.
    at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
    at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean ensureIsUpToDate)
    at System.Web.UI.BaseTemplateParser.GetReferencedType(VirtualPath virtualPath, Boolean allowNoCompile)
    at System.Web.UI.BaseTemplateParser.GetUserControlType(VirtualPath virtualPath)
    at System.Web.UI.MainTagNameToTypeMapper.ProcessUserControlRegistration(UserControlRegisterEntry ucRegisterEntry)
    at System.Web.UI.BaseTemplateParser.ProcessDirective(String directiveName, IDictionary directive)
    at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
    --- End of inner exception stack trace ---
    at System.Web.UI.TemplateParser.ProcessException(Exception ex)
    at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)
    at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
    --- End of inner exception stack trace ---
    at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)
    at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)
    at System.Web.UI.TemplateParser.ParseInternal()
    at System.Web.UI.TemplateParser.Parse()
    at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
    at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)
    at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
    at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
    at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
    at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate)
    at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
    at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc)
    at DotNetNuke.UI.Skins.Skin.LoadSkin(PageBase page, String skinPath)
    --- End of inner exception stack trace ---

Solution

  • My problem actually had nothing to do with 2SXC. In my Update 2 on the original question, I mentioned I had also noticed an error saying:

    System.Web.HttpParseException: The file '/DesktopModules/DDRMenu/Menu.ascx' does not exist.
    

    This apparently is a common problem with DNN module development in Visual Studio. From HemIT Blog:

    Where does this Virtual Directory come from? In my development environment, it comes from the following facts:

    • we are using SVN, and I tend to checkout the modules and compile them outside of my IIS websites
    • I am using the famous christoc template for module development (don't get me wrong, it's great! It's just doing things behind our back that we might not foresee). Indeed, if I look in my project file:

    visual studio image

    The real culprit is Visual Studio!

    When you are checking your module out, if you have a site configured on IIS, project will open fine. However when you compile, if you are out of an IIS website, a virtual directory "desktopmodule" will get created, and hide the "DesktopModules" folder.

    Hence DNN can no longer find the DDRMenu module, hence it is failing.

    The solution was really simple. Go into IIS and remove the virtual directory labeled "desktopmodules":

    delete virtual directory