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

NoSuchMethodError occurs when promoting a build using parametrized trigger

    XMLWordPrintable

    Details

    • Similar Issues:
    • Released As:
      Promoted Builds 3.5

      Description

      When updating the promoted builds to Version 3.4 an NoSuchMethodError occoures when using a parametrized job for the promotion.

      build hudson.plugins.copyartifact.CopyArtifact@7de7a398 SUCCESS
      [EnvInject] - Injecting environment variables from a build step.
      [EnvInject] - Injecting as environment variables the properties file path '...version.properties'
      [EnvInject] - Variables injected successfully.
      build org.jenkinsci.plugins.envinject.EnvInjectBuilder@fb74c58 SUCCESS
      FATAL: hudson.plugins.promoted_builds.Promotion.getTarget()Lhudson/model/AbstractBuild;
      java.lang.NoSuchMethodError: hudson.plugins.promoted_builds.Promotion.getTarget()Lhudson/model/AbstractBuild;
      	at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.createUpstreamCause(BuildTriggerConfig.java:530)
      	at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.schedule(BuildTriggerConfig.java:550)
      	at hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig.schedule(BlockableBuildTriggerConfig.java:82)
      	at hudson.plugins.parameterizedtrigger.BuildTriggerConfig.perform3(BuildTriggerConfig.java:463)
      	at hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig.perform3(BlockableBuildTriggerConfig.java:67)
      	at hudson.plugins.parameterizedtrigger.TriggerBuilder.perform(TriggerBuilder.java:93)
      	at hudson.plugins.promoted_builds.Promotion$RunnerImpl.build(Promotion.java:449)
      	at hudson.plugins.promoted_builds.Promotion$RunnerImpl.doRun(Promotion.java:386)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      	at hudson.model.Run.execute(Run.java:1815)
      	at hudson.model.Run.run(Run.java:1769)
      	at hudson.plugins.promoted_builds.Promotion.run(Promotion.java:298)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

      With the changes of JENKINS-59600 the method getTarget() was renamed to getTargetBuild() but this change was not made in the calling method.

        Attachments

          Issue Links

            Activity

            patrick_weegen Patrick Weegen created issue -
            patrick_weegen Patrick Weegen made changes -
            Field Original Value New Value
            Link This issue is caused by JENKINS-59600 [ JENKINS-59600 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            CC Daniel Beck . I will try to act on it tomorrow, will put a warning to the changelog for now

            Show
            oleg_nenashev Oleg Nenashev added a comment - CC Daniel Beck . I will try to act on it tomorrow, will put a warning to the changelog for now
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            I'd guess our action plan would be to update plugins using the Promoted Builds API directly (to work around StaplerProxy).

            Promoted Builds is a classic architecture technical debt, and it is hard to act on it without major rewrite.

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - I'd guess our action plan would be to update plugins using the Promoted Builds API directly (to work around StaplerProxy). Promoted Builds is a classic architecture technical debt, and it is hard to act on it without major rewrite.  
            Hide
            danielbeck Daniel Beck added a comment -

            Unfortunate, but ultimately this was a bad decision in Stapler – no such method should have such a generic name. StaplerFallback#getStaplerFallback is fine, but StaplerProxy#getTarget is just stupid.

            Alternatively, lower the baseline dependency to 2.138.1 for now, and not generate the magic method? Unsure whether that works, but based on an analysis in a duplicate of the issue I fixed, it might.

            Show
            danielbeck Daniel Beck added a comment - Unfortunate, but ultimately this was a bad decision in Stapler – no such method should have such a generic name. StaplerFallback#getStaplerFallback is fine, but StaplerProxy#getTarget is just stupid. Alternatively, lower the baseline dependency to 2.138.1 for now, and not generate the magic method? Unsure whether that works, but based on an analysis in a duplicate of the issue I fixed, it might.
            jono_g Jonathan Gowland made changes -
            Summary NoSuchMethodError occoures when promoting a build using parametrized trigger NoSuchMethodError occurs when promoting a build using parametrized trigger
            Hide
            froque Filipe Roque added a comment -

            created PR for publish-over-plugin:

            https://github.com/jenkinsci/publish-over-plugin/pull/10

             

            Show
            froque Filipe Roque added a comment - created PR for publish-over-plugin: https://github.com/jenkinsci/publish-over-plugin/pull/10  
            Hide
            froque Filipe Roque added a comment -

            and a PR for parameterized-trigger-plugin:

            https://github.com/jenkinsci/parameterized-trigger-plugin/pull/130

            Show
            froque Filipe Roque added a comment - and a PR for parameterized-trigger-plugin: https://github.com/jenkinsci/parameterized-trigger-plugin/pull/130
            froque Filipe Roque made changes -
            Component/s git-plugin [ 15543 ]
            Hide
            froque Filipe Roque added a comment -

            also affects git-plugin.

            there was already an update to promoted-plugin 3.4 (see commit 54d4a89246c8b8b274ca93b24f1438852599a261 and e969982bc1032ae57aeee6be7356d6fd171cfb15) but it was reverted to 3.3 in commit 91ef2565d4a4fe2669430400cf52025c44985e25 and then to 3.2 in a69d8bc6ed3e375880b285316f1d4f602b22bc0a

            Show
            froque Filipe Roque added a comment - also affects git-plugin. there was already an update to promoted-plugin 3.4 (see commit 54d4a89246c8b8b274ca93b24f1438852599a261 and e969982bc1032ae57aeee6be7356d6fd171cfb15 ) but it was reverted to 3.3 in commit 91ef2565d4a4fe2669430400cf52025c44985e25 and then to 3.2 in a69d8bc6ed3e375880b285316f1d4f602b22bc0a
            Hide
            jdege Jeff Dege added a comment -

            This is a show-stopper for us,

            I'm trying to set up promotions on a job, and I'm getting this every time I try to re-execute a promotion.

            Any ideas when it will be fixed?

            Or what I need to roll back, and how far, to get this working?

            Show
            jdege Jeff Dege added a comment - This is a show-stopper for us, I'm trying to set up promotions on a job, and I'm getting this every time I try to re-execute a promotion. Any ideas when it will be fixed? Or what I need to roll back, and how far, to get this working?
            Hide
            markewaite Mark Waite added a comment - - edited

            Jeff Dege I think you'll need to rollback to promoted builds plugin 3.2 or earlier. I would like to know the version you select in your rollback because I intend to release git plugin 4.0 in a few days and it currently has an optional dependency on promoted builds plugin 3.2. If 3.2 does not resolve the issue for you, then that likely means I should force the git plugin 4.0 optional dependency to an older version of promoted builds plugin.

            Filipe Roque the commits that you referenced from the git plugin were first delivered in 4.0.0-beta12. They are not in earlier plugin versions, though the optional dependency on promoted builds 3.2 will be in git plugin 4.0.0 when it releases unless I hear from someone that version is not sufficient.

            Show
            markewaite Mark Waite added a comment - - edited Jeff Dege I think you'll need to rollback to promoted builds plugin 3.2 or earlier. I would like to know the version you select in your rollback because I intend to release git plugin 4.0 in a few days and it currently has an optional dependency on promoted builds plugin 3.2. If 3.2 does not resolve the issue for you, then that likely means I should force the git plugin 4.0 optional dependency to an older version of promoted builds plugin. Filipe Roque the commits that you referenced from the git plugin were first delivered in 4.0.0-beta12. They are not in earlier plugin versions, though the optional dependency on promoted builds 3.2 will be in git plugin 4.0.0 when it releases unless I hear from someone that version is not sufficient.
            Hide
            b_dean Ben Dean added a comment -

            3.2 is the version I reverted to when JENKINS-59600  caused problems. 3.4 was supposed to fix those but now this new issue, so I'm back on 3.2 again.

            Show
            b_dean Ben Dean added a comment - 3.2 is the version I reverted to when  JENKINS-59600   caused problems. 3.4 was supposed to fix those but now this new issue, so I'm back on 3.2 again.
            Hide
            dhs Dirk Heinrichs added a comment -

            Any news on this? We still cannot access promotion logs.

            Show
            dhs Dirk Heinrichs added a comment - Any news on this? We still cannot access promotion logs.
            oleg_nenashev Oleg Nenashev made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            It should be fixed in 3.5: https://github.com/jenkinsci/promoted-builds-plugin/releases/tag/promoted-builds-3.5 . I tested it manually and it looks to work fine, but more feedback would be appreciated

            Show
            oleg_nenashev Oleg Nenashev added a comment - It should be fixed in 3.5:  https://github.com/jenkinsci/promoted-builds-plugin/releases/tag/promoted-builds-3.5  . I tested it manually and it looks to work fine, but more feedback would be appreciated
            oleg_nenashev Oleg Nenashev made changes -
            Released As Promoted Builds 3.5
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Resolved [ 5 ]
            Hide
            rompic Roman Pickl added a comment -

            not the original reporter, but thanks this worked for us.

            Show
            rompic Roman Pickl added a comment - not the original reporter, but thanks this worked for us.
            Hide
            patrick_weegen Patrick Weegen added a comment -

            Installed the update last week, and it works fine!

            Show
            patrick_weegen Patrick Weegen added a comment - Installed the update last week, and it works fine!
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Thanks for the feedback!

            I have started prototyping JENKINS-36089 (Pipeline Support), so there should be new versions soon (likely in the experimental update center).

             

            Show
            oleg_nenashev Oleg Nenashev added a comment - Thanks for the feedback! I have started prototyping  JENKINS-36089 (Pipeline Support), so there should be new versions soon (likely in the experimental update center).  
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              oleg_nenashev Oleg Nenashev
              Reporter:
              patrick_weegen Patrick Weegen
              Votes:
              21 Vote for this issue
              Watchers:
              27 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: