After patching while running product config wizard is failing

sns 9,246 Reputation points
2023-02-14T16:04:46.8466667+00:00

After patching while running product config wizard is failing , with the following errors:

Here is the CU version we have and failed at the product config wizard step:

User's image

and showing config database version also same: 16.0.5378.1000 from servers in farm section

We tried to upgrade content database with powershell that is also failing.

User's image

When we click on review database status it is keep on loading the page but not taking anywhere even it is for very long hours.

whatever server in the above marked it is same server top to bottom.

User's image

Please suggest what needs to be done. thank you

If we run only prod config wizard again what are the things we should fix?

Microsoft 365 and Office SharePoint Server For business
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    2023-02-21T08:41:48.5066667+00:00

    Hi sns ,

    According to the information in the log, the problem should be that the operating account does not have the permission of the database. Any SharePoint service account that needs to access the SQL database needs Security Administrator and DBCreator permissions on the SharePoint related database.

    Please refer to this post to check whether the account have permission.

    Removing the missing features from the farm in SharePoint 2016

    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"
    

    Fix the Content Database Version Mismatch

    Again run the SharePoint 2016 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.

    And there also an article for your reference:

    https://blogit.create.pt/miguelisidoro/2018/09/16/sharepoint-farm-update-how-to-solve-the-feature-is-referenced-in-database-but-isnt-installed-on-the-current-farm-error-in-a-sharepoint-2016-farm/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 31,596 Reputation points Microsoft External Staff
    2023-02-16T10:20:36.4266667+00:00

    Hi sns ,

    Was the server rebooted after installing the patch?

    Clear the config cache and try to run the configuration wizard again.

    You can try the following command on the server where it is failing:

    PSConfig -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.