In one of my projects we have a SharePoint solution which is deployed in a Dev, Test, Acceptance and Production environment. It seems that throughout the environments here and there we got some attention points. The SharePoint health analyzer found several problems such as MissingFeature, MissingSetupFile, MissingWebPart, SiteOrphan and all of those fall under the Missing Server Side Dependencies rule. The funny thing is that in most cases these are false positives. Mostly there’s a deleted object referencing a feature or a WebPart hasn’t be retracted completely. Both case don’t have any side effects. But we can’t have the Health Analyzer unhappy do we?
At first sight you find quite some good articles on how to resolve this:
- Phil Childs: MissingFeature
- Phil Childs: MissingSetupFile & MissingWebPart
There’s even a utility on codeplex which is also often referenced in this context:
However what I didn’t realized at fist is that since SharePoint 2010 SP1 there seems to be recycle bin at various levels.
Example #1: in order to fix the MissingWebPart issue I navigated to http://site.custom.com/_catalogs/wp which gave me an overview of all WebPart files present at that site. The one referenced in the Health Analyzer was present as well. As we no longer needed it I deleted it. Simply deleting it did not make the Health Analyzer happy.
If you want this error to go away you also need to delete it from the site recycle bin:
And also from the site collection recycle bin:
Example #2: Besides files SharePoint also keeps entire sites in the recycle bin. So you might be having a MissingFeature problem because SharePoint retains a previous/test version of a site for you. You can easily retrieve those with PowerShell:
- $site = Get-SPSite https://site.customer.com;
- $site.RecycleBin | ?{$_.ItemType -eq "Web"};
- $deletedWebs = $site.RecycleBin | ?{$_.ItemType -eq "Web"};
- $deletedWebs | % {$site.RecycleBin.Delete($_.Id)}
The second line will print the deleted sites, the 4th line will actually delete them from the Site recycle bin.
Example #3: my last example has to to with deleted site collections. It seems that every time you delete a site collection they are also retained by SharePoint. If these reference features that you no longer wish to deploy, the Health Analyzer will be unhappy as he finds site collections in the databases without the features being available on the farm. After some searching I found the following SQL query:
USE [SPS2010_ContentDB]
SELECT * FROM features
JOIN webs ON (features.webid = webs.id)
WHERE featureid = 'e8c6c808-ab0b-43ab-bdbc-a977753d754e'
The featureID comes from the Health Analyzer information.We then looked through some more tables like:
SELECT * FROM [SPS2010_ContentDB].[dbo].[AllSites]
And we saw that there were a lot more entries then we’d expect. So that’s when we realized there had to be some recycle bin for site collections. Some googling quickly gave us: SharePoint 2010: SP1 Site Collection Recycle Bin
In order to see what deleted sites are currently know to SharePoint. The command below will give ALL deleted sites collections but you can also scope the command to a Web Application.
- Get-SPDeletedSite
In order to delete all sites in the recycle bin:
- Get-SPDeletedSite |Remove-SPDeletedSite
However after executing the last command you’ll see that the Health Analyzer is still unhappy and that your SQL query still shows the entries. It seems that there’s a time job on SharePoint which handles the cleanup once a day. If you want to speed up the process, just do a run now on the Gradual Site Delete time job.
Some additional queries I used in the MissingSetupFiles & MissingWebPart problems:
- MissingSetupFile:
USE [SPS2010_ContentDB]
SELECT * FROM AllDocs
WHERE SetupPath = 'Features\EPS.SPS.Core_jQueryReferenceWebPart\jQueryReferenceWebPart\jQueryReferenceWebPart.webpart'
- MissingWebPart:
USE [SPS2010_ContentDB]
SELECT * FROM AllDocs
INNER JOIN AllWebParts ON AllDocs.Id = AllWebParts.tp_PageUrlID
WHERE AllWebParts.tp_WebPartTypeID = 'e8c6c808-ab0b-43ab-bdbc-a977753d754e'
3 comments