Symptoms
Assume that you have a FILESTREAM-enabled database in an instance of Microsoft SQL Server. When you start a transaction and use the SqlFileStream .NET API to open a Filestream file, the task may fail and throw an exception because of external factors.
If you open the file again by using SqlFileStream within the same transaction and commit, you may receive internal error messages that resemble the following:
date time, spids, Unknown, Error: 5571<c/> Severity: 23<c/> State: 3.
date time, spids, Unknown, Internal FILESTREAM error: failed to access the garbage collection table.If you run dbcc checktable ('sys.filestream_tombstone_2073058421'), you may receive the following error message:
Msg 8951, Level 16, State 1, Line LineNumber
Table error: table dbcc checktable ('sys.filestream_tombstone_2073058421') (ID IDNumber). Data row does not have a matching index row in the index 'FSTSNCIdx' (IDIDNumber). Possible missing or invalid keys for the index row matching:
Resolution
The fix for this issue is included in the following updates for SQL Server:
Cumulative Update 13 for SQL Server 2017
About SQL Server builds
Each new build for SQL Server contains all the hotfixes and security fixes that were in the previous build. We recommend that you install the latest build for your version of SQL Server:
Workaround
To work around this issue, rebuild the database index by using the DBCC CHECKTABLE command.
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
References
Learn about the standard terminology Microsoft uses to describe software updates.