Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
96 views
in SharePoint Server by 5 7 18
edited by

I got this error "Feature is referenced in database, but isn't installed on the current farm" in SharePoint 2019 when I tried to run the SharePoint 2019 configuration wizard to apply SharePoint Cumulative update but the SharePoint configuration wizard failed with this error.

Failed to upgrade SharePoint Products.

An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown.  Additional exception information:
Feature (Id = [e9728ee6-7bfc-40a1-ad72-aa9a57e14407]) is referenced in database [WSS_Content_A3maly], but isn't installed on the current farm. The missing feature might cause upgrade to fail. If necessary, please install any solution that contains the feature and restart upgrade.        (EventID:ajxkh)

Upgrade completed with errors.  Review the upgrade log file located in F:\SPLog\Upgrade-20221115-134601-649-58ca2d5939c94d58bb9dad4036b9f2d0.log.  The number of errors and warnings is listed at the end of the upgrade log file.

Follow this link for more information about how to troubleshoot upgrade failures:
https://go.microsoft.com/fwlink/?LinkId=866803


Total number of configuration settings run: 8
Total number of successful configuration settings: 7
Total number of unsuccessful configuration settings: 1
Successfully stopped the configuration of SharePoint Products.
Configuration of SharePoint Products failed.  Configuration must be performed before you use SharePoint Products.  For further details, see the diagnostic log located at F:\SPLog\PSCDiagnostics_11_15_2022_13_44_53_630_1887543379.log and the application event log.

Feature is referenced in database WSS_Content, but isn't installed on the current farm

How can I solve this error Feature is referenced in database, but isn't installed on the current farm to run SharePoint Configuration Wizard successfully.


1 Answer

1 like 0 dislike
by 56 122 251
selected by
 
Best answer

Solving Feature is referenced in database but isn't installed on the current farm

One of the known issues in SharePoint Server when trying to run the configuration wizard to apply new cumulative updates and failing to complete is "Feature is referenced in database, but isn't installed on the current farm".

Why you got "Feature is referenced in database, but isn't installed on the current farm" in SharePoint 2019?

This error occurs due to Missing Features Dependencies that are already referenced in your content database that it's not currently installed in your farm.

How to solve "Feature is referenced in database, but isn't installed on the current farm" in SharePoint 2019?

To solve this issue you have to do the following:

  1. Fix Missing Server Side Dependencies by removing the missing features from the farm
  2. Fix the Content Database Version Mismatch

1) Removing the missing features from the farm in SharePoint 2019

In your SharePoint Server, Open Windows PowerShell as Administrator and run the below PowerShell script to remove all missing features from your farm:

Add-PSSnapin Microsoft.SharePoint.PowerShell

function Remove-SPFeatureFromContentDB($ContentDb, $FeatureId, [switch]$ReportOnly){
    $db = Get-SPDatabase | where { $_.Name -eq $ContentDb }
    [bool]$report = $false
     if ($ReportOnly) { $report = $true }
     $db.Sites | ForEach-Object {
          Remove-SPFeature -obj $_ -objName "site collection" -featId $FeatureId -report $report
         $_ | Get-SPWeb -Limit all | ForEach-Object {
            Remove-SPFeature -obj $_ -objName "site" -featId $FeatureId -report $report
          }
    }
}

function Remove-SPFeature($obj, $objName, $featId, [bool]$report){
  $feature = $obj.Features[$featId]
   if ($feature -ne $null) {
     if ($report) {
      write-host "Feature found in" $objName ":" $obj.Url -foregroundcolor Red
  }
   else{
      try {
        $obj.Features.Remove($feature.DefinitionId, $true)
         write-host "Feature successfully removed from" $objName ":" $obj.Url -foregroundcolor Red
     }
      catch {
     write-host "There has been an error trying to remove the feature:" $_
    }
  }
 }
else {
#write-host "Feature ID specified does not exist in" $objName ":" $obj.Url
}
}
Remove-SPFeatureFromContentDB -ContentDB "Your Content DB Name" -FeatureId "e9728ee6-7bfc-40a1-ad72-aa9a57e14407"

Note: It would be also great to check all missing dependencies as mentioned in Missing Server Side Dependencies SharePoint 20192016 Health Analyzer

2) Fix the Content Database Version Mismatch

Again run the SharePoint 2019 PowerShell as Administrator, and run the below command line to update the content database schema.

Get-SPContentDatabase | Upgrade-SPContentDatabase

Try now to run the SharePoint Configuration wizard which should be completed successfully.

run the SharePoint 2019 Configuration wizard


See Also

If you don’t ask, the answer is always NO!
...