Monday, December 16, 2013

Http request user-agent header's value of Sharepoint 2013 Search crawler

Can be found here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\15.0\Search\Global\Gathering Manager in UserAgent key.

By default it's set to Mozilla/4.0 (compatible; MSIE 4.01; Windows NT; MS Search 6.0 Robot in Sharepoint 2013.

Thursday, November 7, 2013

Get rid of OpenQuery Failed with status ID: 0x800007d0 in ULS

After provisioning Search Application you might see a lots of errors in ULS:

mssearch.exe (0x13C0)                    0x1250 SharePoint Server              Unified Logging Service        9saa Unexpected OpenQuery Failed with status ID: 0x800007d0. QueryPath: \Search Gatherer Projects - SharePointServerSearch(Search_Service_Application_1_0_Portal_Content)\Transactions Completed. instanceHandle: 3.
mssearch.exe (0x13C0)                    0x1250 SharePoint Server              Unified Logging Service        9saa Unexpected OpenQuery Failed with status ID: 0x800007d0. QueryPath: \Search Gatherer Projects - SharePointServerSearch(Search_Service_Application_1_0_Portal_Content)\Transactions In Progress. instanceHandle: 3. 

To fix the problem follow the step below:

1. Fix Usage and Health Data Collection Service Application Proxy as described here: http://tristanwatkins.com/fixing-the-usage-and-health-data-collection-sa/
2. Check if an account of crawl component is a member of "Performance Monitor Users" local security group.

Fix Usage and Health Data Collection Service Application Proxy

1. start Sharepoint management shell as administrator
2. run the script:

$sap = Get-SPServiceApplicationProxy | where-object {$_.TypeName -eq Usage and Health Data Collection Proxy”} $sap.Provision()
3. restart IIS

4. open Search Service Administration in SP Central Administration
5. click on Index Reset, then Reset Now
6. check the ULS if the error dissapeared.


Wednesday, August 7, 2013

SPList.ParentWebUrl != SPList.ParentWeb.Url

These two proerties looks similar and expected to be equal, but they don't.

SPList.ParentWebUrl   - server relative url;
SPList.ParentWeb.Url - absolute URL for the website.

SPList.ParentWebUrl != SPList.ParentWeb.Url :)

Thursday, July 4, 2013

URL format in New-SPSite

When creating a new site collection using PowerShell:

New-SPSite $siteCollUrl -Name $siteCollName -Template $template -OwnerAlias $siteCollAdmin –Language $siteCollLanguage

you might get an exception:

New-SPSite : The URL '/sites/sitecollname/' is invalid.  It may contain illegal characters, or be too long.

The problem is caused by the trailing slash in the new site collection URL. It should be removed.

Tuesday, June 11, 2013

Sharepoint 2013 + EntLib 5 Validation block

Using Enterprise Library 5 with Sharepoint 2013 could be a tricky. A strange exception is thrown from Validation block of EntLib when it's used from Sharepoint:

Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ValidatorFactory, key "" ---> Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Validation.ValidatorFactory", name = "(none)".  Exception occurred while: while resolving.  Exception is: InvalidOperationException - The type ValidatorFactory does not have an accessible constructor.  -----------------------------------------------  At the time of the exception, the container was:      Resolving Microsoft.Practices.EnterpriseLibrary.Validation.ValidatorFactory,(none)   ---> System.InvalidOperationException: The type ValidatorFactory does not have an accessible constructor.

The solution is to add the following configuration elements into web.config:

1. Add a section declaration into <configSections>

<section name="typeRegistrationProvidersConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.TypeRegistrationProvidersConfigurationSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.1.508.0, Culture=neutral, PublicKeyToken=3602034a0e4e3f13" />

2. Add the section into <configuration>

<typeRegistrationProvidersConfiguration>
    <remove name="Validation" />
    <add name="Validation" providerType="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationTypeRegistrationProvider, Microsoft.Practices.EnterpriseLibrary.Validation, Version=5.1.508.0, Culture=neutral, PublicKeyToken=3602034a0e4e3f13" />
  </typeRegistrationProvidersConfiguration>