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

readFileFromWorkspace broken in job dsl 1.60

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: job-dsl-plugin
    • Environment:
      Jenkins: 2.54
      Job-dsl-plugin: 1.60
      OS: Windows Server 2016
      browser: Chrome
      Java: Oracle JDK 8u121
    • Similar Issues:

      Description

      after migration to job dsl 1.60 readFileFromWorkspace broke. It throws nullpointer.

      I tried to add job name as a first parameter then returned string is null instead script content. Script must have been found since there is a "exists" check there so I do not know why content of file is returned as null.

        Attachments

          Activity

          carek Piotr Tempes created issue -
          Hide
          arty13 Art V added a comment - - edited

          I also am getting this error now.

          Commit that introduced this issue:

          1f1cff83a

          I assume because there is no project object at this point.

          Here is my stack trace...

          jenkins_1 | WARNING: Failed to run script file:/var/jenkins_home/init.groovy.d/jobDsl.groovy
          jenkins_1 | java.lang.NullPointerException
          jenkins_1 | at javaposse.jobdsl.plugin.JenkinsJobManagement.readFileInWorkspace(JenkinsJobManagement.java:273)
          jenkins_1 | at javaposse.jobdsl.dsl.JobManagement$readFileInWorkspace$0.call(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
          jenkins_1 | at javaposse.jobdsl.dsl.JobParent.readFileFromWorkspace(JobParent.groovy:304)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
          jenkins_1 | at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:446)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:371)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
          jenkins_1 | at script$_run_closure1$_closure2.doCall(script:7)
          jenkins_1 | at script$_run_closure1$_closure2.doCall(script)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
          jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
          jenkins_1 | at javaposse.jobdsl.plugin.structs.DescribableListContext.methodMissing(DescribableListContext.groovy:59)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:941)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1264)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812)
          jenkins_1 | at javaposse.jobdsl.plugin.structs.DescribableListContext.invokeMethod(DescribableListContext.groovy)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:430)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:371)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
          jenkins_1 | at script$_run_closure1.doCall(script:3)
          jenkins_1 | at script$_run_closure1.doCall(script)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
          jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16)
          jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper$executeInContext.call(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
          jenkins_1 | at javaposse.jobdsl.plugin.JenkinsJobParent.configFiles(JenkinsJobParent.groovy:18)
          jenkins_1 | at javaposse.jobdsl.dsl.DslFactory$configFiles.callCurrent(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
          jenkins_1 | at script.run(script:2)
          jenkins_1 | at script$run.call(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:132)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScriptEngine(AbstractDslScriptLoader.groovy:105)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$_runScripts_closure1.doCall(AbstractDslScriptLoader.groovy:60)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
          jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
          jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
          jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
          jenkins_1 | at groovy.lang.Closure.call(Closure.java:414)
          jenkins_1 | at groovy.lang.Closure.call(Closure.java:430)
          jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
          jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
          jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056)
          jenkins_1 | at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScripts(AbstractDslScriptLoader.groovy:46)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScripts$0.callCurrent(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:85)
          jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScript.call(Unknown Source)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
          jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
          jenkins_1 | at jobDsl.run(jobDsl.groovy:92)
          jenkins_1 | at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585)
          jenkins_1 | at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:136)
          jenkins_1 | at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:127)
          jenkins_1 | at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:110)
          jenkins_1 | at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:41)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498)
          jenkins_1 | at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104)
          jenkins_1 | at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
          jenkins_1 | at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
          jenkins_1 | at jenkins.model.Jenkins$7.runTask(Jenkins.java:1064)
          jenkins_1 | at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
          jenkins_1 | at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
          jenkins_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          jenkins_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          jenkins_1 | at java.lang.Thread.run(Thread.java:745)
          
          

          My code that is running.. (init.groovy.d script)

          import javaposse.jobdsl.plugin.JenkinsJobManagement
          import javaposse.jobdsl.plugin.JenkinsDslScriptLoader
          
          // TODO: read from disk instead of string above.
          //def jobDslScript = new File('jobDsl.dsl')
          // workspace during init is root '/' so specify full path to groovy files
          //def workspace = new File('.')
          def workspace = new File('/usr/share/jenkins/ref/init.groovy.d')
          def jobManagement = new JenkinsJobManagement(System.out, [:], workspace)
          
          new JenkinsDslScriptLoader(jobManagement).runScript(mavenConfigDsl)
          new JenkinsDslScriptLoader(jobManagement).runScript(jobDsl)
          new JenkinsDslScriptLoader(jobManagement).runScript(jobE2EDsl)
          
          Show
          arty13 Art V added a comment - - edited I also am getting this error now. Commit that introduced this issue: 1f1cff83a I assume because there is no project object at this point. Here is my stack trace... jenkins_1 | WARNING: Failed to run script file:/ var /jenkins_home/init.groovy.d/jobDsl.groovy jenkins_1 | java.lang.NullPointerException jenkins_1 | at javaposse.jobdsl.plugin.JenkinsJobManagement.readFileInWorkspace(JenkinsJobManagement.java:273) jenkins_1 | at javaposse.jobdsl.dsl.JobManagement$readFileInWorkspace$0.call(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) jenkins_1 | at javaposse.jobdsl.dsl.JobParent.readFileFromWorkspace(JobParent.groovy:304) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812) jenkins_1 | at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:46) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:446) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:371) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) jenkins_1 | at script$_run_closure1$_closure2.doCall(script:7) jenkins_1 | at script$_run_closure1$_closure2.doCall(script) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:57) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:46) jenkins_1 | at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallStatic(CallSiteArray.java:56) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:194) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214) jenkins_1 | at javaposse.jobdsl.plugin.structs.DescribableListContext.methodMissing(DescribableListContext.groovy:59) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:941) jenkins_1 | at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1264) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1217) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:812) jenkins_1 | at javaposse.jobdsl.plugin.structs.DescribableListContext.invokeMethod(DescribableListContext.groovy) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:430) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:371) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) jenkins_1 | at script$_run_closure1.doCall(script:3) jenkins_1 | at script$_run_closure1.doCall(script) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:42) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper.executeInContext(ContextHelper.groovy:16) jenkins_1 | at javaposse.jobdsl.dsl.ContextHelper$executeInContext.call(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133) jenkins_1 | at javaposse.jobdsl.plugin.JenkinsJobParent.configFiles(JenkinsJobParent.groovy:18) jenkins_1 | at javaposse.jobdsl.dsl.DslFactory$configFiles.callCurrent(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) jenkins_1 | at script.run(script:2) jenkins_1 | at script$run.call(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:132) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScriptEngine(AbstractDslScriptLoader.groovy:105) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:174) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$_runScripts_closure1.doCall(AbstractDslScriptLoader.groovy:60) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93) jenkins_1 | at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325) jenkins_1 | at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294) jenkins_1 | at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024) jenkins_1 | at groovy.lang.Closure.call(Closure.java:414) jenkins_1 | at groovy.lang.Closure.call(Closure.java:430) jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030) jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015) jenkins_1 | at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2056) jenkins_1 | at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274) jenkins_1 | at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScripts(AbstractDslScriptLoader.groovy:46) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScripts$0.callCurrent(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader.runScript(AbstractDslScriptLoader.groovy:85) jenkins_1 | at javaposse.jobdsl.dsl.AbstractDslScriptLoader$runScript.call(Unknown Source) jenkins_1 | at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) jenkins_1 | at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) jenkins_1 | at jobDsl.run(jobDsl.groovy:92) jenkins_1 | at groovy.lang.GroovyShell.evaluate(GroovyShell.java:585) jenkins_1 | at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:136) jenkins_1 | at jenkins.util.groovy.GroovyHookScript.execute(GroovyHookScript.java:127) jenkins_1 | at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:110) jenkins_1 | at hudson.init.impl.GroovyInitScript.init(GroovyInitScript.java:41) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) jenkins_1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) jenkins_1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) jenkins_1 | at java.lang.reflect.Method.invoke(Method.java:498) jenkins_1 | at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) jenkins_1 | at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175) jenkins_1 | at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282) jenkins_1 | at jenkins.model.Jenkins$7.runTask(Jenkins.java:1064) jenkins_1 | at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210) jenkins_1 | at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117) jenkins_1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) jenkins_1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) jenkins_1 | at java.lang. Thread .run( Thread .java:745) My code that is running.. (init.groovy.d script) import javaposse.jobdsl.plugin.JenkinsJobManagement import javaposse.jobdsl.plugin.JenkinsDslScriptLoader // TODO: read from disk instead of string above. //def jobDslScript = new File( 'jobDsl.dsl' ) // workspace during init is root '/' so specify full path to groovy files //def workspace = new File( '.' ) def workspace = new File( '/usr/share/jenkins/ref/init.groovy.d' ) def jobManagement = new JenkinsJobManagement( System .out, [:], workspace) new JenkinsDslScriptLoader(jobManagement).runScript(mavenConfigDsl) new JenkinsDslScriptLoader(jobManagement).runScript(jobDsl) new JenkinsDslScriptLoader(jobManagement).runScript(jobE2EDsl)
          Hide
          daspilker Daniel Spilker added a comment -

          Will be fixed in the next release: https://github.com/jenkinsci/job-dsl-plugin/pull/1016

          Show
          daspilker Daniel Spilker added a comment - Will be fixed in the next release: https://github.com/jenkinsci/job-dsl-plugin/pull/1016
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JenkinsJobManagement.java
          http://jenkins-ci.org/commit/job-dsl-plugin/c5433982766b6d68a1cb85cd0f0832bfc194c6f0
          Log:
          avoid NPE in readFileFromWorkspace

          [FIXES JENKINS-43537]

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JenkinsJobManagement.java http://jenkins-ci.org/commit/job-dsl-plugin/c5433982766b6d68a1cb85cd0f0832bfc194c6f0 Log: avoid NPE in readFileFromWorkspace [FIXES JENKINS-43537]
          scm_issue_link SCM/JIRA link daemon made changes -
          Field Original Value New Value
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Daniel Spilker
          Path:
          docs/Home.md
          job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JenkinsJobManagement.java
          http://jenkins-ci.org/commit/job-dsl-plugin/72a6e57eaa2bf7f1b36cee474a7ec130042272c8
          Log:
          Merge branch 'JENKINS-43537'

          Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/9be2fc51e32e...72a6e57eaa2b

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Spilker Path: docs/Home.md job-dsl-plugin/src/main/groovy/javaposse/jobdsl/plugin/JenkinsJobManagement.java http://jenkins-ci.org/commit/job-dsl-plugin/72a6e57eaa2bf7f1b36cee474a7ec130042272c8 Log: Merge branch ' JENKINS-43537 ' Compare: https://github.com/jenkinsci/job-dsl-plugin/compare/9be2fc51e32e...72a6e57eaa2b
          daspilker Daniel Spilker made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              daspilker Daniel Spilker
              Reporter:
              carek Piotr Tempes
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: