Recently I noticed that one file seems corrupted. In IE, it complains that "File not found". In SharePoint designer, it says:" Server error: The URL 'xxxxxxxx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current web."
I dig into it. In SQL table "[AllDocs]", the field "HasStream" of this file is "0". Of course, there is no relevant item in table "[AllDocStreams]".
There are other similar files with "0" value in "HasStream", but they work well.
Then, where is the missing file content?
In field "[AllDocs].[SetupPath]" of this file, the value is "Features\xxxx\xxxxxx.xsl". That reminded me that the missing file was used by a customized feature, and that feature was uninstalled a while ago.
So, this file was not uploaded manually, but been deployed with a feature! That explained everything.
To avoid this issue, we have two options.
- Don't deploy files into document library directly as part of feature.
- Delete the files when relevant features are uninstalled.