File name you have received is either invalid or too long excel sharepoint2013

I have just created a new web application and site collection in SharePoint 2013.  With a large number of documents to place into a Document Library I thought it would be easier to copy and paste them using Windows Explorer, so I opened the document library and click Open with Explorer.

The filename you’ve specified is either invalid or too long Specify a different filename.

filename invalid too long specify different name excel sharepoint

filename invalid too long specify different name excel sharepoint

As a test I tried to upload a single file using the browser but this generated the following error:

Sorry, something went wrong.The URL ‘Shared documents/Project budget.xlsx’ is invalid.

something went wrong url invalid

something went wrong url invalid

The filename isn’t very long at all, including the full path, so I found this quite strange.  I immediately started looking through the ULS logs and the following entry caught my eye, which was logged at the same time I tried to upload the files:

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: RBS Error. Original Error: Number 297, Severity 16, State 1, Procedure rbs_fs_sp_check_pool_size, Line 31, Message: The user does not have permission to perform this action.  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, Action`1 wrapCloseInAction)

I do have RBS (Remote Blob Storage) enabled for this content database so it appears that this has got messed up somehow.  After reading various other blog posts and TechNet articles I began some trial and error with the database permissions.  The only way I found to solve this was to grant the service account used by the application pool db_owner rights on the content database, in addition to the db_rbs_* permissions.

SP portal AppPool Permissions

SP portal AppPool Permissions

The original error about the filename being too long or invalid is very misleading, there is no hint of a permissions issue until digging into the ULS logs.

Something went wrong error after enabling RBS sharepoint2013

I have just configured and enabled RBS for my SharePoint 2013 environment and now when I try to access the site I get the following error message:

Sorry, something went wrong Something went wrong error after enabling RBS sharepoint

Cannot complete this action.

Please try again.

Yet another fine example of unhelpful error messages from Microsoft!  Well, a quick check of the Event Log revealed nothing so I moved on to the ULS log.  Just before the error was generated the following lines were recorded in the log

System.Data.SqlClient.SqlException (0×80131904): The EXECUTE permission was denied on the object ‘rbs_fn_get_blob_reference’, database ‘WEBBWORLD_Content_Portal’, schema ‘mssqlrbs’.

SQL error code from last error 229 – The EXECUTE permission was denied on the object ‘rbs_fn_get_blob_reference’, database ‘WEBBWORLD_Content_Portal’, schema ‘mssqlrbs’.

Clearly the problem was down to permissions.  After a bit of trial and error I discovered that the fix was to grant the following permissions to the Application Pool account on the content database:

  • db_rbs_admin
  • db_rbs_filestream_maintaner_1
  • db_rbs_filestream_reader_1
  • db_rbs_filestream_writer_1
  • db_rbs_maintainer
  • db_rbs_reader
  • db_rbs_writer