Category Archives: SharePoint 2016

SharePoint Search Service – service implementation object was not initialized

As usually, the same opening statement.

“I recently bumped into this issue” where my Search Service Application services is throwing “service implementation object was not initialized” error when perform a regular, normal, nothing-special search from any sharepoint site collection.

Note that in my SharePoint Farm, I have two search server that are both hosting the 6 components

  • Admin Component
  • QueryProcessing Component
  • Index Component
  • Crawl Component
  • ContentProcessing Component
  • AnalysticProcessing Component

When accessing to Central Admin > Manage Service Application > Search Service Application page, I notice the “All Status” is “All Errors” and if it is hitting my another central admin server (i have 2, yea same server), it gives “Running”.

For this, I seem that there is some issue when server is trying to TALK to each other. Also, if  you browse into Search Schema (the old Managed Properties page), You do not see any managed properties to be configured.  Browsing to “Content Source” page will give you “Service Implementation object was not initialized” error

Flipping through my ULS logs for both server, you will see errors right below (putting the error here so it help Google Search for people hitting the same error and be able to find out my article that may be able to help them)

failed to get default collection for application Search Service Application: System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The service implementation object was not initialized
SearchServiceApplicationProxy::GetQueryHealthMonitoringSettingsForComponents--Error occurred:System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: The service implementation object was not initialized
Exception when reading aggregator settings: ...

All over the logs file.

It took me 7 rounds of re-provisioning of Search Service Application… in order to get it tested and fixed. I hope you do not need to spend that much time !

Occasionally, you see Error reported in Event Viewer

A failure was reported when trying to invoke a service application: EndpointFailure
Process Name: OWSTIMER
...
Service Application Uri: urn:schemas-microsoft-com:sharepoint:service: ...
...
Affected Endpoint: http:// xxxx /SearchService.svc

Resolution

All these are signs of SSL validation error that causing SVC end point failure. I followed this article (thanks to the author!) and trying to remove and add SSLCert with certification revocation disable.

  1. RDP to Search Server with Local Administrator rights
  2. Fire up “CMD” command prompt
  3. Execute
    netsh http show sslcert
  4. Note down the detail for ip port : 0.0.0.0:32844 (especially the Hash number) cause this is what the cert binding for SharePoint Web Service
    SharePoint SSL Cert binding revocation disable
  5. Execute command below to Delete the SSL binding
    netsh http delete sslcert ipport=0.0.0.0:32844
  6. You should see a success message. Then execute the following to add the SSL Binding with verify client certificate revocation Disabled
    netsh http add sslcert ipport=0.0.0.0:32844 certhash=18e363549ba0c0445625cc47ecbfb5dbbd4ec517
    appid={4dc3e181-e14b-4a21-b022-59fc669b0914}
    certstorename=SharePoint verifyclientcertrevocation=disableNote that the certhash should follow your own Cert.
  7. Repeat the same steps to all your Search Server
  8. Once it is added, I did a re-provisioning of my Search Service Application… And Woala!

 

 

Exception calling “Update” with “0” argument(s): “Invalid look-up value

Had this error when trying to update SharePoint SPFieldLookupValueCollection using PowerShell.

Just to share a small part of my PowerShell that DID NOT Work

$valueCol = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection;
 
 $groupValue.Split(",") | % {
 $lookupTitle = $_;
 $lookupItem = $lookupItems| ? {$_.Title -eq $lookupTitle};
 if($lookupItem -eq $null)
 {
 Write-Host -f Yellow "Unable to locate Lookup Item $lookupTitle."
 }
 else
 {
$val = New-Object Microsoft.SharePoint.SPFieldLookupValue($lookupItem.ID, $lookupTitle);
 Write-Host "`t`tLookup:" $val.LookupId " LookupValue:" $val.LookupValue
 $valueCol.Add($val);
 }
 }
 
 Write-Host "`tAdding Value" $valueCol;
 $existingItem["MultipleLookupColumnName"] = $valueCol;
 $existingItem.Update();

I thought it was easy. Turned out that this script WILL ONLY store the last value of the loop that you updated. That means, if you were to have Multiple Value of “A,B,C”, it stores only the C !

Resolution

It turns out that you just need to include the Type of the object before intializing a PowerShell Variable and it works perfectly fine.

[Microsoft.SharePoint.SPFieldLookupValueCollection]$valueCol = New-Object Microsoft.SharePoint.SPFieldLookupValueCollection;

$groupValue.Split(",") | % {
$lookupTitle = $_;
$lookupItem = $lookupItems| ? {$_.Title -eq $lookupTitle};
if($lookupItem -eq $null)
{
Write-Host -f Yellow "Unable to locate Lookup Item $lookupTitle."
}
else
{
[Microsoft.SharePoint.SPFieldLookupValue]$val = New-Object Microsoft.SharePoint.SPFieldLookupValue($lookupItem.ID, $lookupTitle);
Write-Host "`t`tLookup:" $val.LookupId " LookupValue:" $val.LookupValue
$valueCol.Add($val);
}
}

Write-Host "`tAdding Value" $valueCol;
$existingItem["MultipleLookupColumnName"] = $valueCol;
$existingItem.Update();

So please dont forget to do that!

 

CAML Query did not return result for Date Range query

Having developing SharePoint for so many years, I just got to know that you CANNOT perform CAML Query for Date Range where your ISO Value is a DateTime.MinValue.

CAML Query does not support Date Value of DateTime.MinValue

SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.MinValue)

For example, if you were to query the Event Date Time from day 1

<Geq> 
 <FieldRef Name='EventDate' />
 <Value IncludeTimeValue='FALSE' Type = 'DateTime'>" + 
SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.MinValue) + @" </Value>
 </Geq>

DO NOT DO this. You will never get any result. The minimal value that you can insert (had some googling around the web), is 1900/01/01.

Just make sure you conduct a date time in 1900 year onwards and you will be safe.

Create a Page in SharePoint sub site is not adding to the sub site but the Root site

I hope the post title did not confuse you. I hit this weird behaviour in SharePoint when I was in “www.sharepoint.com/subsite” trying to create a Page in “www.sharepoint.com/subsite/pages” library. The dialog shows URL of Root Site in “Find It at”

create a page not adding to correct site 1

If you proceed to create the page, it will be added into ROOT SITE! which is not what I wanted

Resolution

To avoid confusing and to make the “add a page” adds pages to the correct site. Please do the following:

  1. Go to your sub site setting page
  2. Go to “Navigation” under look and feel section
  3. Uncheck the field “
  4. Click “OK” an save

Once you have unchecked the field, your “add a page” is now adding to the correct subsite!