The license state for the current server doesn't match the farm's license state
Recently I have involved in an interesting troubleshooting issue. There are many blog posts and TechNet discussions about this error "The license state for the current server doesn't match the farm's license state". Thought that to post it here about my experience.
Here is the scenario. Customer has two Windows 2008 R2 Std machines (lets call it as srvsp1 & srvsp2) installed and configured with the following products.
SharePoint Server 2010 Enterprise Edition
Office Web Apps
Recently we have patched those two servers , for some troubleshooting one of the servers (srvsp2) was disconnected from the farm. After completing the installation while trying to add the server back to the farm by running the PSConfig we got the below error,
The license state for the current server doesn't match the farm's license state. System.InvalidOperationException: The current server cannot be joined to this farm because the set of installed products does not match the products installed in the farm.
The license state for the current server doesn't match the farm's license state. at Microsoft.SharePoint.Administration.SPFarm.Join() at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.CreateOrConnectConfigDb() at Microsoft.SharePoint.PostSetupConfiguration.ConfigurationDatabaseTask.Run() at Microsoft.SharePoint.PostSetupConfiguration.TaskThread.ExecuteTask()
Here are the troubleshooting steps.
# Step 1
Verify the configuration database has correct entries of all installed products. For that , we ran the following query against the “Objects” table of SharePoint configuration database.
Select * from Objects with (nolock) where properties like '%icrosoft.SharePoint.Administration.SPInstallState%'
From the result copy the “Properties” column value to notepad or any xml editor tool, in my case I have used Visual Studio.
Values that we are interested the ones highlighted in the below screenshot. Same is given below.
In our case, the Configuration database should have had 3 entries to match the registry in a normal farm. For some reason it was not updated with the office web apps production installation , it may caused by an installation issue.
Run the following Power Shell commandlet on any working server in the farm. In our case it was srvsp1, the reason we would need to run from this server is because the problem server – srvsp2 is still not in the farm.
This will pick the entries from the server and reset the entries in the Config DB.
To double-check, you can run the same SQL query mentioned above and confirm the values.
Hope this will helpful while troubleshooting this specific issue related to SharePoint. There are different scenarios as well, eg: configuration database may have the values but it was not there in the physical server’s registry. To fix that you may end up with uninstall and install the product to update it correctly.