If Commerce can't reach the Find index, it should handle the error

Found in

EPiServer.Find.Commerce 9.6.2

Fixed in

EPiServer.Find.Commerce 9.7.2


Sep 28 2016


Feb 13 2017




Closed, Fixed and tested


Steps to reproduce:

1. Prepare to deploy a Commerce site from Integration to a Preproduction environment.
1.1. In Integration, Find index is configured like this "http://es-api-test01.episerver.com/..." (using DNS name)
1.2. In Preproduction, default Find index looks like "" (using ip address)

2. Deploy the site using paasportal or runbook in azure portal. Deployment always fails because of
2.1. Info from error log
Problems occured during the deployment with at least one site. Investigate the logs before you continue.
If this runbook is resumed it will attempt to swap the former production site (now in the "offline slot")
back into the production slot. Restore DB on deployment failure was set to: False
for this job. If it is set to True, the runbook will also start a restore of the DB, if it was set to False
however, it will not.
at EPiServer.PaaS.Infrastructure.AzureManagement.AzureAutomationManager.<GetJobAsync>d__10.MoveNext() in D:\BuildAgent\work\2d6eb73fa244f99c\PaaS\EPiServer.PaaS.Infrastructure.AzureManagement\AzureAutomationManager.cs:line 89
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at EPiServer.PaaS.EnvironmentSynchronizationWorker.MessageHandlers.HandleEnvironmentSynchronizationSaga.HandleMessage(EnvironmentSynchronizationSynchronizing message) in D:\BuildAgent\work\2d6eb73fa244f99c

2.1. We get the following email:
Response: System.Management.Automation.MethodInvocationException: Exception calling "GetResponse" with "0" argument(s): "The remote server returned an error: (500) Internal Server Error." ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at CallSite.Target(Closure , CallSite , Object ) — End of inner exception stack trace — at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

_this does not happen with a CMS site. The root cause is that when Commerce can't get the Find index, it
does not handle the error.
_If we update the Find index in Prep so it looks like "http://es-api-test01.episerver.com/...", it works.

Expected: we can deploy without error even the user doesn't update the Find index url.