After migration from SharePoint 2010 to SharePoint 2013 , to SharePoint 2016, search does not work.

May 14, 2017

Case:
Windows Server 2016 + SharePoint 2016 +SQL Server 2016
1 App Server + 1 Web front end
Issue:
After migration from SharePoint 2010 to SharePoint 2013 , to SharePoint 2016, search does not work.
Search throws exception as:
System.ServiceModel.FaultException: An error occurred when verifying security for the message. --- End of inner exception stack trace --- Server stack trace: at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout) at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request

Advance search throws object null exception as :
AdvancedSearchBox class encountered unexpected error: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Search.Query.ConsumerScopeCache.GetScopes() at Microsoft.Office.Server.Search.Query.ScopeCache.GetSharedScopes() at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.GetScopeEnumerator(ScopeInformation& defaultScope) at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateScopeRows(Table parentTable) at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateScopingSectionChildControls(Table parentTable) at Microsoft.Office.Server.Search.WebControls.AdvancedSearchBox.CreateChildControls().

Solution:
Tried following checklist as:

    verified that the SharePoint Web Services site existed in IIS, and that SecurityTokenServiceApplication existed as a virtual directory.
    Related application pool that are working
    Created new Search Service application and changed the association.
    Done a full crawl
    Did index reset

Run SharePoint configuration wizard again.
Finally, issue was related to time difference b/w application server and Web front end.
They were in different time zone. Fixed time zones, all above exceptions solved.