0

I'm trying to migrate a content database's BLOBs back into SQL Server using PowerShell script. The migrate() process runs for about 20 minutes but then fails with the following error:

System.Management.Automation.MethodInvocationException: Exception calling "Migrate" with "0" argument(s): "Operati on is not valid due to the current state of the object." ---> System.InvalidOperationException: Operation is not v alid due to the current state of the object. at Microsoft.SharePoint.CoordinatedStreamBuffer.SPBackgroundFileFiller.Fill() at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBuffer.WaitForIntervalFill(SPInterval i) at Microsoft.SharePoint.Administration.SPRemoteBlobStorageSettings.MigrateRecordsToStorage(SPStreamRecordType r ecordType, ContentStorage toStorage) at Microsoft.SharePoint.Administration.SPRemoteBlobStorageSettings.Migrate() at CallSite.Target(Closure , CallSite , Object ) --- End of inner exception stack trace --- at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Excepti on exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Looking at the ULS logs the only extra information I'm given is this:

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)

So the log information doesn't really tell me anything with regard to the file(s) causing the problem.

From the research I've done it's been suggested that the Recycle Bins might need emptied. I've tried that but it still fails. I've also run the RBS Maintainer against the content database but that's not helped either.

Has anyone else seen this error? How do you go about debugging an failing RBS migration like this?

Thanks

EDIT: Following SharePointGoa's good advice I tried to run an Backup-SPSite today. Unfortunately it resulted in the same error after backing up just over 41Gb of the collection:

Here's the command prompt output.....

VERBOSE: Leaving BeginProcessing Method of Backup-SPSite. VERBOSE: Performing operation "Backup-SPSite" on Target "https://sharepoint.mydomain.com/sites/mysite". Could not read configuration for log provider . Default value used. Could not read configuration for log provider . Default value used. Could not read configuration for log provider . Default value used.

Could not read configuration for log provider . Default value us ed. Could not read configuration for log provider . Default value used. Read Failed: BLOB id: could not be found on the underlying storage Read Failed: BLOB id: 171221\1261dc44-72fa-4a78-9458-a54288fd72ca could not be found on the underlying storage Read Failed: BLOB id: could not be found on the underlying storage Read Failed: BLOB id: could not be found on the underlying storage Backup-SPSite : Operation is not valid due to the current state of the object. At line:1 char:1 + Backup-SPSite -Identity https://sharepoint.mydomain.com/sites/mysite ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ + CategoryInfo : InvalidData: (Microsoft.Share...mdletBackupSite: SPCmdletBackupSite) [Backup-SPSite], InvalidOperationException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletBackupSi te

VERBOSE: Leaving ProcessRecord Method of Backup-SPSite. VERBOSE: Leaving EndProcessing Method of Backup-SPSite.

.... and here's the ULS log for the error

The ULS logs show the following:

System.InvalidOperationException: Operation is not valid due to the current state of the object. at Microsoft.SharePoint.CoordinatedStreamBuffer.SPBackgroundFileFiller.Fill() at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedStreamBuffer.WaitForIntervalFill(SPInterval i) at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedFileStream.EnsureOkToRead(SPInterval i) at Microsoft.SharePoint.CoordinatedStreamBuffer.SPCoordinatedFileStream.Read(Byte[] array, Int32 offset, Int32 count) at Microsoft.SharePoint.SPSiteStreamBackup.CopyStreamToWriter(BinaryWriter bw, Stream stm) at Microsoft.SharePoint.SPSiteStreamBackup.BackupSqlDataToBinaryWriter(SqlDataReader dr, SPContentDatabase cdb, BinaryWriter bw) at Microsoft.SharePoint.SPSiteStreamBackup.Backup(SPContentDatabase cdb, Guid siteId, BinaryWriter bw) at Microsoft.SharePoint.SPSite.Backup(String filename, Boolean overwrite, Boolean isADMode, Boolean isReadOnlyMode, Boolean hadWriteLock) at Microsoft.SharePoint.Administration.SPSiteCollection.Backup(String strSiteUrl, String strFilename, Boolean bOverwrite, Boolean readOnlyMode, Boolean hadWriteLock) at Microsoft.SharePoint.PowerShell.SPCmdletBackupSite.InternalProcessRecord() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()

1
  • Which function from RBS Maintainer did you run? Normally this is used to perform automatic garbage collection. You should try to get more information by running operations "ConsistencyCheck" and "ConsistencyCheckForStores" and ConsistencyCheckExtent "complete". Reference here: technet.microsoft.com/en-us/library/ff943565.aspx
    – MHeld
    Jan 2, 2018 at 12:51

1 Answer 1

0

I think your RBS is broken

What you can do is, take a site collection backup (take for each site collection if there are many) of your site using Backup-SPSite Powershell command and restore it to fresh database using Restore-SPSite command. This will move all files stored on RBS back to SQL database.

1
  • Thanks for the good advice SharePointGoa. See my edit in the original question. Unfortunately it hit the same problem. There's x1 site collection in this content database. Dec 28, 2017 at 19:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.