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!

 

Parse Error in SharePoint Page Layout

If you ever bumped into this issue when your custom SharePoint Page Layout cannot be rendered properly. You may try the resolution steps below

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Only Content controls are allowed directly in a content page that contains Content controls.

In SharePoint branding journey, you often need to create your custom page layout to present your article base on Designer’s template file.

And if you are doing it, there is 1 important thing that you should Avoid doing. And that is to Auto Formatting your PAGE LAYOUT!

If you have not noticed (probably you haven’t because you found my article!)

Once you auto formatting your Page Layout via Visual Studio function  CTRL + E + D

<asp:content contentplaceholderid=”PlaceHolderPageTitle” runat=”server”>

See clearly, there is a problem with the Tag above. the “c” for content is auto formatted to be lower case! It matters! Lower c and Upper C make a huge different! It took me one whole one to try out and fix this issue!

Resolution

If you want to make use of the auto formatting (to tidy up your code) please remember to REPLACE ALL (CTRL + H) for “asp:content” to “asp:Content”. Make sure your match case is checked when replacing all

replace all match case page layout error

Jeez!

 

How to Swing SharePoint to a new (clone) Config DB after Restoring from Backup

I have a request to get a restored SharePoint 2010 up for some recovery. The existing SharePoint is still running while having its same Image restored to a separate Server, the first key important thing is that the cloned Server should not have the same Host Name as per the existing one.

Once you boot up the cloned Server, the HostName is changed and you will hit Error when connecting to SharePoint configuration server.

So, if you run SharePoint Product Configuration Wizard, You will hit error again saying you cannot connect to existing Config DB. Simply because your cloned server is still pointing to OLD Config DB (OLDHOSTNAME\SQLInstance).

Resolution

What you can only do! (as far as i know!) is to run the following STSADM comment

stsadm.exe -o setconfigdb - -databaseserver "<DatabaseServer>" -farmuser "<DOMAIN\YourFarmAccount>" -farmpassword "<YourFarmAccount Password>"

Once its done, rerun SharePoint Product Configuratino Wizard…

SharePoint Installation Error – Requires .NET Framework 4.5 despite having .NET Framework 4.6

I was puzzled when trying to install SharePoint 2013 in Windows 2012 R2. For the past few months when I was doing the same steps, this error did not occur.

If you have done Prerequisite Installation and trying to install SharePoint 2013, You MAY encounter this error message

Setup is unable to proceed due to the following error(s):

This product requires Microsoft .Net Framework 4.5.

Net 4.6 error when installing SP2013

Having checked in your registry stated here, my .net framework was 4.6 (huh? isn’t 4.6 is better and higher version than 4.5 that’s required?)

Yea, so the installer does have a little issue if we have Higher version of .Net Framework.

Resolution

They underlining issue for this is that the Windows 2012 R2 provisioned is pre-installed with .NET Framework 4.6

To undo this 4.6 version, you would have to go to your Control Panel and uninstall the KB3102467 Windows Update

uninstall sharepoint kb .net 4.6

SharePoint Custom Solution Branding and Tips – Part 2

This is part 2 on how to brand your SharePoint Solution. If you haven’t read my part 1, please do so here.

Often than not, you would want to include your custom List Definition/Instance to be provisioned into your Solution file. In SharePoint 2013, they’ve changed the Site Content page drastically and you can’t really Ignore the BIG BIG icon for each List/Library within your site.

sharepoint site content list icon image

It’s fancy and it’s sleek. So how can I create one for my own solution?

As usual, there isn’t gonna be much documentation provided in MSDN. And most of the time, you just got to crack your head and dig your way out. I’m writing this post here so that you can at least Find my article when you’re googling around.

How to set Image for your List Definition / List Instance

Assuming you have already created a SharePoint 2013 Project solution and added a List Definition.

Add SharePoint “Images” mapped folder into your Project as shown below

right click add image layout folder sharepoint

Prepare TWO icons and you must ensure that the following rules are followed:

  1. Both icons must have same file extension.
  2. One icon is in 16×16 pixel size and the other one is in 96×96 pixel size
  3. File Name of the 16×16 icon must starts with small I: “it” e.g. itmyfancyicon.png
  4. File Name of the 96×96 icon must starts with small L: “lt” e.g. ltmyfancyicon.png
  5. Both file names must be exactly the same except for the first character.

To better helping you to understand, I’m including the two images used below

itmyfancyicon.png itmyfancyicon  (16×16)                  ltmyfancyicon.png ltmyfancyicon (96×96)

After meeting these rules, you need to include them into the Images mapped folder and be placed into the same Folder. (Must)

sharepoint list icon image same folder

Lastly, go to the Elements.xml file of the list definition and modify the Image Attribute to point to “it” (16×16 pixel size) image as shown below. DO NOT specify the one that starts with “L”.

http://wp.ahcheng.com/wp-content/uploads/2016/01/sharepoint-list-definition-image-url-attribute.png

Once you specified to the small “i” image, deploy it and you should see your List is having a nice and Correct images!

http://wp.ahcheng.com/wp-content/uploads/2016/01/sharepoint-list-definition-image-how-to-set-it-properly.png