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

Error when using email-ext 2.39 with Jenkins LTS 1.580.3: java.lang.NoSuchMethodError: org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • email-ext-plugin
    • None
    • Jenkins LTS 1.580.3 on Ubuntu 14.04
      email-ext 2.39
      Using localhost / port 25 for email

      I get the same error with any email-ext usage, even when the job has no build steps or other post-build steps configured:

      Checking if email needs to be generated
      Email was triggered for: Always
      Sending email for trigger: Always
      NOT overriding default server settings, using Mailer to create session
      ERROR: Publisher hudson.plugins.emailext.ExtendedEmailPublisher aborted due to exception
      java.lang.NoSuchMethodError: org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(Lhudson/model/AbstractBuild;Lhudson/model/TaskListener;Ljava/lang/String;ZLjava/util/List;)Ljava/lang/String;
      	at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:72)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:647)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:535)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:306)
      	at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:297)
      	at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:244)
      	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
      	at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
      	at hudson.model.Run.execute(Run.java:1791)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:89)
      	at hudson.model.Executor.run(Executor.java:240)
      

          [JENKINS-26867] Error when using email-ext 2.39 with Jenkins LTS 1.580.3: java.lang.NoSuchMethodError: org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll

          Daniel Beck added a comment -

          If I had to guess, you manage Jenkins using Chef, right?

          Daniel Beck added a comment - If I had to guess, you manage Jenkins using Chef, right?

          Daniel - indeed I do (manage by Chef). So I assume you have a hunch of what causes this?

          Klaus Schniedergers added a comment - Daniel - indeed I do (manage by Chef). So I assume you have a hunch of what causes this?

          Alex Earl added a comment -

          What version of token-macro is installed?

          Alex Earl added a comment - What version of token-macro is installed?

          Daniel Beck added a comment -

          email-ext plugin depends on Token Macro Plugin, see:
          https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin

          The method missing was added in Token Macro 1.6.

          If you just change the version of email-ext in Chef ignoring dependencies, you're going to end up with an invalid configuration.

          I really need to get around to writing that admin monitor warning about illegal plugin config :-/

          Daniel Beck added a comment - email-ext plugin depends on Token Macro Plugin, see: https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin The method missing was added in Token Macro 1.6. If you just change the version of email-ext in Chef ignoring dependencies, you're going to end up with an invalid configuration. I really need to get around to writing that admin monitor warning about illegal plugin config :-/

          Daniel Beck added a comment -

          Assuming ancient Token Macro and invalid plugin config.

          Daniel Beck added a comment - Assuming ancient Token Macro and invalid plugin config.

          Klaus Schniedergers added a comment - - edited

          The update to token-macro 1.10 fixed it (it was 1.5.1).

          Klaus Schniedergers added a comment - - edited The update to token-macro 1.10 fixed it (it was 1.5.1).

            slide_o_mix Alex Earl
            schniedergers Klaus Schniedergers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: