Search error reported in display template - search fails

Hi

I have setup Sharepoint Foundation 2013 on a Windows 2012 R2 server. This is a new installation and the site has been created from scratch. The site only comprises a handful of pages and runs fine. The version of the application under Central Administration > Upgrade and Migration > Check product and patch installation status is reported variously as 15.0.4569.1506 and 15.0.4657.1000 for Microsoft Search Server 2013 Core.

I have configured the search server to crawl two directories on another server (same domain, same subnet) as well as the Sharepoint content on the local server. I can see from the crawl logs that the search has indexed approximately 91,000 entries and that at least one full crawl has completed. The index should contain a larger number of entries as I remember there being well over 100,000 entries when we were using an earlier version of Sharepoint on a 2003 server.

When I type a search term and click the magnifying glass Sharepoint reports an error:

_______________________________________________________________________
_______________________________________________________________________
Error:

Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator.


Correlation ID: 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415


Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types.


Unable to get property 'value' of undefined or null reference (CoreRender: ~sitecollection/_catalogs/masterpage/Display Templates/Search/Control_SearchResults.js)
_______________________________________________________________________
_______________________________________________________________________


I've done a quick web search and from those results have tried adding the intranet site to the intranet security zone in the Default Domain Policy (Site to Zone Assignment List).

I have also tried deactivating and reactivating the Search application via Central administration. When I use Manage Web Applications from Central Administration > Select site > Service connections all the boxes are ticked including 'Search Service Application'.

I have looked up the correlation in the log file but as I am not familiar with working with this type of data it means nothing to me.

Here are the relevant lines from the log. The search term I used was: saxon pottery


11/06/2014 15:07:58.81  w3wp.exe (0x069C)                        0x1538 SharePoint Foundation          Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:http://atlas:26514/sites/HTL/_layouts/15/osssearchresults.aspx?u=http%3A%2F%2Fatlas%3A26514%2Fsites%2FHTL&k=saxon%20pottery&AjaxDelta=1&isStartPlt1=1415286478805)). Execution Time=79.6291589516281 2a7dc99c-ecf8-e054-8f1a-f772f471e606
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2A2C SharePoint Foundation          Monitoring                     nasq Medium   Entering monitored scope (Request (GET:http://atlas:26514/sites/HTL/SiteAssets/heritage%20lincs%20banner%20no%20space.jpg)). Parent No 
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2A2C SharePoint Foundation          Logging Correlation Data       xmnv Medium   Name=Request (GET:http://atlas:26514/sites/HTL/SiteAssets/heritage%20lincs%20banner%20no%20space.jpg) 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2A2C SharePoint Foundation          Authentication Authorization   agb9s Medium   Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|blood\therealblood, ClaimsCount=48 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          General                        af71 Medium   HTTP Request method: GET 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          General                        af75 Medium   Overridden HTTP request method: GET 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          General                        af74 Medium   HTTP request URL: /sites/HTL/SiteAssets/heritage%20lincs%20banner%20no%20space.jpg 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          Database                       ab1a9 High     Failed to get document content data. System.ComponentModel.Win32Exception (0x80004005): Cannot complete this function     at Microsoft.SharePoint.SPSqlClient.GetDocumentContentRow(Int32 rowOrd, Object ospFileStmMgr, SPDocumentBindRequest& dbreq, SPDocumentBindResults& dbres) 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          Files                          abq2i High     Could not get DocumentContent row: 0x80004005. 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          Files                          aiv4w Medium   Spent 0 ms to bind -1 byte file stream 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x2580 SharePoint Foundation          Files                          aise3 Medium   Failure when fetching document. 0x80070012 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x242C SharePoint Foundation          Micro Trace                    uls4 Medium   Micro Trace Tags: 0 nasq,2 agb9s 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:58.95  w3wp.exe (0x069C)                        0x242C SharePoint Foundation          Monitoring                     b4ly Medium   Leaving Monitored Scope (Request (GET:http://atlas:26514/sites/HTL/SiteAssets/heritage%20lincs%20banner%20no%20space.jpg)). Execution Time=9.66344421053648 2b7dc99c-9c06-e054-8f1a-f8f29b2c74c9
11/06/2014 15:07:59.03  w3wp.exe (0x069C)                        0x124C SharePoint Foundation          Monitoring                     nasq Medium   Entering monitored scope (Request (POST:http://atlas:26514/sites/HTL/_vti_bin/client.svc/ProcessQuery)). Parent No 
11/06/2014 15:07:59.03  w3wp.exe (0x069C)                        0x124C SharePoint Foundation          Logging Correlation Data       xmnv Medium   Name=Request (POST:http://atlas:26514/sites/HTL/_vti_bin/client.svc/ProcessQuery) 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415
11/06/2014 15:07:59.03  w3wp.exe (0x069C)                        0x124C SharePoint Foundation          Authentication Authorization   agb9s Medium   Non-OAuth request. IsAuthenticated=True, UserIdentityName=0#.w|blood\therealblood, ClaimsCount=48 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415
11/06/2014 15:07:59.06  w3wp.exe (0x069C)                        0x1268 SharePoint Foundation          CSOM                           agw10 Medium   Begin CSOM Request ManagedThreadId=35, NativeThreadId=4712 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415
11/06/2014 15:07:59.06  w3wp.exe (0x069C)                        0x1268 SharePoint Foundation          Logging Correlation Data       xmnv Medium   Site=/sites/HTL 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415
11/06/2014 15:07:59.06  w3wp.exe (0x069C)                        0x1268 SharePoint Server Search       Query                          aa37b Unexpected Culture_Client::Constructing CultureInfo from '-1' failed: System.ArgumentOutOfRangeException: Positive number required.  Parameter name: culture     at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride)     at Microsoft.Office.Server.Search.Query.Query.set_Culture_Client(Int32 value) 2b7dc99c-7c0b-e054-8f1a-f6cd6eef1415
11/06/2014 15:07:59.12  OWSTIMER.EXE (0x26B0)                    0x1AD8 SharePoint Foundation          Monitoring                     nasq Medium   Entering monitored scope (Timer Job job-application-server-admin-service). Parent No 92e2e4a9-7153-4f2f-aba2-a39cf071bc2c
11/06/2014 15:07:59.12  OWSTIMER.EXE (0x26B0)                    0x1AD8 SharePoint Foundation          Logging Correlation Data       xmnv Medium   Name=Timer Job job-application-server-admin-service 2b7dc99c-5c11-e054-8f1a-ffc053c96965
11/06/2014 15:07:59.12  OWSTIMER.EXE (0x26B0)                    0x1AD8 SharePoint Server Search       Administration                 dkd5 High     synchronizing search service instance 2b7dc99c-5c11-e054-8f1a-ffc053c96965
11/06/2014 15:07:59.12  OWSTIMER.EXE (0x26B0)                    0x1AD8 SharePoint Server Search       Administration                 eff0 High     synchronizing search data access service instance 2b7dc99c-5c11-e054-8f1a-ffc053c96965
11/06/2014 15:07:59.15  OWSTIMER.EXE (0x26B0)                    0x1AD8 SharePoint Server Search       Administration                 ajzc7 Medium   Cleanup of Orphan Systems in server atlas 2b7dc99c-5c11-e054-8f1a-ffc053c96965

I don't really know what else I can try. Search is a very important part of the product and I would love to get it working.

If anyone can help I will be very grateful.

Thanks!

January 6th, 2015 5:18pm

I have configured the search server to crawl two directories on another server (same domain, same subnet) as well as the Sharepoint content on the local server.

Hi,

I understand you encountered the issue with Search feature in SharePoint foundation 2013.

May I know about "two directories" in the quoted sentences above?

Did you find any related error message crawl log?

Regards,

Free Windows Admin Tool Kit Click here and download it now
January 7th, 2015 3:02pm

I have configured the search server to crawl two directories on another server (same domain, same subnet) as well as the Sharepoint content on the local server.

Hi,

I understand you encountered the issue with Search feature in SharePoint foundation 2013.

May I know about "two directories" in the quoted sentences above?

Did you find any related error message crawl log?

Re

January 8th, 2015 12:03pm

Hi,

From the error message, please refer to the article below and ensure the search service account has sufficient rights:

http://blogs.msdn.com/b/spblog/archive/2013/10/08/crawl-error-sharepoint-2013-processing-this-item-failed-because-of-an-unknown-error-when-trying-to-parse-its-contents.aspx

Then clear configuation cache and reset index, then re-crawl the content source.

Regards,

Free Windows Admin Tool Kit Click here and download it now
January 9th, 2015 5:18am

Hi

there can be a feature missing on the Central Administration site collection. The feature is called Search WebParts. So, to fix the problem, simply run the following command in an elevated SharePoint Management Shell:

Enable-SPFeature SearchWebParts -url http://<central admin url>

Regards

Amit

January 9th, 2015 5:57am

@Amit: Thanks a lot for the information. I have successfully run the command and will check everything after the next scheduled crawl.

@Rebecca Tu: Thank you for providing the link. Using the domain Group Policy Management Editor I added the SharePoint Service account to the relevant policies. The link on that article to clear the configuration cache does not apply to Server 2012 R2, so in case anyone needs to clear the configuration cache this article will show them how

As above, I will wait until after the next crawl and see what happens

Thanks again to both of you for your help. I'll post back with the results next week.

Free Windows Admin Tool Kit Click here and download it now
January 9th, 2015 1:23pm

check if managed account used for search has enough permissions using below link:

http://blogs.msdn.com/b/spblog/archive/2013/10/08/crawl-error-sharepoint-2013-processing-this-item-failed-because-of-an-unknown-error-when-trying-to-parse-its-contents.aspx

January 11th, 2015 1:42pm

check if managed account used for search has enough permissions using below link:

http://blogs.msdn.com/b/spblog/archive/2013/10/08/crawl-error-sharepoint-2013-processing-this-item-failed-because-of-an-unknown-error-when-trying-to-parse-its-contents.aspx


Thanks Sagar, but this is the same link that Rebecca Tu provides in her response on Jan 9.
Free Windows Admin Tool Kit Click here and download it now
January 12th, 2015 5:17pm

Hi, Folks

After making those changes and allowing a full crawl to take place I am still seeing the same type of error:


_______________________________________________________________________
_______________________________________________________________________

Search has encountered a problem that prevents results from being returned. If the issue persists, please contact your administrator.


Correlation ID: eeb1df9c-5cef-e054-8f1a-f6b060f2526c


Display Error: The display template had an error. You can correct it by fixing the template or by changing the display template used in either the Web Part properties or Result Types.


Unable to get property 'value' of undefined or null reference (CoreRender: ~sitecollection/_catalogs/masterpage/Display Templates/Search/Control_SearchResults.js)

_______________________________________________________________________
_______________________________________________________________________


Here is a link to the corresponding lines from the log from when the search term is first seen (saxon pottery) to just after the Correlation ID is logged. The output appears to be far more verbose than that shown above so if anyone can spot what the problem may be please post.

https://onedrive.live.com/redir?resid=B3893905C8D89527!203&authkey=!AKFkmN9EHCVroHw&ithint=file%2ctxt

Thanks!

January 14th, 2015 6:38pm

Hi,

In your log, I find there is error like:

The HTTP service located at ***/SearchService.svc is unavailable.  This could be because the service is too busy or because no endpoint was found listening at the specified address. Please ensure that the address is correct and try accessing the service again later.

Please bring up IIS Manager and check if search service application pool is in started status. And access Central Administration and see if search related service is running.

Regards,

Free Windows Admin Tool Kit Click here and download it now
January 26th, 2015 5:29am

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


January 30th, 2015 9:24am

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 9:24am

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


January 30th, 2015 12:24pm

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 12:24pm

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


January 30th, 2015 12:24pm

Hi, Rebecca

Thanks for looking at that and please accept my apologies for the late reply.

I cannot see a search service entry in the Application Pools in IIS Manager:

And the search (query and site settings) service and SharePoint server search service on the SharePoint server is started:


Free Windows Admin Tool Kit Click here and download it now
January 30th, 2015 12:24pm

Same error here. Weird thing is that this only happens on IE and not on Firefox and Chrome that are working very well with search. Is it possible to make search script ignore IE
January 30th, 2015 12:30pm

I got some more information about this issue. I set ScriptManager on master page to degub mode:

<asp:ScriptManager id="ScriptManager" ScriptMode="Debug" ... />

This makes SharePoint use debug version of scripts. Exception is thrown in Search.ClientControls.debug.js:

function $urlHtmlEncode(str) { // should be used only for href and src attributes
	if('string' === typeof str)
	{	
		return Srch.U.encodeUrlForHtmlAttributes(Srch.U.ensureAllowedProtocol(str));
	}
        // Here comes exception
	else if(!Srch.U.n(str.value)) // we're doing this for backward compatibility 
	{
		return Srch.U.encodeUrlForHtmlAttributes(Srch.U.ensureAllowedProtocol(str.value));
	}
	else // we're doing this to not to break any display template
	{
		return $htmlEncode(Srch.U.ensureAllowedProtocol(str)); 
	}
}

NB! Just to check if problem goes away I temporarily added the following line as first one in method above:

if(str == null)	return null;

Saved script file, refreshed search page in IE and it works.

Not sure why this kind of problem appears in browser built by same company that builds SharePoint but this hack seems to be temporary solution. It should be possible to override this method and avoid changing system files but this is something I'ms still worki

Free Windows Admin Tool Kit Click here and download it now
January 31st, 2015 5:32am

Hi,

Please execute the command below and use ID to locate Search service application in IIS manager:

Get-SPServiceApplicationPool -id ssaadminwebservice | fl

And bring up Services.msc and check SharePoint server search 15 is in running status:

Regards,

February 1st, 2015 10:42pm

Hi, Rebecca

Thanks again for the help. When I use PowerShell to run the command it gives the following output:

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Users\administrator.HTLINCS> Get-SPServiceApplicationPool -id ssaadminwebservice | fl
Get-SPServiceApplicationPool : The term 'Get-SPServiceApplicationPool' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ Get-SPServiceApplicationPool -id ssaadminwebservice | fl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-SPServiceApplicationPool:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\administrator.HTLINCS>

I can see SharePoint Server Search 15 service is set to automatic and is running.

(I also opened the intranet in Chrome but that gives the same error when trying to display the search results.)

Free Windows Admin Tool Kit Click here and download it now
February 2nd, 2015 7:38am

That normally means that you haven't loaded the SharePoint PS Snapin. This is for 2010 but it's still valid for 2013 and a good beginner link

http://www.alottolearn.net/2012/03/05/start-powershell-sharepoint-snap-in/

February 2nd, 2015 7:42am

Thanks very much, Alex. I followed the instructions in the link you supplied and loaded the snap-in.

@Rebecca: After loading the snap-in I entered the command you quoted but the following was displayed:

Windows PowerShell
Copyright (C) 2014 Microsoft Corporation. All rights reserved.

PS C:\Users\administrator.HTLINCS> Add-PSSnapin Microsoft.SharePoint.PowerShell
PS C:\Users\administrator.HTLINCS> Get-SPServiceApplicationPool -id ssaadminwebservice | fl
Get-SPServiceApplicationPool : Object not found.
At line:1 char:1
+ Get-SPServiceApplicationPool -id ssaadminwebservice | fl
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Microsoft.Share...ApplicationPool:SPCmdletGetIisWebServiceApplicationPo
   ol) [Get-SPServiceApplicationPool], InvalidOperationException
    + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetIisWebServiceApplicationPool

PS C:\Users\administrator.HTLINCS>

Free Windows Admin Tool Kit Click here and download it now
February 3rd, 2015 3:52am

Hi,

Please check the result if you execute Get-SPServiceApplicationPool.

Re

February 3rd, 2015 9:20pm

Hi,

Please check the result if you execute Get-SPServiceApplicationPool.

Re

Free Windows Admin Tool Kit Click here and download it now
February 4th, 2015 7:06am

I'm sorry to report that I am still having issues with this. I installed the recent round of Sharepoint server updates that were available via Windows update. When running the PowerShell commands above I am seeing the same error. The server build is reported as 15.0.4569.1000

I tried another search for saxon pottery and the search failed with the same error message. The correlation ID was:
a8a8f39c-6cc0-e054-8f1a-f9ec24e7f17e

I have uploaded a zip file containing the log info from just before 'saxon pottery' appears in the log to just after the correlation ID is reported:
https://onedrive.live.com/redir?resid=B3893905C8D89527!204&authkey=!AM6zP_4YKnxFA3s&ithint=file%2czip

I have seen one suggestion where it was recommended that another Sharepoint Search Application was created but did not want to 'muddy the waters' before anyone here had any further recommendations for me to try.

Can anyone offer any extra help with this, please?

Many thanks

March 17th, 2015 12:02pm

Please try this solution eliostruyf.com/ultimate-diagnostic-display-template . According to this article's comments below it may help you.
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 3:03am

Please try this solution eliostruyf.com/ultimate-diagnostic-display-template . According to this article's comments below it may help you.

Hi, martusha

Thanks for replying. Unfortunately, this solution seems to apply to the Content Search Web Part which, as far as I am aware, is only available in the Enterprise version of SharePoint 2013.

I'm still having this problem. I'm completely at a loss. The problem I have is major because this is one of the main reasons why SharePoint was installed.

Anyone know of a similar content search and indexing utility that I can use with SharePoint Foundation 2013, please?

Thanks

May 20th, 2015 6:32am

I had the same error after I created a display template for use with our staff directory, turns out that one of the properties was empty, as in there was nothing being returned as not every item in the staff list had a picture against it, so I put the following into the display template which sets a default value if the value of the managed property is empty/null:

var uPicUrl = ctx.CurrentItem.StaffPicture;
var defaultPicUrl = "~sitecollection/_layouts/15/images/o14_person_placeholder_96.png";
if ($isEmptyString(uPicUrl)) { uPicUrl = defaultPicUrl }

This now shows the placeholder silhouette head if the staff entry in the list doesn't have a picture, I ended up doing this for most of my custom properties to ensure they all had something in them even if it was just a space for the straight forward text fields.

Hope that helps, let me know if you want me to look at your display template.

Free Windows Admin Tool Kit Click here and download it now
June 24th, 2015 4:13am

I had the same error after I created a display template for use with our staff directory, turns out that one of the properties was empty, as in there was nothing being returned as not every item in the staff list had a picture against it, so I put the following into the display template which sets a default value if the value of the managed property is empty/null:

var uPicUrl = ctx.CurrentItem.StaffPicture;
var defaultPicUrl = "~sitecollection/_layouts/15/images/o14_person_placeholder_96.png";
if ($isEmptyString(uPicUrl)) { uPicUrl = defaultPicUrl }

This now shows the placeholder silhouette head if the staff entry in the list doesn't have a picture, I ended up doing this for most of my custom properties to ensure they all had something in them even if it was just a space for the straight forward text fields.

Hope that helps, let me know if you want me to look at your display template.


Thanks - does this apply to SharePoint Foundation? I can't find anything about editing display templates for Foundation, only for the full version.
June 25th, 2015 4:19am

Ah, Display Templates aren't supported in Foundation.
Free Windows Admin Tool Kit Click here and download it now
June 25th, 2015 6:05am

I know it is not good a solution, but in my case it helped when i added English (USA) as my language under my user from My Settings -> Language and Location. I had nothing there and got "Unable to get property 'value' of undefined or null reference (CoreRender: ~sitecollection/_catalogs/masterpage/Display Templates/Search/Control_SearchResults.js)" error in IE (not in Chrome and Firefox).
June 25th, 2015 8:55am

I have given up on this. There's obviously something here that is preventing search results from being displayed.

I am extremely grateful to everyone who has contributed for their help and patience, especially Rebecca Tu. It is not often that a question remains unresolved and I know that it is not through a lack of trying so thanks everyone :)

I have downloaded Search Server Express 2010 and have installed it on a separate 2012 server. Two reboots later and it is working like a charm. I type Saxon pottery in the search box and about 2000 results are returned.

Thanks again and I hope you people have a great weekend.

Free Windows Admin Tool Kit Click here and download it now
June 26th, 2015 3:40am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics