Symptoms
We are getting many error messages in the event viewer log about K2 Host server trying to connect to unused SharePoint as below:-
SharePointRoleProvider.GetGroups: System.Reflection.TargetInvocationException: An unexpected failure was encountered when contacting SharePoint to get information from the group provider ""Group Provider Name]": The SharePoint server has indicated that the web service could not be found. Consider updating the group provider configuration. ---> System.Net.WebException: The request failed with HTTP status 404: Not Found.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Objectt] parameters)
at SourceCode.SharePoint.WebServices.K2SPSites.IsClaimsSite()
at SourceCode.Security.Providers.SharePoint.Shared.SPWebServicesClient.get_IsClaimsSite()
at SourceCode.Security.Providers.SharePoint.Shared.SPWebServicesClient.SourceCode.Security.Providers.SharePoint.Shared.ISPGroupProviderClient.GetGroups(String userName)
Diagnoses
The URLs associated with the Group Providers were no longer valid.
Resolution
To remove the invalid SP group providers, you would need to manually delete them from the database. Kindly follow these steps:-
1. Stop the K2 Service.
2. Make a backup of the K2 DB.
3. Delete the invalid group provider record from the HostServer.GroupProvider table.
4. Start the K2 Service.