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

Build fails due to emailext trying to send mail to "null" user

    XMLWordPrintable

Details

    Description

      Our pipeline tries to send an email as a post-action, but due to some failure it breaks the build.
      Stack trace reveals the email-ext plugin somehow tries to process the "null" user (wrong data provided by some other component?) and it fails to do so.

      
      
      [Pipeline] }[Pipeline] // stage[Pipeline] stage[Pipeline] { (Declarative: Post Actions)[Pipeline] emailextrecipientsError when executing always post condition:
       org.springframework.security.authentication.DisabledException: The user "null" is administratively disabled.
       at hudson.security.UserAttributesHelper.checkIfUserEnabled(UserAttributesHelper.java:92)
       at hudson.security.LDAPSecurityRealm$LDAPUserDetailsService.loadUserByUsername(LDAPSecurityRealm.java:1314)
       at hudson.security.LDAPSecurityRealm$DelegateLDAPUserDetailsService.loadUserByUsername(LDAPSecurityRealm.java:1227)
       at jenkins.security.ImpersonatingUserDetailsService2.loadUserByUsername(ImpersonatingUserDetailsService2.java:29)
       at hudson.model.User.getUserDetailsForImpersonation2(User.java:399)
       at hudson.model.User.impersonate2(User.java:367)
       at hudson.model.User.impersonate(User.java:377)
       Caused: org.acegisecurity.DisabledException: org.springframework.security.authentication.DisabledException: The user "null" is administratively disabled.; nested exception is org.springframework.security.authentication.DisabledException: The user "null" is administratively disabled.
       at org.acegisecurity.DisabledException.fromSpring(DisabledException.java:51)
       at org.acegisecurity.AuthenticationException.fromSpring(AuthenticationException.java:88)
       at hudson.model.User.impersonate(User.java:379)
       at hudson.plugins.emailext.plugins.recipients.RecipientProviderUtilities.addUsers(RecipientProviderUtilities.java:171)
       at hudson.plugins.emailext.plugins.recipients.RecipientProviderUtilities.addUsers(RecipientProviderUtilities.java:153)
       at hudson.plugins.emailext.plugins.recipients.CulpritsRecipientProvider.addRecipients(CulpritsRecipientProvider.java:60)
       at hudson.plugins.emailext.EmailExtRecipientStep$Executor.run(EmailExtRecipientStep.java:69)
       at hudson.plugins.emailext.EmailExtRecipientStep$Executor.run(EmailExtRecipientStep.java:42)
       at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)[Pipeline] script[Pipeline] {
      
      

      The relevant part of the pipeline:

                  emailext (
                          attachLog: true,
                          body: '${DEFAULT_CONTENT}',
                          mimeType: 'text/html',
                          replyTo: '${DEFAULT_REPLYTO}',
                          subject: '${DEFAULT_SUBJECT}',
                          to: emailextrecipients([
                                  [$class: 'CulpritsRecipientProvider'],
                                  [$class: 'RequesterRecipientProvider'],
                                  [$class: 'DevelopersRecipientProvider']
                          ]),
                  )
      

      Attachments

        Issue Links

          Activity

            pistahh Istvan Szekeres created issue -
            basil Basil Crow made changes -
            Field Original Value New Value
            Component/s ldap-plugin [ 17122 ]
            Labels JEP-227
            basil Basil Crow made changes -
            Labels JEP-227
            basil Basil Crow made changes -
            Link This issue relates to JENKINS-55813 [ JENKINS-55813 ]
            basil Basil Crow made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

              Unassigned Unassigned
              pistahh Istvan Szekeres
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: