KB2775511 – Blowing up my Usage Data Import Timer Job

This issue is described here: http://support.microsoft.com/kb/2916922 

This patch (along with  KB2682011 or KB2882822) could cause the Usage Data Import timer job to not import the .Usage files into the Usage Logging Database. When this timer job runs you will notice the following in the ULS logs:

OWSTIMER.EXE (0x51A0) 0x59E4 SharePoint Foundation Usage Infrastructure a5rv High Failed to delete usage log file ‘E:\Logs\ServerName-20130701-2117.usage’ after data import. Exception: System.IO.IOException: The process cannot access the file because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileInfo.MoveTo(String destFileName) at Microsoft.SharePoint.Administration.SPProvisioningAssistant.MoveFileOrDirectory(FileSystemInfo fi, String newPath) at Microsoft.SharePoint.Administration.SPProvisioningAssistant.DeleteFileOrDirectory(FileSystemInfo fi) at Microsoft.SharePoint.Administration.SPUsageLogImporter.ImportUsageLogFiles(List`1 usageLogFileList)

This causes a few unwanted side effects: The usage logs will grow as they are not getting imported and purged and this timer job will take a looong time to run and can cause your timer service recycle timer job to fail. I was manually restarting the timer service each day for a while, but we ended up uninstalling the patch as a longer term solution. This issue is fixed in the December 2013 CU, but that was not an option in this case.

This is why I always recommend you have a test environment…This was caught before it got pushed to PROD!

-AJB

SharePoint List Error – Exception from HRESULT: 0x80131904

Short version – This was fixed with the following procedure:

  1. Go into List Settings for the list in question
  2. Under columns I clicked the Column Ordering link
  3. Changed Title’s position from Top to be 1 (It was 2 from the top in my case)

Explanation – This list had a lot of columns (60 to be exact). After further research there’s something unique that happens when you have 16 columns in a list. Any time someone creates 16 columns in a list and then sets any column that was created in position 16+ to position 1 (It doesn’t matter the type of column) in the list you will receive that error.

Technical Explanation:  The problem here is because SharePoint utilizes SQL server row wrapping to allow a maximum number of columns in a SharePoint list where SharePoint Server will create several rows in the database when data will not fit on a single row. This is controlled via the property RowOrdinal, which identifies which row a certain field should be stored. When RowOrdinal = 0, the field is stored in the first row of the row set for that list item and when RowOrdinal = 1, the field is stored in the second row of the row set for that list item.

Lets take a look at this in action:

  1. Save list as template, open Manifest.xml
  2. Find the <Fields> Section (Notice The RowOrdinal values??)<FieldName=”Test_Task” Version=”2″ DisplayName=”Test Task” Type=”Choice” RowOrdinal=”1″ ColName=”nvarchar35″ StaticName=”Test_x0020_Task” SourceID=”{f62365c4-32fa-4f67-a714-963aa49a3f8a}” ID=”{402b7fff-701c-45b4-bc06-ffaf51dd3fe8}” FillInChoice=”FALSE” Format=”Dropdown” Indexed=”FALSE” EnforceUniqueValues=”FALSE” Required=”TRUE”><FieldName=”Title” Version=”2″ DisplayName=”$Resources:core,Title;” Type=”Text” RowOrdinal=”0″ MaxLength=”255″ Indexed=”FALSE” EnforceUniqueValues=”FALSE” ColName=”nvarchar1″ FromBaseType=”TRUE” StaticName=”Title” SourceID=”http://schemas.microsoft.com/sharepoint/v3” Required=”FALSE” ID=”{fa564e0f-0c70-4ab9-b863-0177e6ddd247}”/>

Errors in ULS Logs:

System.Data.SqlClient.SqlException: Cannot insert the value NULL into column ‘tp_DocId’, table ‘SP2010_Content_10030.dbo.AllUserData’; column does not allow nulls. INSERT fails. The statement has been terminated.

This issue is similar to http://blogs.msdn.com/b/allenwang/archive/2012/05/21/sp2010-survey-list-error-and-event-id-5586.aspx

FIPS Compliance – Keep away from SharePoint!

SharePoint does not support FIPS compliant algorithms for encryption and hashing: http://technet.microsoft.com/en-us/library/cc263215(v=office.14).aspx. Microsoft has not updated the documentation for SharePoint 2013, but after noticing some issues after an installation I can confidently tell you that it is still not supported. While running scripts to create the SharePoint 2013 Enterprise Service Applications I got flooded with a sea of red error messages for 2 particular service applications: The Secure Store Service and the Search Service. The search service created the required components, but when browsing the Search Administration page it said “Unable to retrieve topology component health states. This may be because the admin component is not up and running.” The Secure Store Service displayed an access denied error (“Sorry, this site hasn’t been shared with you”) every time we tried to manage it in Central Admin. In Eventvwr application logs we noticed the following error (I was able to reproduce this in a test VM):
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
at System.Security.Cryptography.SHA256Managed..ctor()

The key piece here is “Windows Platform FIPS”, which can be enabled in 2 places:
1) Group Policy: Check secpol.msc under Local Policies > Securiy Options. There will be a policy called: System cryptography: Use FIPS 140 compliant cryptographic algorithms, including encryption, hashing and signing algorithms
2) If group policy isn’t enforcing this registry key then possibly FIPS was switched on manually or is part of the O/S image. Check here to make sure the “enabled” DWORD value is not set to “1” here:
HKLM\System\CurrentControlSet\Control\Lsa\FIPSAlgorithmPolicy\

Stay away FIPS..stay away

-AJB

Applying March 2013 PU – BdcServiceDatabase is not upgraded

After applying the March 2013 PU for SharePoint 2013 you may notice that the BdcServiceDatabase has the following status “Database is in compatibility range and upgrade is recommended.” This can be seen by going to Central Admin | Upgrade & Migration | Review database status. You may also see the following Health Analyzer Problem:

 healthanalyzerbdc

This can be fixed easily by running the following PowerShell command:

SharePoint 2013 Web Applications not creating successfully. Not deploying all files to the virtual directory

As I was working on a 2013 environment which had some migrated 2010 sites I noticed something interesting. The request to create a new web application would just time out. After a while (after staring at working on it… for a while) it would just say page cannot be displayed and when I tried to browse the new web application after creating a root site collection it would just give me page cannot be displayed. I tried browsing to _layouts/settings.aspx and got the error: “SharePoint Could not load file or assembly ‘Microsoft.SharePoint.ApplicationPages”

This got me thinking that something wasn’t deployed to the bin folder correctly so I checked the Virtual Folder and noticed that there was no bin folder (and many of the other folders were missing). I did some research and came across this: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2ff83934-d7d1-4419-9374-3cf7a0c34d7a/new-web-application-not-creating-correctly

This seems to be an issue with some environments that have been migrated from 2010 to 2013 and to fix the issue I had 2 options:

  1. Set the Central Admin App Pool Shutdown Limit to 400 temporarily
  2. Copy all contents from a working SharePoint site into this folder.

I chose to update the App Pool because the folders did not get permissions provisioned properly either (Everyone was not granted read access to the virtual directory). After making this change everything provisioned properly