Status: Closed (View Workflow)
Promotion console log is showing build log. This started to happen after the plugins update I did.
JENKINS-59600 Promotion logs not accessible anymore after Jenkins upgrade
Thanks Andrew. I did that. but the idea was publish here to get fixed.
I am seeing the same problem and downgrading to 3.2 does indeed solve the problem.
I wasted some time with this bug. From what I can tell, the bug was introduced with commit 0a9e67654a0f072601fb3a24d420c3c09ebfd843, when upgrading jenkins.version property from 2.60.3 to 2.138.4.
It happens because of commit ba33bd67cdaef87aba8a4e95dca8dcf108a7d73f , in 2.138.2, which added an interface StaplerProxy to class Run. This interface defines a method Object getTarget() with an implementation in class Run.
The Promotion class, which derives from Run, also has a method getTarget but with return type AbstractBuild<?,?>, so a synthetic method, with return type Object, is created by the compiler which invokes AbstractBuild<?,?> getTarget().
javap -v ./promoted-builds-2.138.2/WEB-INF/lib/promoted-builds/hudson/plugins/promoted_builds/Promotion.class public hudson.model.AbstractBuild<?, ?> getRootBuild(); descriptor: ()Lhudson/model/AbstractBuild; flags: (0x0001) ACC_PUBLIC Code: stack=1, locals=1, args_size=1 0: aload_0 1: invokevirtual #9 // Method getTarget:()Lhudson/model/AbstractBuild; 4: invokevirtual #10 // Method hudson/model/AbstractBuild.getRootBuild:()Lhudson/model/AbstractBuild; 7: areturn LineNumberTable: line 93: 0 LocalVariableTable: Start Length Slot Name Signature 0 8 0 this Lhudson/plugins/promoted_builds/Promotion; Signature: #185 // ()Lhudson/model/AbstractBuild<**>;
Renaming AbstractBuild<?,?> getTarget() to AbstractBuild<?,?> getTarget2() fixes the bug, but I have no idea of its impacts because of the @Exported annotation.
Note: the new Object getTarget() method in Run as an annotation @Restricted(NoExternalUse.class) but I don't understand its meaning.
I proposed a PR fixing this as
JENKINS-59600 so closing this as a duplicate of that later issue.
FWIW the previous comment's analysis appears correct and that's essentially what my fix does (while keeping the remote API the same).
Thanks to danielbeck, the fix was released in 3.4: https://github.com/jenkinsci/promoted-builds-plugin/releases/tag/promoted-builds-3.4
Downgrade to 3.2 fixes the issue.