Email step retry

Sometimes we get SMTP timeout with our email server so the email step fails because of this, is there anyway to build in a retry?

Hi Corey,

Thanks for reaching out. To retry a step you could use our Guided Failure(GF) feature, which will let you decide what to do (retry, fail or skip) when a step fails.

The not-so-awesome side about using GF is that someone needs to manually intervene for the process to continue. We currently do not support automatic retries, but we have a uservoice request which you can vote if you want to see this in upcoming versions.

Thanks!

Dalmiro

I found this snippet i wrote a while ago exactly for this. Its not very fancy but i think it’ll work for you

The snippet will use the SMTP server set on $PSEmailServer, not the one configured in octopus like the built-in email step.

Thanks!

Dalmiro

We have had this pop a few times in the diagnostics tab in addition to the email smtp timing out, retry or not failing a deployment on email step would be awesome:

Error in EmailActionOrchestrator-ArM-AdlrEl_EEA@SQ-OCT-DEPLOY01-C2FA1978 while receiving {"Id":"91bc8510-cd80-11e4-80d2-005056914a67","From":{"SerializedValue":"DeploymentStepOrchestrator-ArI-AdlrElic5w@SQ-OCT-DEPLOY01-C2FA1978"},"Headers":{"Created":"2015-03-18T15:08:06.9392165+00:00","Expires-At":"635623744869392165"},"To":{"SerializedValue":"EmailActionOrchestrator-ArM-AdlrEl_EEA@SQ-OCT-DEPLOY01-C2FA1978"},"MessageType":"Octopus.Platform.Deployment.Messages.Deploy.Email.StartEmailActionCommand","Body":{"$type":"Octopus.Platform.Deployment.Messages.Deploy.Email.StartEmailActionCommand, Octopus.Platform.Deployment","Logger":{"LoggerActorId":"Octopus.Logger@SQ-OCT-DEPLOY01-C2FA1978","CorrelationId":"ServerTasks-13008/4f400a2cbd654f9c90ba373df7c26931"},"DeploymentId":"deployments-4613","DeploymentActionId":"0ab8d366-560e-46f9-ab40-46c68fa27ef6"}}
System.Net.Mail.SmtpException: Service not available, closing transmission channel. The server response was: 4.4.2 service timed out.
   at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
   at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at Octopus.Server.Orchestration.Deploy.Email.EmailActionOrchestrator.<ReceiveAsync>d__0.MoveNext() in y:\work\refs\heads\master\source\Octopus.Server\Orchestration\Deploy\Email\EmailActionOrchestrator.cs:line 53