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

Jenkins is throwing a NullPointerException at SauceOnDemandBuildWrapper when the jobs are created using a DSL script

    Details

    • Similar Issues:

      Description

      • I use a DSL groovy script to create my jobs
      • The jobs are created successfully
      • When I attempt to build a job that was created by the DSL, Jenkins is throwing the below error

       

      Starting pre-build for Sauce Labs plugin
      FATAL: null
      java.lang.NullPointerException
      	at hudson.plugins.sauce_ondemand.SauceOnDemandBuildWrapper.setUp(SauceOnDemandBuildWrapper.java:354)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:157)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
      	at hudson.model.Run.execute(Run.java:1815)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      
      • However, if I click on the configure job link, do nothing and hit save/apply, the job is building fine.
      • The sauce pre-build is successful if I save the job once manually
      • I have tons of jobs and it's not really possible to configure every job manually 

      Can someone please advise on what's going wrong here? Thanks! 

        Attachments

          Activity

          Hide
          danielstephen Daniel Vergil added a comment -

          Can someone please help me with this error? Thanks! 

          Show
          danielstephen Daniel Vergil added a comment - Can someone please help me with this error? Thanks! 
          Hide
          metarobert robert arles added a comment -

          I'm seeing the same issue and the same workaround (open the config, save, then the job runs properly) I'm only just starting to troubleshoot this, I'm suspecting an issue originating in the groovy DSL, but it is isolated to specific jobs, not affected all jobs created by the script.

          Show
          metarobert robert arles added a comment - I'm seeing the same issue and the same workaround (open the config, save, then the job runs properly) I'm only just starting to troubleshoot this, I'm suspecting an issue originating in the groovy DSL, but it is isolated to specific jobs, not affected all jobs created by the script.
          Hide
          danielstephen Daniel Vergil added a comment -

          robert arles I figured out that the issue was with the 'credentialId' in the 'sauceOnDemandBuildWrapper'. The scope of the credentialId I used was incorrect. It's working fine now after I fixed the 'credentialId'. Thanks! 

          Show
          danielstephen Daniel Vergil added a comment - robert arles I figured out that the issue was with the 'credentialId' in the 'sauceOnDemandBuildWrapper'. The scope of the credentialId I used was incorrect. It's working fine now after I fixed the 'credentialId'. Thanks! 
          Hide
          metarobert robert arles added a comment -

          Daniel Vergil  Thank you for the update! Very much appreciated.

          Show
          metarobert robert arles added a comment - Daniel Vergil   Thank you for the update! Very much appreciated.

            People

            • Assignee:
              yfangsl Yeh Fang
              Reporter:
              danielstephen Daniel Vergil
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: