-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
OS: Jenkins & Slave nodes all running on the very same Windows7-64 bit machine
JRE: 1.8.0_141
Jenkins Versions tested: 2.60.3/2.73.1
Jenkins Plugins and Versions:
JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1
Ant Plugin (ant): 1.6
OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.5
Artifactory Plugin (artifactory): 2.12.2
Authentication Tokens API Plugin (authentication-tokens): 1.3
Autofavorite for Blue Ocean (blueocean-autofavorite): 1.0.0
Common API for Blue Ocean (blueocean-commons): 1.1.6
Config API for Blue Ocean (blueocean-config): 1.1.6
Dashboard for Blue Ocean (blueocean-dashboard): 1.1.6
Display URL for Blue Ocean (blueocean-display-url): 2.1.0
Events API for Blue Ocean (blueocean-events): 1.1.6
Git Pipeline for Blue Ocean (blueocean-git-pipeline): 1.1.6
GitHub Pipeline for Blue Ocean (blueocean-github-pipeline): 1.1.6
i18n for Blue Ocean (blueocean-i18n): 1.1.6
JWT for Blue Ocean (blueocean-jwt): 1.1.6
Personalization for Blue Ocean (blueocean-personalization): 1.1.6
Pipeline implementation for Blue Ocean (blueocean-pipeline-api-impl): 1.1.6
Blue Ocean Pipeline Editor (blueocean-pipeline-editor): 0.2.0
Pipeline SCM API for Blue Ocean (blueocean-pipeline-scm-api): 1.1.6
REST Implementation for Blue Ocean (blueocean-rest-impl): 1.1.6
REST API for Blue Ocean (blueocean-rest): 1.1.6
Web for Blue Ocean (blueocean-web): 1.1.6
Blue Ocean (blueocean): 1.1.6
bouncycastle API Plugin (bouncycastle-api): 2.16.2
Branch API Plugin (branch-api): 2.0.11
build timeout plugin (build-timeout): 1.18
Folders Plugin (cloudbees-folder): 6.1.2
Conditional BuildStep (conditional-buildstep): 1.3.6
Config File Provider Plugin (config-file-provider): 2.16.2
Copy Artifact Plugin (copyartifact): 1.38.1
Credentials Binding Plugin (credentials-binding): 1.13
Credentials Plugin (credentials): 2.1.14
Dashboard View (dashboard-view): 2.9.11
Display URL API (display-url-api): 2.0
Docker Commons Plugin (docker-commons): 1.8
Docker Pipeline (docker-workflow): 1.12
Durable Task Plugin (durable-task): 1.14
Email Ext Recipients Column Plugin (email-ext-recipients-column): 1.0
Email Extension Plugin (email-ext): 2.58
Email Extension Template Plugin (emailext-template): 1.0
EnvInject API Plugin (envinject-api): 1.2
Environment Injector Plugin (envinject): 2.1.3
External Monitor Job Type Plugin (external-monitor-job): 1.7
Favorite (favorite): 2.3.0
Git client plugin (git-client): 2.5.0
GIT server Plugin (git-server): 1.7
Git plugin (git): 3.5.1
GitHub API Plugin (github-api): 1.86
GitHub Branch Source Plugin (github-branch-source): 2.2.3
GitHub Organization Folder Plugin (github-organization-folder): 1.6
GitHub plugin (github): 1.28.0
Gradle Plugin (gradle): 1.27.1
Groovy Postbuild (groovy-postbuild): 2.3.1
Groovy (groovy): 2.0
JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 1.1.1
HTML Publisher plugin (htmlpublisher): 1.14
Icon Shim Plugin (icon-shim): 2.0.3
Ivy Plugin (ivy): 1.27.1
Jackson 2 API Plugin (jackson2-api): 2.7.3
Javadoc Plugin (javadoc): 1.4
Job DSL (job-dsl): 1.64
JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1
jQuery plugin (jquery): 1.11.2-0
JUnit Plugin (junit): 1.21
LDAP Plugin (ldap): 1.16
Mailer Plugin (mailer): 1.20
Matrix Authorization Strategy Plugin (matrix-auth): 1.7
Matrix Project Plugin (matrix-project): 1.11
Maven Integration plugin (maven-plugin): 2.17
Metrics Plugin (metrics): 3.1.2.10
JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1
MSBuild Plugin (msbuild): 1.27
Naginator (naginator): 1.17.2
Node and Label parameter plugin (nodelabelparameter): 1.7.2
PAM Authentication plugin (pam-auth): 1.3
Parameterized Trigger plugin (parameterized-trigger): 2.35.1
Pipeline: Build Step (pipeline-build-step): 2.5.1
Pipeline: GitHub Groovy Libraries (pipeline-github-lib): 1.0
Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.5
Pipeline: Input Step (pipeline-input-step): 2.8
Pipeline: Milestone Step (pipeline-milestone-step): 1.3.1
Pipeline: Model API (pipeline-model-api): 1.1.9
Pipeline: Declarative Agent API (pipeline-model-declarative-agent): 1.1.1
Pipeline: Model Definition (pipeline-model-definition): 1.1.9
Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.1.9
Pipeline: REST API Plugin (pipeline-rest-api): 2.9
Pipeline: Stage Step (pipeline-stage-step): 2.2
Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.1.9
Pipeline: Stage View Plugin (pipeline-stage-view): 2.9
Plain Credentials Plugin (plain-credentials): 1.4
Plot plugin (plot): 1.11
Pre SCM BuildStep Plugin (preSCMbuildstep): 0.3
promoted builds plugin (promoted-builds): 2.29
Pub-Sub "light" Bus (pubsub-light): 1.12
Rebuilder (rebuild): 1.25
Resource Disposer Plugin (resource-disposer): 0.7
Run Condition Plugin (run-condition): 1.0
SCM API Plugin (scm-api): 2.2.0
Script Security Plugin (script-security): 1.34
Scriptler (scriptler): 2.9
Server Sent Events (SSE) Gateway Plugin (sse-gateway): 1.15
SSH Credentials Plugin (ssh-credentials): 1.13
SSH Slaves plugin (ssh-slaves): 1.20
Structs Plugin (structs): 1.10
Timestamper (timestamper): 1.8.8
Token Macro Plugin (token-macro): 2.1
Active Choices Plug-in (uno-choice): 1.5.3
Variant Plugin (variant): 1.1
Windows Slaves Plugin (windows-slaves): 1.3.1
Pipeline (workflow-aggregator): 2.5
Pipeline: API (workflow-api): 2.20
Pipeline: Basic Steps (workflow-basic-steps): 2.6
Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.9
Pipeline: Groovy (workflow-cps): 2.40
Pipeline: Nodes and Processes (workflow-durable-task-step): 2.15
Pipeline: Job (workflow-job): 2.14.1
Pipeline: Multibranch (workflow-multibranch): 2.16
Pipeline: SCM Step (workflow-scm-step): 2.6
Pipeline: Step API (workflow-step-api): 2.12
Pipeline: Supporting APIs (workflow-support): 2.14
Workspace Cleanup Plugin (ws-cleanup): 0.34
xUnit plugin (xunit): 1.102
OS: Jenkins & Slave nodes all running on the very same Windows7-64 bit machine JRE: 1.8.0_141 Jenkins Versions tested: 2.60.3/2.73.1 Jenkins Plugins and Versions: JavaScript GUI Lib: ACE Editor bundle plugin (ace-editor): 1.1 Ant Plugin (ant): 1.6 OWASP Markup Formatter Plugin (antisamy-markup-formatter): 1.5 Artifactory Plugin (artifactory): 2.12.2 Authentication Tokens API Plugin (authentication-tokens): 1.3 Autofavorite for Blue Ocean (blueocean-autofavorite): 1.0.0 Common API for Blue Ocean (blueocean-commons): 1.1.6 Config API for Blue Ocean (blueocean-config): 1.1.6 Dashboard for Blue Ocean (blueocean-dashboard): 1.1.6 Display URL for Blue Ocean (blueocean-display-url): 2.1.0 Events API for Blue Ocean (blueocean-events): 1.1.6 Git Pipeline for Blue Ocean (blueocean-git-pipeline): 1.1.6 GitHub Pipeline for Blue Ocean (blueocean-github-pipeline): 1.1.6 i18n for Blue Ocean (blueocean-i18n): 1.1.6 JWT for Blue Ocean (blueocean-jwt): 1.1.6 Personalization for Blue Ocean (blueocean-personalization): 1.1.6 Pipeline implementation for Blue Ocean (blueocean-pipeline-api-impl): 1.1.6 Blue Ocean Pipeline Editor (blueocean-pipeline-editor): 0.2.0 Pipeline SCM API for Blue Ocean (blueocean-pipeline-scm-api): 1.1.6 REST Implementation for Blue Ocean (blueocean-rest-impl): 1.1.6 REST API for Blue Ocean (blueocean-rest): 1.1.6 Web for Blue Ocean (blueocean-web): 1.1.6 Blue Ocean (blueocean): 1.1.6 bouncycastle API Plugin (bouncycastle-api): 2.16.2 Branch API Plugin (branch-api): 2.0.11 build timeout plugin (build-timeout): 1.18 Folders Plugin (cloudbees-folder): 6.1.2 Conditional BuildStep (conditional-buildstep): 1.3.6 Config File Provider Plugin (config-file-provider): 2.16.2 Copy Artifact Plugin (copyartifact): 1.38.1 Credentials Binding Plugin (credentials-binding): 1.13 Credentials Plugin (credentials): 2.1.14 Dashboard View (dashboard-view): 2.9.11 Display URL API (display-url-api): 2.0 Docker Commons Plugin (docker-commons): 1.8 Docker Pipeline (docker-workflow): 1.12 Durable Task Plugin (durable-task): 1.14 Email Ext Recipients Column Plugin (email-ext-recipients-column): 1.0 Email Extension Plugin (email-ext): 2.58 Email Extension Template Plugin (emailext-template): 1.0 EnvInject API Plugin (envinject-api): 1.2 Environment Injector Plugin (envinject): 2.1.3 External Monitor Job Type Plugin (external-monitor-job): 1.7 Favorite (favorite): 2.3.0 Git client plugin (git-client): 2.5.0 GIT server Plugin (git-server): 1.7 Git plugin (git): 3.5.1 GitHub API Plugin (github-api): 1.86 GitHub Branch Source Plugin (github-branch-source): 2.2.3 GitHub Organization Folder Plugin (github-organization-folder): 1.6 GitHub plugin (github): 1.28.0 Gradle Plugin (gradle): 1.27.1 Groovy Postbuild (groovy-postbuild): 2.3.1 Groovy (groovy): 2.0 JavaScript GUI Lib: Handlebars bundle plugin (handlebars): 1.1.1 HTML Publisher plugin (htmlpublisher): 1.14 Icon Shim Plugin (icon-shim): 2.0.3 Ivy Plugin (ivy): 1.27.1 Jackson 2 API Plugin (jackson2-api): 2.7.3 Javadoc Plugin (javadoc): 1.4 Job DSL (job-dsl): 1.64 JavaScript GUI Lib: jQuery bundles (jQuery and jQuery UI) plugin (jquery-detached): 1.2.1 jQuery plugin (jquery): 1.11.2-0 JUnit Plugin (junit): 1.21 LDAP Plugin (ldap): 1.16 Mailer Plugin (mailer): 1.20 Matrix Authorization Strategy Plugin (matrix-auth): 1.7 Matrix Project Plugin (matrix-project): 1.11 Maven Integration plugin (maven-plugin): 2.17 Metrics Plugin (metrics): 3.1.2.10 JavaScript GUI Lib: Moment.js bundle plugin (momentjs): 1.1.1 MSBuild Plugin (msbuild): 1.27 Naginator (naginator): 1.17.2 Node and Label parameter plugin (nodelabelparameter): 1.7.2 PAM Authentication plugin (pam-auth): 1.3 Parameterized Trigger plugin (parameterized-trigger): 2.35.1 Pipeline: Build Step (pipeline-build-step): 2.5.1 Pipeline: GitHub Groovy Libraries (pipeline-github-lib): 1.0 Pipeline Graph Analysis Plugin (pipeline-graph-analysis): 1.5 Pipeline: Input Step (pipeline-input-step): 2.8 Pipeline: Milestone Step (pipeline-milestone-step): 1.3.1 Pipeline: Model API (pipeline-model-api): 1.1.9 Pipeline: Declarative Agent API (pipeline-model-declarative-agent): 1.1.1 Pipeline: Model Definition (pipeline-model-definition): 1.1.9 Pipeline: Declarative Extension Points API (pipeline-model-extensions): 1.1.9 Pipeline: REST API Plugin (pipeline-rest-api): 2.9 Pipeline: Stage Step (pipeline-stage-step): 2.2 Pipeline: Stage Tags Metadata (pipeline-stage-tags-metadata): 1.1.9 Pipeline: Stage View Plugin (pipeline-stage-view): 2.9 Plain Credentials Plugin (plain-credentials): 1.4 Plot plugin (plot): 1.11 Pre SCM BuildStep Plugin (preSCMbuildstep): 0.3 promoted builds plugin (promoted-builds): 2.29 Pub-Sub "light" Bus (pubsub-light): 1.12 Rebuilder (rebuild): 1.25 Resource Disposer Plugin (resource-disposer): 0.7 Run Condition Plugin (run-condition): 1.0 SCM API Plugin (scm-api): 2.2.0 Script Security Plugin (script-security): 1.34 Scriptler (scriptler): 2.9 Server Sent Events (SSE) Gateway Plugin (sse-gateway): 1.15 SSH Credentials Plugin (ssh-credentials): 1.13 SSH Slaves plugin (ssh-slaves): 1.20 Structs Plugin (structs): 1.10 Timestamper (timestamper): 1.8.8 Token Macro Plugin (token-macro): 2.1 Active Choices Plug-in (uno-choice): 1.5.3 Variant Plugin (variant): 1.1 Windows Slaves Plugin (windows-slaves): 1.3.1 Pipeline (workflow-aggregator): 2.5 Pipeline: API (workflow-api): 2.20 Pipeline: Basic Steps (workflow-basic-steps): 2.6 Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.9 Pipeline: Groovy (workflow-cps): 2.40 Pipeline: Nodes and Processes (workflow-durable-task-step): 2.15 Pipeline: Job (workflow-job): 2.14.1 Pipeline: Multibranch (workflow-multibranch): 2.16 Pipeline: SCM Step (workflow-scm-step): 2.6 Pipeline: Step API (workflow-step-api): 2.12 Pipeline: Supporting APIs (workflow-support): 2.14 Workspace Cleanup Plugin (ws-cleanup): 0.34 xUnit plugin (xunit): 1.102
This issue occured after upgrading the following pipeline-related plugins and dependencies:
- Pipeline: API: 2.8 -> 2.20
- Pipeline: Groovy: 2.24 -> 2.40
- Pipeline: SCM Step: 2.3 -> 2.6
- Pipeline: Shared Groovy Libraries: 2.5 -> 2.9
- Pipeline: Step API: 2.7 -> 2.12
- Pipeline: Supporting APIs: 2.12 -> 2.14
- SCM API Plugin: 2.0.8 -> 2.2.2
- Script Security Plugin: 1.25 -> 1.34
- Structs Plugin: 1.5 -> 1.10
After that in one of our Pipeline jobs Jenkins complained that one of our classes in the shared groovy library we use would not have a referenced member. The referenced member is defined in the base class.
I've created a very small shared library which can be used to reproduce the issue. Please find it attached.
For the job please use the following (or similar) code to reproduce the issue.
@Library('cpsLibIssue') import issue.* // Add the following import and it'll work // import issue.DerivedClass // comment out the following line - and it'll work as well (even without the explicit import) def baseClass = new BaseClass(steps) new DerivedClass(steps).doSomething()
If I explicitly import the DerivedClass the error will disappear.
If I won't create an object of the BaseClass it'll disappear as well.
One could get very frustrated because of this issue. It was hard to find, took me some hours. Hopefully it can be fixed easily as I can't tell when it will occur next time.
The code for both classes looks like:
package issue import org.jenkinsci.plugins.workflow.cps.DSL class DerivedClass extends BaseClass implements Serializable { DerivedClass(DSL steps) { super(steps) } def doSomething() { steps.echo "Won't work" } }
package issue import org.jenkinsci.plugins.workflow.cps.DSL class BaseClass implements Serializable { DSL steps BaseClass(DSL steps) { this.steps = steps } }
- duplicates
-
JENKINS-34428 workflow-cps-global-lib: inheritance (extends) not working
-
- Open
-
Ah, yeah - class inheritance in CPS-transformed code doesn't work right. Marking this as a dupe of JENKINS-34428