Hi Folks,
Hope everyone is doing well. Our Sitecore Commerce (XC) version was 9.0.2 and we had set up our production on scaled environment, in which we had a separate VM for minions. As we know the Minions role is an instance of the Commerce Engine that runs independently and supports asynchronous processing or we can say Minions are the workers performing background tasks. OOTB XC provides minions like Indexing minion, order minion, purgecarts minions.
Ok, so now the issue we faced in our production is that our Order indexing were not working as well as we created some custom minions, so no one was working. Then this was issue for us and urgent as it is production. So, we decided to check minion logs so, we didn’t see any error there, also we didn’t find logs for orders index like – Incremental Index List OrdersIndex (just taking the example of orders index only), so now it was more complicated for us, how we can see what’s going on, so we decided to Run IncrementalIndex Minion – Orders in postman, so when we hit it from postman we saw an error in minion logs related
ERROR SolrContextCommand.DoesIndexExist.Error: Message=The remote name could not be resolved: 'solr-xdb.xyz.com'|Trace= at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
at SolrNet.Impl.SolrCoreAdmin.Status(String coreName)
at Sitecore.Commerce.Plugin.Search.Solr.SolrContextCommand.<DoesIndexExist>d__5.MoveNext()
SolrNet.Exceptions.SolrConnectionException: The remote name could not be resolved: 'solr-xdb.xyz.com' ---> System.Net.WebException: The remote name could not be resolved: 'solr-xdb.xyz.com'
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
at SolrNet.Impl.SolrCoreAdmin.Status(String coreName)
at Sitecore.Commerce.Plugin.Search.Solr.SolrContextCommand.<DoesIndexExist>d__5.MoveNext()
Then we ran this solr url in browser and it was not working, so we decided to check solr host url entry in Host file (C:\Windows\System32\drivers\etc) and it was missing. After adding this solr is working on this environment and we hit Run IncrementalIndex Minion – Orders again from the postman this time it worked fine, we could see OrdersScope index in solr dashboard with the updated number.
But the issue remained the same, minions were not running automatically, and now there was no error in logs as well. Then we checked our json files again under wwwroot (C:\inetpub\wwwroot\CommerceAuthoring_Sc9\wwwroot) and after checking all the json we found the culprit, that was in config.json, EnvironmentName was set wrong there, it was set to xyzAuthoring, so we changed it to xyzMinions. After doing this change we recycled app pool for minions wesbite in IIS and monitored it for some time, after this we could see logs for IncrementalIndexMinion like below –
INFO IncrementalIndexMinion-Incremental Index List OrdersIndex: Count:1
Don’t forget to recycle app pool or IISReset to the minions website.
And, that’s it, thisโs how I figured out minions issue in my case.
Happy Coding ๐