1

I have a web application which is hosted on a high available farm, with mutliple front end servers, and multiple application servers as well with 2 distributed cache servers, and with BLOB caching configured, one of the application servers is hosting the search services, the web application has only 1 zone which is the Default, it has Claims Based Authentication with NTML only enabled.

Users are logging to site using Windows Authentication, when any logged in user search for a specific keyword, the search results web part is working and showing results accordingly.

When an anonymous user is trying to search, the search results webpart throws a very superficial message that is saying "Sorry, something went wrong"

In ULS Logs, I found this message which indicates Access is denied:

System.UnauthorizedAccessException: تم رفض الوصول., StackTrace:
at Microsoft.SharePoint.SPWeb.GetFileOrFolderProperties(SPResourcePath path, ListDocsFlags listDocsFlags, Boolean throwException, SPBasePermissions& permMask)
at Microsoft.SharePoint.SPFolder.PropertiesCore(Boolean throwException)
at Microsoft.SharePoint.SPFolder.ThrowIfNullProperties()
at Microsoft.SharePoint.SPFolder.get_WelcomePage()
at Microsoft.SharePoint.Publishing.CachedArea.<.ctor>b__1(PublishingWeb areaForAction)
at Microsoft.SharePoint.Publishing.CachedArea..ctor(PublishingWeb area, String id, String parentId, CachedUserResource title, SPResourcePath path, CachedUserResource description, ICachedObjectFactory factory)
at Microsoft.SharePoint.Publishing.CachedArea.CreateCachedArea(PublishingWeb area, ICachedObjectFactory factory, String parentId)
at Microsoft.SharePoint.Publishing.CachedObjectFactory.CreateObject(PublishingWeb area, String parentUrl)
at Microsoft.SharePoint.Publishing.PublishingWeb.IsPublishingWeb(SPWeb web)
at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.IsPublishingPage(String basePath)
at Microsoft.SharePoint.Publishing.Internal.CmsVirtualPathProvider.CombineVirtualPaths(String basePath, String relativePath)
at System.Web.Hosting.VirtualPathProvider.CombineVirtualPaths(VirtualPath basePath, VirtualPath relativePath)
at System.Web.UI.DependencyParser.AddDependency(VirtualPath virtualPath)
at System.Web.UI.DependencyParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.PageDependencyParser.ProcessDirective(String directiveName, IDictionary directive)
at System.Web.UI.DependencyParser.ParseString(String text)
at System.Web.UI.DependencyParser.ParseFile(String physicalPath, VirtualPath virtualPath)
at System.Web.UI.DependencyParser.GetVirtualPathDependencies()
at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureCacheKeyAndViewStateHash(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetVirtualPathProviderCacheKey(HttpContext context, SPRequestModuleData requestData)
at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath)
at System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP)
at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate)
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.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound)
at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp)
at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.UnsafeIISMethods.MgdIndicateCompletion(IntPtr pHandler, RequestNotificationStatus& notificationStatus)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr rootedObjectsPointer, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)

As per link below I created a new caching profile for anonymous users with the same properties, but still issue persists.

https://www.ais.com/a-fix-for-the-sharepoint-search-queryresult-mismatch/

Any help is much appreciated. Thanks.

1

Resolved by removing a custom developed handler that restricts access to "vti_bin" directory for anonymous users. Where the access to "vti_bin" directory is an essential part to get the search functioanlity work properly.

0

It's a longshot, but are all of the Managed Properties you are returning marked as "Safe for Anonymous"?

https://docs.microsoft.com/en-us/sharepoint/manage-search-schema

2
  • It's working perfectly on testing environment, but it doesn't on production, all properties are safe for anonymous, when any anonymous user is trying to reach the page that has search results web part on it, it directly shows "sorry someyhing went wrong" message. Dec 1 '20 at 8:55
  • If test is configured exactly the same as prod, I'd start removing properties anyway. Just to test. Dec 2 '20 at 15:58
0

Since the SharePoint log is stating "Access is denied", I would start checking Anonymous users' permissions setting for the result page. Can you access the result page (directly by the URL), osssearchresults.aspx, anonymously? The URL would be something like:

SharePoint 2013
https://SharePointWebApp.com/sites/anonymous/_layouts/15/osssearchresults.aspx

You can also verify whether permission for anonymous user is set correctly by visiting here

2
  • Yes anonymous users can reach this page, but the search results web part is directly showing "sorry something went wrong" message Dec 1 '20 at 8:29
  • You can try disabling: Limited-access user permission lockdown mode When this feature is enabled, permissions for users in the "limited access" permissions level (such as Anonymous Users) are reduced, preventing access to Application Pages Dec 1 '20 at 20:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.