Saturday, June 25, 2011

MissingSetupFile, feature not installed on the current farm

During the development of a web part, after changing the feature name, I occasionally noticed the error below appeared in "Central Administration -> Monitoring -> Health Analyzer -> Review problems and solutions":


[MissingSetupFile] File [Features\ListViewNoHeader_EFSPWebParts ListViewNoHeader\ListViewNoHeader\ListViewNoHeader.webpart] is referenced [1] times in the database [WSS_Content], but is not installed on the current farm. Please install any feature/solution which contains this file. One or more setup files are referenced in the database [WSS_Content], but are not installed on the current farm. Please install any feature or solution which contains these files. 

It's not easy to resolve it. After hours of research, I still could not find an "official" way. It doesn't cause any actual problem, but if it is on the production server, it might make IT manager nervous.

In the end, I changed the data in the SharePoint SQL database --- I know it's also risky, but so far, everything works well. Below is the SQL scripts.

--confirm(find) the feature id first
select * from [dbo].[AllDocs]
where SetupPath like '%ListViewNoHeader%'

-- the feature id is: '518C07DB-4AB2-487B-BCDB-991527B97548'

-- change the SetupPath to the correct one:
update dbo.AllDocs set SetupPath='Features\ListViewNoHeader_ListViewNoHeader\ListViewNoHeader\ListViewNoHeader.webpart'
where Id='518C07DB-4AB2-487B-BCDB-991527B97548'

6 comments:

  1. If you get a lot of these errors, I have created automated scripts based on input txt files, feel free to use it:

    For[MissingSetupFile] events, please check this article

    For[MissingAssembly] events, please check this article

    For [MissingWebPart] events, please check this article

    For [MissingFeature] events, feel free to use the great tool FeatureAdmin, it can scan the whole farm and remove the corrupted feature references.

    ReplyDelete
  2. Hi Etienne,

    Thanks for your help, I will definitely try it next time. However, the links don't show up in your comments, could you add them to your comments again?

    ReplyDelete
  3. Eitenne,

    Please post the links to your articles.

    Thank you in advance.
    dntbdum@comcast.net
    Kelly

    ReplyDelete
  4. Check the web part gallery in your site. May be there is the ".webpart" file. You have to remove manually the file because the uninstall command of the solution did'nt work properly.

    ReplyDelete
  5. Piero,

    Thanks for your help, I will check it next time if got the same issue.

    ReplyDelete
  6. Dont miss to remove the ".webpart" file completely, also from the recycle bin and from the site collection recycle bin.

    Bye

    ReplyDelete