Arithmetic operation resulted in an overflow exception while modifying Search Topology in SharePoint Farm

Symptom

While applying changes to the Search Topology, the following error is generated "Errors were encountered during the configuration of the Search service application" and the following traces will be populated in ULS "System.OverflowException: Arithmetic operation resulted in an overflow"

 

ULS Stack:

SearchConfigWizardFinish page failed with exception. System.OverflowException: Arithmetic operation resulted in an overflow.    Server stack trace:    
  at Microsoft.Office.Server.Search.Administration.UnsafeNativeMethods.NetLocalGroupGetMembers(String groupName)   
  at Microsoft.Office.Server.Search.Administration.UnsafeNativeMethods.TraceLocalGroups()   
  at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Provision()   
  at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.DeployLocalServiceInstance[T](T localSearchServiceInstance)   
  at Microsoft.Office.Server.Search.Administration.SearchConfigurationJobDefinition.Create(AbstractSearchConfigWizard wizardOM)   
  at Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.ExecuteConfigurationTimerJob(SPLongOperationState longOperationState, String& strRedirectPage)   
  at Microsoft.SharePoint.SPStatefulLongOperation.SetThreadCultureAndRun(RunStatefulOperation runOperation, SPLongOperationState state, CultureInfo culture, CultureInfo uICulture)   
  at Microsoft.SharePoint.SPStatefulLongOperation.<>c__DisplayClass6.<Run>b__0(Object state)   
  at Microsoft.SharePoint.Utilities.SPThreadPool.WaitCallbackWrapper(Object state)   
  at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)   
  at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)    Exception rethrown
 at [0]:    
  at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)   
  at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)   
  at System.Threading.WaitCallback.EndInvoke(IAsyncResult result)   
  at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItem(ImpersonatedCallbackParam param, TimerCallback timerCallback, Object timerState, Int32 timerPeriod)   
  at Microsoft.SharePoint.Utilities.SPThreadPool.RunAsyncWorkItemWithImpersonation(WaitCallback workItemCallback, Object workItemState, TimerCallback timerCallback, Object timerState, Int32 timerPeriod)   
  at Microsoft.SharePoint.SPStatefulLongOperation.Run(RunStatefulOperation runOperation)   
  at
Microsoft.Office.Server.Search.Internal.UI.SearchConfigWizardFinish.<>c__DisplayClass2.<Commit>b__0(SPStatefulLongOperation longOperation) 

 

Cause

The error was thrown at Microsoft.Office.Server.Search.Administration.UnsafeNativeMethods.NetLocalGroupGetMembers(String groupName). From this we could figure out that it errors out while enumerating members of one of the local group. On a closer review of the ULS logs I was able to figure out the problematic group:

 

w3wp.exe (0x0C3C) 0x16CC SharePoint Server Search Administration dmg1 High Group WSS_WPG

 w3wp.exe (0x0C3C) 0x16CC SharePoint Server Search Administration dmb2 High The call to SearchServiceInstance.Provision (server 'servername') failed. Setting back to previous status 'Disabled'. System.OverflowException: Arithmetic operation resulted in an overflow.     at Microsoft.Office.Server.Search.Administration.UnsafeNativeMethods.NetLocalGroupGetMembers(String groupName)     at Microsoft.Office.Server.Search.Administration.UnsafeNativeMethods.TraceLocalGroups()     at Microsoft.Office.Server.Search.Administration.SearchServiceInstance.Provision()     at Microsoft.Office.Server.Search.Administration.SearchAdminUtils.DeployLocalServiceInstance[T](T localSearchServiceInstance)

The issue was caused due to the substantial number of users added to the WSS_WPG group.

Resolution

Removed the individual users from WSS_WPG group. If you want to add the users to WSS_WPG group, create an AD Security Group, add the users to this SG and add the SG to the WSS_WPG group.

 

Applies to: SharePoint Server 2013, SharePoint Server 2016