Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in UrlUtils.EncryptParameter #3838

Closed
2 tasks done
daguiler opened this issue Jun 11, 2020 · 0 comments · Fixed by #3839
Closed
2 tasks done

NullReferenceException in UrlUtils.EncryptParameter #3838

daguiler opened this issue Jun 11, 2020 · 0 comments · Fixed by #3839

Comments

@daguiler
Copy link
Contributor

Description of bug

Evoq runs the File Crawler search provider (a Scheduler task) to index file contents. This provider is based on the StandardFolderProvider class. We are seeing following error now:

image

This is actually a NullReferenceException when the Search API calls the StandardFolderProvider.GetFileUrl(IFileInfo) method:

image

This happens because the EncryptParameter(string) method calls the PortalController.Instance.GetCurrentPortalSettings() method, which is known to give a NRE in the context of a Scheduler task (as in #2606).

image

In this particular case, we can avoid this issue by calling the EncryptParameter(string, string) overload (passing the encryption key), which we can obtain safely by using the PortalSettings instance available in GetFileUrl(IFileInfo) (line 178 in first screenshot).

Steps to reproduce

The steps to reproduce are simply to run the "Search: File Crawler" task, which is specific to Evoq, but actually any search provider based on the StandardFolderProvider will crash.

Error information

2020-06-11 17:35:40.353-03:00 [DNN-DEV-02][D:9][T:73][ERROR] DotNetNuke.Services.FileSystem.FileManager - System.NullReferenceException: Object reference not set to an instance of an object.
   at DotNetNuke.Common.Utilities.UrlUtils.EncryptParameter(String value)
   at DotNetNuke.Services.FileSystem.StandardFolderProvider.GetFileUrl(IFileInfo file)
   at DotNetNuke.Services.FileSystem.FileManager.GetUrl(IFileInfo file)
2020-06-11 17:35:40.376-03:00 [DNN-DEV-02][D:9][T:73][ERROR] DotNetNuke.Services.Exceptions.Exceptions - DotNetNuke.Services.Exceptions.BasePortalException: File Crawler Unable to Finish, Error: The underlying system threw an exception. ---> DotNetNuke.Services.FileSystem.FolderProviderException: The underlying system threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
   at DotNetNuke.Common.Utilities.UrlUtils.EncryptParameter(String value)
   at DotNetNuke.Services.FileSystem.StandardFolderProvider.GetFileUrl(IFileInfo file)
   at DotNetNuke.Services.FileSystem.FileManager.GetUrl(IFileInfo file)
   --- End of inner exception stack trace ---
   at DotNetNuke.Services.FileSystem.FileManager.GetUrl(IFileInfo file)
   at DotNetNuke.Professional.SearchCrawler.Results.FileResultController.GetDocUrl(SearchResult searchResult)
   at DotNetNuke.Services.Search.Controllers.SearchControllerImpl.GetSecurityTrimmedResults(SearchQuery searchQuery, LuceneQuery luceneQuery)
   at DotNetNuke.Services.Search.Controllers.SearchControllerImpl.GetResults(SearchQuery searchQuery)
   at DotNetNuke.Services.Search.Controllers.SearchControllerImpl.SiteSearch(SearchQuery searchQuery)
   at DotNetNuke.Professional.SearchCrawler.FileCrawling.FileCrawlerController.GetLastIndexedFileModificationDate(IFolderInfo folder)
   at DotNetNuke.Professional.SearchCrawler.FileCrawling.FileCrawlerController.IndexDirectory(ISearchCrawlerPortalContext searchCrawlerPortalContext, IFolderInfo folderInfo)
   at DotNetNuke.Professional.SearchCrawler.FileCrawling.FileCrawlerController.IndexPortalDirectory(ISearchCrawlerPortalContext searchCrawlerPortalContext)
   at DotNetNuke.Professional.SearchCrawler.FileCrawling.FileCrawlerController.IndexPortalDirectories(ISearchCrawlerContext searchCrawlerContext)
   at DotNetNuke.Professional.SearchCrawler.FileCrawler.FileCrawler.FileCrawlerExecution()
   --- End of inner exception stack trace ---

Affected version

  • 10.00.00 alpha build (in development)
  • 09.06.01 latest supported release
@daguiler daguiler changed the title NullReferenceException in StandardFolderProvider NullReferenceException in UrlUrils.EncryptParameter Jun 11, 2020
@daguiler daguiler changed the title NullReferenceException in UrlUrils.EncryptParameter NullReferenceException in UrlUtils.EncryptParameter Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant