-
Bug
-
Resolution: Fixed
-
Blocker
-
Powered by SuggestiMate
Any workflow script doesn't work. Even this:
node { }
All variants provides this stacktrace in build log:
Started by user Kanstantsin Shautsou java.lang.ExceptionInInitializerError at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at java.lang.Class.newInstance(Class.java:442) at org.codehaus.groovy.runtime.InvokerHelper.createScript(InvokerHelper.java:408) at groovy.lang.GroovyShell.parse(GroovyShell.java:743) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:106) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:361) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:328) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:189) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:381) Caused by: groovy.lang.MissingMethodException: No signature of method: com.cloudbees.groovy.cps.Builder.withClosureType() is applicable for argument types: (java.lang.Class) values: [class org.jenkinsci.plugins.workflow.cps.CpsClosure2] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at WorkflowScript.___cps___0(WorkflowScript) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrapNoCoerce.invoke(StaticMetaMethodSite.java:148) at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:99) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:50) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:157) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:161) at WorkflowScript.<clinit>(WorkflowScript) ... 13 more Finished: FAILURE
How this supposed to be debugged by user?
- is blocking
-
JENKINS-30125 Add Workflow compatibility
-
- Resolved
-
- is related to
-
JENKINS-30414 RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject getProperty java.lang.String (org.jenkinsci.plugins.workflow.cps.CpsClosure2.docker)
-
- Resolved
-
[JENKINS-30390] workflow ExceptionInInitializerError
I suspect that changes made to Closure handling in JENKINS-26135 are still not right.
Tried make -C docker-workflow-plugin/demo run-cached, update Workflow: Aggregator, restart, Build Now; but that worked (and it is using CPS from SCM, which is automatically sandboxed).
BTW Support Core plugin is a better way of capturing your environment for diagnosis.
Also after updating docker-workflow to build against 1.609.3 and Workflow 1.10 (and script-security 1.15), all functional tests pass, including those which nest blocks much like your script, and run in the sandbox. So not clear to me yet what conditions trigger this.
I'm using script entered in UI without any sandboxes of course.
Jenkins ======= Version details --------------- * Version: `1.609.3` * Mode: WAR * Servlet container - Specification: 3.0 - Name: `jetty/winstone-2.8` * Java - Home: `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre` - Vendor: Oracle Corporation - Version: 1.8.0_45 - Maximum memory: 796.50 MB (835190784) - Allocated memory: 509.50 MB (534249472) - Free memory: 26.31 MB (27589768) - In-use memory: 483.19 MB (506659704) - GC strategy: ParallelGC * Java Runtime Specification - Name: Java Platform API Specification - Vendor: Oracle Corporation - Version: 1.8 * JVM Specification - Name: Java Virtual Machine Specification - Vendor: Oracle Corporation - Version: 1.8 * JVM Implementation - Name: OpenJDK 64-Bit Server VM - Vendor: Oracle Corporation - Version: 25.45-b02 * Operating system - Name: Linux - Architecture: amd64 - Version: 2.6.32-431.29.2.el6.x86_64 - Distribution: "CentOS release 6.6 (Final)" - LSB Modules: `:base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch` * Process ID: 30747 (0x781b) * Process started: 2015-09-10 18:58:41.384+0300 * Process uptime: 2 hr 21 min * JVM startup parameters: - Boot classpath: `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.45-28.b13.el6_6.x86_64/jre/classes` - Classpath: `/usr/lib/jenkins/jenkins.war` - Library path: `/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib` - arg[0]: `-Djava.awt.headless=true` - arg[1]: `-Dhudson.DNSMultiCast.disabled=true` - arg[2]: `-DJENKINS_HOME=/opt/jenkins` Important configuration --------------- * Security realm: `hudson.security.LDAPSecurityRealm` * Authorization strategy: `com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy` Active Plugins -------------- * analysis-collector:1.44 'Static Analysis Collector Plug-in' * analysis-core:1.74 'Static Analysis Utilities' * ansicolor:0.4.1 'AnsiColor' * ant:1.2 'Ant Plugin' * antisamy-markup-formatter:1.3 'OWASP Markup Formatter Plugin' * authentication-tokens:1.1 'Authentication Tokens API Plugin' * backup:1.6.1 'Backup plugin' * build-flow-plugin:0.18 'CloudBees Build Flow plugin' * build-monitor-plugin:1.6+build.159 'Build Monitor View' * build-pipeline-plugin:1.4.7 'Build Pipeline Plugin' * buildtriggerbadge:2.1 'Build Trigger Badge Plugin' * checkstyle:3.43 'Checkstyle Plug-in' * cloudbees-folder:4.9 'CloudBees Folders Plugin' * conditional-buildstep:1.3.3 'conditional-buildstep' * config-file-provider:2.8.1 *(update available)* 'Config File Provider Plugin' * configurationslicing:1.41 'Configuration Slicing plugin' * configure-job-column-plugin:1.0 'Configure Job Column Plugin' * console-column-plugin:1.5 'Console Column Plugin' * copyartifact:1.35.2 'Copy Artifact Plugin' * credentials:1.22 'Credentials Plugin' * custom-tools-plugin:0.4.4 'Jenkins Custom Tools Plugin' * cvs:2.12 'Jenkins CVS Plug-in' * dashboard-view:2.9.6 'Dashboard View' * delivery-pipeline-plugin:0.9.4 *(update available)* 'Delivery Pipeline Plugin' * description-setter:1.10 'Jenkins description setter plugin' * docker-build-step:1.28 *(update available)* 'docker-build-step' * docker-commons:1.2 'Docker Commons Plugin' * docker-plugin:0.13.0 'Docker plugin' * docker-workflow:1.2 'CloudBees Docker Workflow' * durable-task:1.6 'Durable Task Plugin' * dynamicparameter:0.2.0 'Jenkins Dynamic Parameter Plug-in' * email-ext:2.40.5 'Email Extension Plugin' * envinject:1.91.3 *(update available)* 'Environment Injector Plugin' * extended-choice-parameter:0.50 *(update available)* 'Extended Choice Parameter Plug-In' * extensible-choice-parameter:1.3.1 *(update available)* 'Extensible Choice Parameter plugin' * external-monitor-job:1.4 'External Monitor Job Type Plugin' * findbugs:4.62 'FindBugs Plug-in' * flexible-publish:0.15.2 'Flexible Publish Plugin' * git:2.4.0 'Jenkins GIT plugin' * git-client:1.18.0 *(update available)* 'Jenkins GIT client plugin' * git-server:1.6 'Git server plugin' * greenballs:1.14 'Green Balls' * groovy:1.27 'Groovy' * groovy-postbuild:2.2.1 'Groovy Postbuild' * hidden-parameter:0.0.4 'Hidden Parameter plugin' * jacoco:1.0.19 'Jenkins JaCoCo plugin' * javadoc:1.3 'Javadoc Plugin' * job-dsl:1.37 'Job DSL' * jobConfigHistory:2.12 'Jenkins Job Configuration History Plugin' * jquery:1.11.2-0 'Jenkins jQuery plugin' * junit:1.9 'JUnit Plugin' * ldap:1.11 'LDAP Plugin' * m2release:0.14.0 'Jenkins Maven Release Plug-in Plug-in' * mailer:1.15 'Jenkins Mailer Plugin' * mapdb-api:1.0.6.0 'MapDB API Plugin' * mask-passwords:2.7.3 *(update available)* 'Mask Passwords Plugin' * matrix-auth:1.2 'Matrix Authorization Strategy Plugin' * matrix-project:1.6 'Matrix Project Plugin' * maven-plugin:2.10 *(update available)* 'Maven Integration plugin' * metrics:3.0.11 'Metrics Plugin' * naginator:1.15 'Naginator' * pam-auth:1.2 'PAM Authentication plugin' * parameterized-trigger:2.28 'Jenkins Parameterized Trigger plugin' * pmd:3.42 'PMD Plug-in' * publish-over-ssh:1.13 'Publish Over SSH' * role-strategy:2.2.0 'Role-based Authorization Strategy' * run-condition:1.0 'Run Condition Plugin' * scm-api:0.2 'SCM API Plugin' * script-security:1.15 'Script Security Plugin' * scriptler:2.7 'Scriptler' * show-build-parameters:1.0 'Show Build Parameters plugin' * sonar:2.2.1 'Jenkins SonarQube Plugin' * ssh-agent:1.8 'SSH Agent Plugin' * ssh-credentials:1.11 'SSH Credentials Plugin' * ssh-slaves:1.10 'Jenkins SSH Slaves plugin' * subversion:2.5.1 *(update available)* 'Jenkins Subversion Plug-in' * support-core:2.27 'Support Core Plugin' * timestamper:1.7.1 *(update available)* 'Timestamper' * token-macro:1.10 'Token Macro Plugin' * toolenv:1.1 'Tool Environment plugin' * translation:1.12 'Jenkins Translation Assistance plugin' * warnings:4.50 'Warnings Plug-in' * windows-slaves:1.1 'Windows Slaves Plugin' * workflow-api:1.10 'Workflow: API' * workflow-basic-steps:1.10 'Workflow: Basic Steps' * workflow-cps:1.10 'Workflow: Groovy CPS Execution' * workflow-job:1.10 'Workflow: Job' * workflow-scm-step:1.10 'Workflow: SCM Step' * workflow-step-api:1.10 'Workflow: Step API' * workflow-support:1.10 'Workflow: Execution Support' * ws-cleanup:0.28 'Jenkins Workspace Cleanup Plugin' * xvnc:1.22 *(update available)* 'Jenkins Xvnc plugin'
script entered in UI without any sandbox
Hmm, that is the first thing I tried, and it worked as I said. Any idea if it can be reproduced in a fresh installation?
(I need to fix the sandbox error in any case, of course, but this may or may not be related.)
jglick Dockerfile
mkdir JENKINS-30390 && cd JENKINS-30390 && wget https://gist.githubusercontent.com/KostyaSha/e5f9abd32df04a612bdb/raw/ed81b07ac35af22d3db826468041baaa5bdd0f86/Dockerfile
reproduced, i guess something missing? Is it possible to provide some better error message?
Docker unrelated, it fails even for
node("label") { sh "echo hello world" }
No ideas what isn't enough
So I ran that Docker container, created a flow, pasted in the above simple script, and Build Now, and it works. (Well, hangs waiting for a nonexistent slave, as expected.) What am I missing? Do you have a Dockerfile that includes the job definition reproducing the problem?
i run this dockerbuild and created only this job
cat jobs/workflow-job/config.xml <?xml version='1.0' encoding='UTF-8'?> <flow-definition plugin="workflow-job@1.10"> <actions/> <description></description> <keepDependencies>false</keepDependencies> <properties/> <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@1.10"> <script>node { // some block } </script> <sandbox>false</sandbox> </definition> <triggers/>
< -L $JENKINS_UC/download/plugins/analysis-collector/1.44/analysis-collector.hpi -o /usr/share/jenkins/ref/plugins/analysis-collector.jpi \ < -L $JENKINS_UC/download/plugins/analysis-core/1.74/analysis-core.hpi -o /usr/share/jenkins/ref/plugins/analysis-core.jpi \
after disabling this plugins workflow works
analysis-collector.hpi contains groovy-cps-1.2.jar, jsr305.jar, annotations-2.0.0-jar looks like trashy packaging.
analysis-collector-1.43 contains right content. 1.44 added workflow support. So workflow support in plugin killed workflow jobs in jenkins, ROFL.
jglick could you split RejectedAccessException issue that you found to separate issue?
Indeed analysis-collector.hpi is full of stuff that should not be there. I think analysis-test is to blame: a jar artifact with dependencies on hpi plugins that is in turn a dependency of an hpi plugin? Makes no sense. If you want to share code across plugins, you just make another hpi plugin.
I do not understand what this commit was about but I suspect it introduced the problem.
i don't see analysis-test in jenkins plugins, should analysis-collector be released to fix this issue?
Seems that having some acceptance tests for the workflow plug-in would be a great enhancement!
Yes of course. analysis-collector needs to be released to get this fixed. You can download the latest CI build to see if it is working.
So this is supposed to be the commit with the effective fix? Yet when I build analysis-collector from trunk sources, I still see the problem. Did not check whether the original symptom is reproducible, but inspection of analysis-collector.hpi shows that it is full of junk.
Ah, I found another problem: seems that the scope test has been removed from analysis-test....
Kanstantsin: any chance that you can write a small acceptance test that exposes the bug? I never used workflows yet...
Code changed in jenkins
User: Ulli Hafner
Path:
analysis-collector.iml
pom.xml
http://jenkins-ci.org/commit/analysis-collector-plugin/fb5698b099431129e38558c2248223039b79c89a
Log:
[FIXED JENKINS-30390] Restore scope "test" for analysis-test.
Code changed in jenkins
User: Ulli Hafner
Path:
analysis-collector
http://jenkins-ci.org/commit/analysis-suite-plugin/39f58f830de7002d8fbe4e245134ebf49da2ca30
Log:
[FIXED JENKINS-30390] Restore scope "test" for analysis-test.
Compare: https://github.com/jenkinsci/analysis-suite-plugin/compare/f3b7e8e77f6c...39f58f830de7
That seems to have done the trick, at least insofar as the artifact now has sane-looking contents.
amuniz said he would try to write an acceptance test at some point.
ATH is not required, it's enough to simply run JenkinsRule and verify build log/status
drulli sorry, i have no time and busy with plugins that i maintain . It was the second time when i tried workflow hello world and it failed. IMHO better keep it for CB.
ATH is required, since the JenkinsRule tests actually did not find this bug!
Right, JenkinsRule loads plugin code from the test classpath when possible, so it cannot accurately reproduce problems related to class loading.
Acceptance test added: https://github.com/jenkinsci/acceptance-test-harness/pull/40
Code changed in jenkins
User: Antonio Muñiz
Path:
src/test/java/plugins/AnalysisCollectorPluginTest.java
http://jenkins-ci.org/commit/acceptance-test-harness/f206413ed69a72d6e207d2be19ea6af41d52b5f7
Log:
JENKINS-30390 New test: Workflow job using Analysis Collector (with findbugs and checkstyle)
Code changed in jenkins
User: Antonio Muñiz
Path:
src/main/java/org/jenkinsci/test/acceptance/po/Job.java
src/main/java/org/jenkinsci/test/acceptance/po/WorkflowJob.java
src/test/java/plugins/AnalysisCollectorPluginTest.java
http://jenkins-ci.org/commit/acceptance-test-harness/c0aeb6d399385ebc8969181033661e7b0adab599
Log:
JENKINS-30390 Use a workflow step to copy resources to the current workspace
Code changed in jenkins
User: Ulli Hafner
Path:
src/main/java/org/jenkinsci/test/acceptance/po/Job.java
src/main/java/org/jenkinsci/test/acceptance/po/WorkflowJob.java
src/test/java/plugins/AnalysisCollectorPluginTest.java
http://jenkins-ci.org/commit/acceptance-test-harness/b27c150f35a386dfced4a5960127bf62f9c34363
Log:
Merge pull request #40 from amuniz/JENKINS-30390
JENKINS-30390 Added test case using Analysis Collector with workflow.
Compare: https://github.com/jenkinsci/acceptance-test-harness/compare/45c104f85dd4...b27c150f35a3
I ran 1.609.3, added Workflow: Aggregator and CloudBees Docker Workflow, created a flow with the script (as structurally close to yours as I could manage while still being usable in my environment)
and it passed.
Tried the same using with Use Groovy Sandbox checked. Then I got an error, though very different from yours:
org.jenkinsci.plugins.scriptsecurity.sandbox.RejectedAccessException: Scripts not permitted to use method groovy.lang.GroovyObject getProperty java.lang.String (org.jenkinsci.plugins.workflow.cps.CpsClosure2.docker) at org.jenkinsci.plugins.scriptsecurity.sandbox.whitelists.StaticWhitelist.rejectMethod(StaticWhitelist.java:155) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.rejectField(SandboxInterceptor.java:186) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:172) at org.kohsuke.groovy.sandbox.impl.Checker$4.call(Checker.java:153) at org.kohsuke.groovy.sandbox.impl.Checker.checkedGetProperty(Checker.java:150) at com.cloudbees.groovy.cps.sandbox.SandboxInvoker.getProperty(SandboxInvoker.java:23) at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:17) at WorkflowScript.run(WorkflowScript:2) at Unknown.Unknown(Unknown) at ___cps.transform___(Native Method) at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:62) at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30) at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:54) at sun.reflect.GeneratedMethodAccessor254.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72) at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21) at com.cloudbees.groovy.cps.Next.step(Next.java:58) at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:145) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:19) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:33) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable$1.call(SandboxContinuable.java:30) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox.runInSandbox(GroovySandbox.java:106) at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:30) at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:164) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:271) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:71) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:180) at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:178) at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:47) at …
which seems related to
JENKINS-30222.In no case was I able to reproduce the exception you saw, which is meaningless to me. Possibly a bug in groovy-cps but have no way of diagnosing it without being able to reproduce from scratch.