Known Issue: Large Error Logs due to Errors resolving SharePoint Users

Issue

If you notice that your server log files include thousands of daily errors, it may be due to errors resolving internal SharePoint users.

Example error in the log file

########################################################################
"192093995","2017-05-19 16:34:22","Error","IdentityService","64018","SharePointGroupProviderResolveNameException", "SPCsomClient.GetUser","64018 Failed to resolve user 'i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint' on SharePoint site 'https://###.sharepoint.com/sites/***', Error: System.Reflection.TargetInvocationException: An unexpected failure was encountered when contacting SharePoint to get information from the group provider CSR: Key cannot be null.
Parameter name: key ---> System.ArgumentNullException: Key cannot be null.
#######################################################################

You can identify internal users if they contain a GUID similar to 00000003-0000-0ff1-ce00-000000000000 containing the string 0ff1-ce. These are identities SharePoint uses internally for provider-hosted apps.
 

Resolution

K2 includes an exclusion list in the K2HostServer.exe.config file located at %PROGRAM FILES%\K2\Host Server\Bin. User name resolution is skipped for users in this list so the Failed to resolve user error is avoided.

Steps to Add Users to the List

  1. Open a log file located at %PROGRAM FILES%\K2\Host Server\Bin in a text editor.
  2. Find the Failed to resolve user error and copy the user name. For example, i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint
  3. Open the K2HostServer.exe.config file located at %PROGRAM FILES%\K2\Host Server\Bin and add the exclusion to the <sourcecode.sharepoint.groupProvider> section. For example:
    <sourcecode.sharepoint.groupProvider>
        <exclusions>
            <add name =”i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint” />
        </exclusions>
    </sourcecode.sharepoint.groupProvider></div></li>
  4. Repeat this for each user name that fails to resolve.
  5. Save the config file and restart the K2 server.