Archive for the ‘General’ Category

SharePoint error: Unable to read full interval from database in ULS Logs

February 29, 2012

We have just implemented Remote Blob Storage using Stepwise and had a .Migrate() crash with the following error:

Exception calling “Migrate” with “0” argument(s): “A new blob could not be created Pool <GUID> ”

Over 20,000 documents had already been migrated, and general Remote Blob Storage entries were successful. Further examination of ULS log files showed the following:

Unable to read full interval from database

Background file fill operation caught exception: System.InvalidOperationException: Operation is not valid due to the current state of the object.     at Microsoft.SharePoint.CoordinatedStreamBuffer.SPBackgroundSqlFileFiller.OnReadComplete(IAsyncResult result)

The file fill it is referring to is document chunking that occurs from SQL when it is extracting data from the AllDocStreams table and trying to push this into Remote Blob Storage.

It turned out that we had a mismatch in the AllDocVersions table to the AllDocStreams table in relation to the number of bytes stored. For example, AllDocVersions said “size = 10,020 kb” but the actual binary content stored in AllDocStreams was “10,003 kb”. The Remote Blob Storage components were expecting 10,020, but only received 10,003.

I fixed this error by *gasp* very carefully modifying the  AllDocVersions entry for “Size” to match the AllDocStreams entry. You MUST BE VERY CAUTIOUS WHEN DOING THIS! In our case there were three documents out of 50,000 that had this issue, and that was also stopping content export from working as well (I assume for the same reason – mismatched size).

After running .Migrate() again, everything worked perfectly and the migration completed.

In this case I could have delete the file from SharePoint as well as from the two-stage recycle bin, but that would have meant potentially losing the versions for the files as well as the problem file. I chose this more dangerous path instead. I don’t know how the mismatch occurred in the first place but will keep an eye on it using this script to identity mismatched documents:

select    docstreams.id  
, docstreams.InternalVersion  
, LEN(docstreams.content) as StreamLength  
, docversions.size 
from dbo.AllDocStreams docstreams 
 inner join dbo.AllDocVersions docversions  
on docstreams.Id=docversions.Id  
and docstreams.InternalVersion=docversions.InternalVersion  
where docstreams.RbsId is null  
and LEN(docstreams.content) <> docversions.Size

HOWTO Remove the Add a document link from list web parts in SharePoint 2010

August 22, 2011

When you add a list web part to a page in SharePoint 2010 it automatically includes an “Add a document” link at the bottom of the web part. To remove this link:

  1. Edit the web part settings
  2. In the “Toolbar type” drop-down, select “No toolbar”
  3. Click “OK”

This will remove the link from the web part.