Product/patch installation or server upgrade required
Occasionally Health Analyzer shows the patch-mismatch error even after fully applying SharePoint cumulative updates. You even confirmed the successful upgrade status on the Upgrade Status page at https://caUrl/_admin/UpgradeStatus.aspx, but the Servers in Farm and Review Problems and Solutions pages show some servers are still not patched:
Diagnosis
- One or more content databases still need to be upgraded. They get upgraded when you run psconfig or Config Wizard, but the upgrade status doesn't seem to “stick” afterwards sometimes. To verify, go to Upgrade and Migration > Review database status on Central Admin.
- A job or registry key is not in the correct state. The CreateProductVersionJob registry key was the culprit in the past (ref: http://blog.stefan-gossner.com/2016/08/09/sharepoint-patching-and-get-spproduct-local). However, it appears that something else is also causing the error, as the false report gets generated with the value of 0. To verify the registry:
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Shared Tools\Web Server Extensions\16.0\WSS" | select CreateProductVersionJob
Remedy
Start with the operation that requires minimal effort as follows:
- If the Manage Database Upgrade Status page (https://caUrl/_admin/DatabaseStatus.aspx) doesn't show "No action required" on a content database, remote into any SharePoint servers in the farm and run Upgrade-SPContentDatabase. Example:
Note that this status is not always triggered by the NeedsUpgrade = $true property value of the database:
Alternatively, in lieu of targeting just the reported databases, you can also run the Upgrade command on all content databases to check and ensure that all of them are upgraded (make sure your account has the sufficient permissions):
Get-SPContentDatabase | Upgrade-SPContentDatabase -Confirm:0
Note: Even with the successful upgrade of the content database, the Manage Database Upgrade Status page will not refresh the upgrade status promptly.
Hit Reanalyze on the Health Analyzer and see if the error disappears. If it doesn't, move on to the next step. - Remote into the affected servers and update the state of the wrong registry key by running “Get-SPProduct -Local”. Don't run it remotely as it will fail like this:
- Run the psconfig with a minimal number of parameters. But note this will still bring down the IIS and SharePoint services while the command is running. As a result, make sure to run it in the HA environment:
PSConfig.exe -cmd upgrade -inplace b2b