Whenever we upload files greater than a certain file size (for our environment, it's 60KB), we are unable to upload those files successfully, and we hit the following error:
The file name you specified could not be used. It may be the name of an existing file or directory, or you may not have permission to access the file.
Exception thrown storing stream in new SqlRemoteBlob: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Data.SqlRemoteBlobs.BlobStoreException: There was a generic database error. For more
information, see the included exception. ---> System.Data.SqlClient.SqlException:Invalid format specification: '%hs does not exist.)' while attempting 'NtCreateFile' on 'F:\RemoteBlobStore\6f93af8c-b1a1-47ae-9dfe-620417f0ff93\bf0f6c8f-3e6c-43ac-ac24-aa7afd53f98e\000298d1-000002d0-0002'.'. Transaction
count after EXECUTE indicates a mismatching number of BEGIN and COMMIT statements. Previous count = 1, current count = 0.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Data.BlobStores.FilestreamBlobStore.FilestreamWriterStream.ExecuteStoreBlobProcedure(Boolean storeInBand) -
-- End of inner exception stack trace ---
at Microsoft.Data.BlobStores.FilestreamBlobStore.FilestreamWriterStream.ExecuteStoreBlobProcedure(Boolean storeInBand)
at Microsoft.Data.BlobStores.FilestreamBlobStore.FilestreamWriterStream.Commit()
at Microsoft.Data.BlobStores.FilestreamBlobStore.FilestreamStoreLibraryBase.CreateNewBlobFromStream(Byte[] storePoolId, Stream inStream)
at Microsoft.Data.BlobStores.BlobStore.CreateNewBlobFromStream1Internal(Request request)
at Microsoft.Data.SqlRemoteBlobs.StoreBlobCommand.ExecuteProviderOperation2()
at Microsoft.Data.SqlRemoteBlobs.RemoteBlobCommand.ExecuteInternal()
at Microsoft.Data.SqlRemoteBlobs.RemoteBlobCommand.Execute()
at Microsoft.Data.SqlRemoteBlobs.SqlRemoteBlob.WriteFromStream(Stream inStream) BlobStoreException Code: OperationFailedAuthoritative -
-- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.SharePoint.RBSWrapper.SqlRemoteBlob.WriteFromStream(Stream stream)
at Microsoft.SharePoint.SqlRemoteBlobSession.StoreStreamInBlob(Int32 collectionId, String providerName, Stream stream)
This is very strange for us because this only happens on some of our sites, not all sites, and we could not find a pattern for it.
We've checked that the files are expected to be stored in RBS because the minimum file size to save to RBS is 0.
The workaround is to manually create the RBS folder as specified in the error. We got the workaround from a blog articlehere. However, we cannot just manually create the RBS folder everytime this error is encountered.
Would anyone know the cause and the fix for this problem? Thank you!









