Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-15311

Email-ext can't recover after a failed smtp delivery

      I used the email-ext to set up notifications for build success, but had Jenkins set up to use an smtp server that was company-internal. This worked fine when I only had company internal mail recipients, but when I added an outside recipient, the build failed because email-ext returned an SMTPException: Could not deliver. All this is fine and expected in a PEBKAC situation.

      However, when I had set up a new, proper smtp server in Jenkins and sent successful test emails through the Jenkins configuration page, I figured everything would be fine. But the next time a build finished, no emails were sent out even though the build finished as normal. Checking the logs I found that it said:

      "
      Email was triggered for: Success
      Sending email for trigger: Success
      "

      The two usual last lines with "Sending email to: blah@blah, Finished: SUCCESS" were missing. Obviously email-ext was unable to recover from the previous error even though the settings had been corrected. I worked around the problem by restarting Jenkins, and everything started working as expected with the new configuration.

          [JENKINS-15311] Email-ext can't recover after a failed smtp delivery

          Couldn't the success detection logic be improved to determine if an email was truly sent or not? The issue isn't so much that email-ext doesn't recover after failure, rather it's the false positive of claiming success when no email has been sent.

          bootstraponline added a comment - Couldn't the success detection logic be improved to determine if an email was truly sent or not? The issue isn't so much that email-ext doesn't recover after failure, rather it's the false positive of claiming success when no email has been sent.

          Alex Earl added a comment -

          If the "Sending email to:..." is not logged, then no email is being sent, so there is no false positive.

          Alex Earl added a comment - If the "Sending email to:..." is not logged, then no email is being sent, so there is no false positive.

          Alex Earl added a comment -

          Please try using the override default settings feature of email-ext and see if you see the same issue. I want to isolate if something changed in core (which is used if you don't override).

          Alex Earl added a comment - Please try using the override default settings feature of email-ext and see if you see the same issue. I want to isolate if something changed in core (which is used if you don't override).

          bootstraponline added a comment - - edited

          The current behavior is "Sending email for trigger: Success" and then nothing. It'd be better to have a line that says "Unable to send email. Email-ext can't recover from errors. Please restart Jenkins and try again."

          I restarted Jenkins so I can no longer reproduce the error. I didn't override default settings though.

          bootstraponline added a comment - - edited The current behavior is "Sending email for trigger: Success" and then nothing. It'd be better to have a line that says "Unable to send email. Email-ext can't recover from errors. Please restart Jenkins and try again." I restarted Jenkins so I can no longer reproduce the error. I didn't override default settings though.

          Alex Earl added a comment -

          If the core emailer never returns, then I can't log something saying there was an error. It's a closed box basically.

          Alex Earl added a comment - If the core emailer never returns, then I can't log something saying there was an error. It's a closed box basically.

          Alex Earl added a comment -

          I have no way of replicating this, so it will only get some traction if someone is willing to run with a debug version of the plugin.

          Alex Earl added a comment - I have no way of replicating this, so it will only get some traction if someone is willing to run with a debug version of the plugin.

          I'll try to reproduce the issue on a local Jenkins install. Where is the debug version of the plugin?

          bootstraponline added a comment - I'll try to reproduce the issue on a local Jenkins install. Where is the debug version of the plugin?

          Alex Earl added a comment -

          I will need to build one. I'll attach it here when its done.

          Alex Earl added a comment - I will need to build one. I'll attach it here when its done.

          Alex Earl added a comment -

          Please try this, it has some added debug if you turn it on in the global config.

          Alex Earl added a comment - Please try this, it has some added debug if you turn it on in the global config.

          Alex Earl added a comment -

          Need more information from submitted. Reopen with more information.

          Alex Earl added a comment - Need more information from submitted. Reopen with more information.

            slide_o_mix Alex Earl
            robpvn Robert Nordan
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: