Content database has feature orphans

Posted on 2013-02-01
Last Modified: 2013-02-03
On the health monitor, under server side dependencies, I've received the following error that I'm sure people have seen before.

[MissingFeature] Database [WSS_Content] has reference(s) to a missing feature: Id = [6984f8e8-f991-4ae0-aa23-02a6cbf94a55], Name = [Feature Demo], Description = [], Install Location = [FeatureDemo]. The feature with Id 6984f8e8-f991-4ae0-aa23-02a6cbf94a55 is referenced in the database [WSS_Content], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.

I also get an error under content databases, which seems to be caused by the same thing, orphaned features in the content database. I know how this happened but I'm not sure why.

I created a few features that weren't working even though they were installing and activating fine. I tried many install/activations and many uninstall/deactivations. I finally wiped everything out. First I deacativated all features (there were only about 4 that I created) and uninstalled them all and then even wiped out their feature folders in the features directory under SP root. Then i deleted the site collection and created a new one in it's place.

So it would appear that somehow, even if you do a proper deactivation first and then a proper uninstall, these don't really do what they advertise and apparently do not do their job by removing it's content database reference. I would rather not have to perfectly recreate these features with the exact original guids and reintroduce these folders back into the features folder

I ran stsadm -o databaserepair -url "" -databasename WSS_Content -deletecorruption

I don't believe I had any syntax errors because it ran for a few secs but it returned to the prompt with no output. Ran the reanalyze now for the error in Central admin and it's still shows up as an error. Restarted the iis, but it didn't help.

Has anybody else run into this really stupid problem maybe when they tried an upgrade??
Question by:BobHavertyComh
  • 4
  • 3

Author Comment

ID: 38844500
I also went into the sql management studio, went to the features table, found the features that have the same id as the ones in the error message and deleted those rows. Stopped and restarted the SQL Server. Rebooted the entire server. Nothing was fixed, the same error messages show up in central admin.

Does anybody have any knowledge of this that actually works or do I have to do a complete uninstall? Everything I have researched flat out does not work as advertised. i can't believe that this is an unsolvable problem but with all of the recommendations I've found and tried, none of them work.
LVL 51

Accepted Solution

Ted Bouskill earned 500 total points
ID: 38846048
Well, touching the database has wiped out any change of getting Microsoft Support.  Even using proper techniques this might not be fixable now because there will be references in the databases that are broken.

Did you not look for links like this:

Or this:

However, now that you've touched the database I'm not sure they will work.

Author Comment

ID: 38846639
Well, touching the database was the only thing that seemed to work. The stsadm databaserepair with a -deletecorruption would run for a second or two, produce no output and then return to the prompt. I ran this three times. It seemed to do nothing because the orphaned features were still there, so as far as I'm concern, that command simply does not always do it's advertized job correctly and is faulty in some situations. Also what is faulty is the auto repair feature when viewing the error in Central Admin. Tech articles claim that this is how you fix the problem. They are wrong in my situation, it did absolutely nothing and was a useless feature in my case. I don't understand why things don't just work the way they are advertised, but this wouldn't be the first time an advertised Microsoft feature doesn't actually work correctly in all advertised situations.

One of the blogs you linked looks like what I should have done, remove -spFeaturefromContentDb, but I didn't know about that command and couldn't find an article that mentioned this. But why should this command ever need be run if the regular uninstall did it's job properly? So I went into the features table and one by one find the orphaned features by their id and remove their row. This didn't even work completely at first, only some of the offending orphans were removed from the error list in Central Admin. So I went back to the database, and found the entries that I swore I removed and removed them. Since a feature can be associated with many site ids, I had to find each instance of that feature for each of the site ids it belongs to, so there was more than one instance of the feature that had to be removed. So I probably manually did what remove -spFeatureFromContentDB does.

Anyway, it finally solved the problem manually, or at least according to the health analyzer it did, and everything seems to be working fine, but this is rather disgraceful that a problem has to be solved this way. If the install can add the entry to the content database and set up all the housekeeping correctly, then the uninstall should be able to completely undo everything the install does. Obviously, it does not clean up after itself, and leaves little messes behind.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Author Closing Comment

ID: 38846667
I think remove -spFeatureFromContentDB mentioned in your link would have been the proper solution and would have done what I manually did, but it "appears" as though I did the manual removal operation correctly according to the health analyzer. But as you mentioned, this shouldn't be a recommended way to do this. It stil;l seems stupid that an install can add things to the content db, but doesn't remove them from the content db upon uninstall. Theoretically, remove -spFeatureFromContrentDb should never even need to be invoked, if the uninstalls worked properly.
LVL 51

Expert Comment

by:Ted Bouskill
ID: 38846930
I completely agree that there are some flaws with the install/uninstall process with features (and other items) in SharePoint and have been for years.  However, if you use the right search terms in search engines I guarantee someone else has run into it and find a solution.

I find those links in seconds using Google.  Sometimes it's a matter of using the right search terms and even trying another engine like Bing.  Bing seems to do better searching for Microsoft issues which is not a surprise.

Author Comment

ID: 38848469
Of course I searched a lot. The problem is that the only two answers I could find was the auto repair, which didn't work, and databaserepair which did not work as well. None of the articles I saw mentioned remove -spFeatureFromContentDatabase and they instead all said databaserepair. In fact, one article, from a Microsoft MVP even said that when all else fails, (and apparently all else can fail, maybe even often), go into the features table and manually remove the offending items. That's where I got the idea from, and apparently it did indeed work, although that's a really bad idea because I have no idea what sort of dependencies the record could have had. So I'm guessing that remove -spFeatureFromContentDb merely does exactly what I did and fortunately, nothing more. Luckily, it seems as though in the case of features, since it also has a site id column, then it would seem that any entries in the sites table have no dependencies to entries on the feature table and that it is the feature table entry that does the attaching to the site id, so feature records can be deleted without effecting site records. If something was wrong, I think I would start to see problems or at least strange ambiguities start to pop up, but now the site is actually, finally working perfectly. Even before the errors popped in the the health analyzer, I was having strange behavior such as successfully installing a feature that deploys a file, and then it successfully activates, but the file never shows up. Same problem with a content type I created, everything went fine but it would never show up in the content type list. Now they all do upon deactivation and activation. Weird stuff. I'm just a beginner teaching myself, so to have to run into very advanced problems like this from the beginning is very tough.
LVL 51

Expert Comment

by:Ted Bouskill
ID: 38848846
I hear you loud and clear.  Overall I've found lots of configuration issues with SharePoint that are the biggest pain point when administrating the farm.  For example, getting the Profile Service running is finicky because if you don't do it just right and have one misstep it fails.

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now