Blokjes

Blokjes

Wednesday, September 7, 2016

Could not get SPWeb so could not get user key.

We were seeing the following errors in the ULS during a search crawl using a custom content enrichment web service (CEWS). Unexpected: "Could not get SPWeb so could not get user key." Medium: "No user key for user in request usage." Our CEWS was running in an anonymously accessible site in a specific web application for our search center. The search center web application was running on legacy Windows authentication. The content we were indexing was in a different web application that was running on Claims authentication. The solution to our problem was convert our search center web application to Claims as well. This can easily be done using PowerShell: Convert-SPWebApplication -Identity [web application] -From Legacy -To Claims

Thursday, January 7, 2016

Invalid object name 'dbo.ECMUsage'

After attaching (restoring) our SharePoint 2010 Managed Metadata service application database to our SharePoint 2016 beta 1 development environment, upgrading the database schema failed. This resulted in a partially working service application with occasional "Operation failed..." messages.

Checking the Databases Upgrade status (Upgrade and Migration > Review database status) stated the following for our Managed Metadata database:
Database is in compatibility range and upgrade is recommended.

Checking the Upgrade status (Upgrade and Migration > Check upgrade status) pointed me to an upgrade logfile. This file contained the following error messages:

ERROR Action 16.0.9.0 of Microsoft.SharePoint.Taxonomy.Upgrade.TaxonomyDatabaseSequence failed. 46e6529d-376c-8084-2d87-feca3cee9bb5
ERROR Exception: Invalid object name 'dbo.ECMUsage'. 46e6529d-376c-8084-2d87-feca3cee9bb5
ERROR   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)     at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)     at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)     at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()     at Microsoft.Office.Server.Data.SqlSession.ExecuteScript(TextReader textReader, Int32 commandTimeout)     at Microsoft.SharePoint.Upgrade.SPDatabaseAction.ExecuteSql(String sql, Int32 commandTimeout)     at Microsoft.SharePoint.Taxonomy.Upgrade.TaxonomyDatabaseAction_16_0_9_0.Upgrade()     at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade() 46e6529d-376c-8084-2d87-feca3cee9bb5

Apparently, upgrading from schema version 14.0.10.0 to target schema version = 16.0.10.0 didn't go so well on my SharePoint 2016 environment. The biggest issue seems to be the missing table "ECMUsage", which should be added to the schema somewhere along the upgrade way.

Solution
Upgrade the Managed Metadata service application database on a SharePoint 2013 environment first. This will add the ECMUsage table and prepare the database for the upgrade on the SharePoint 2016 beta 1 environment.

In short, the upgrade from the Managed Metadata service application from SharePoint 2010 to SharePoint 2016 (beta 1) is as follows:

  1. On SharePoint 2010, mark MM database as read-only and make back-up
  2. On SharePoint 2013, restore the SharePoint 2010 MM database back-up and unmark as read-only
  3. On SharePoint 2013, create a new MM service application (using PowerShell) pointing to the restored DB. This will upgrade the MM database to the 2013 schema.
  4. On SharePoint 2013, mark MM database as read-only and make back-up
  5. On SharePoint 2016 (beta 1), restore the SharePoint 2013 MM database back-up and unmark as read-only
  6. On SharePoint 2016 (beta 1), create a new MM service application (using PowerShell) pointing to the restored DB. This will also upgrade the MM database to the latest 2016 (beta 1) schema.
More details regarding the exact upgrade steps can be found on TechNet:


Cheers.

Thursday, December 6, 2012

FASTMaxNumberOfFilters

The case

You either run into this issue in the ULS log:
12/06/2012 13:34:27.23 w3wp.exe (0x2E30) 0x35D0 SharePoint Server Search Query dn1p Medium Filter category FASTMaxNumberOfFilters in the config is in wrong format.Input string was not in a correct format. 20932873-e591-4a68-ba36-7541401c2fea
...or you face a problem like this:

You're using FAST Search Server 2010 for SharePoint and you want to remove the limit of filters returned for a single refiner. Unfortunately you're unable to do so using the MaxNumberOfFilters property of the Category element in the configuration of the Refinement web part.

The problem

Somehow, FAST ignores the setting of MaxNumberOfFilters, or at least it ignores the value of '0' which, according to MSDN should tell SharePoint/FAST to return all filters, and not just a maximum of n.

The solution

There appears to be an undocumented attribute to the Category element called FASTMaxNumberOfFilters. I don't know why this isn't documented, but if you're using FAST it's the one to use instead of MaxNumberOfFilters. I came across this fact when I wanted my refiner to show all available filters (over 500) and it was somehow capped at 100, even though I had MaxNumberOfFilters set to 0. I had several ULS Log-errors stating that FASTMaxNumberOfFilters was not provided in the correct format, which triggered me to look further into this.
Setting FASTMaxNumberOfFilters to 0 won't be interpreted as "show all". Instead, you have to provide a positive number. In my case, I used 10000 and after that I correctly got my 500+ values instead of 100.

Example:

<Category Title="Sources" Description="The source of the document" Type="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator" MetadataThreshold="1" NumberOfFiltersToDisplay="0" MaxNumberOfFilters="0" FASTMaxNumberOfFilters="10000" ShowMoreLink="True" MappedProperty="contentsource" MoreLinkText="show more" LessLinkText="show less" ShowCounts="Count" />