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

NullPointerException in XvfbBuildWrapper.setUp when configured without node label restrictions

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I get the following traceback when running a job with configured xvfb plugin and no node labels:

      FATAL: null
      java.lang.NullPointerException
      at org.jenkinsci.plugins.xvfb.XvfbBuildWrapper.setUp(XvfbBuildWrapper.java:568)
      at hudson.model.Build$BuildExecution.doRun(Build.java:153)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:518)
      at hudson.model.Run.execute(Run.java:1706)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:231)

      The line reads:

      if (assignedLabels != null || assignedLabels.trim().isEmpty()) {

      shouldn't that be && ?

      A workaround is adding a label (i.e. master)

        Attachments

          Activity

          Hide
          jarst Jarosław Strzelecki added a comment -

          Confirm. Introduced in 1.0.11.

          Show
          jarst Jarosław Strzelecki added a comment - Confirm. Introduced in 1.0.11.
          Hide
          elygre elygre added a comment -

          The required code should use "&&", but it also must negate the isEmpty() (to get those that are not empty):

          if (assignedLabels != null && !assignedLabels.trim().isEmpty()) {
             // Do something using the label
          }
          
          Show
          elygre elygre added a comment - The required code should use "&&", but it also must negate the isEmpty() (to get those that are not empty): if (assignedLabels != null && !assignedLabels.trim().isEmpty()) { // Do something using the label }
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Zoran Regvart
          Path:
          src/main/java/org/jenkinsci/plugins/xvfb/XvfbBuildWrapper.java
          http://jenkins-ci.org/commit/xvfb-plugin/b6573ff15938ea035fd9d9b29bb13cfd16d16367
          Log:
          JENKINS-23267 NullPointerException in XvfbBuildWrapper.setUp when
          configured without node label restrictions

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Zoran Regvart Path: src/main/java/org/jenkinsci/plugins/xvfb/XvfbBuildWrapper.java http://jenkins-ci.org/commit/xvfb-plugin/b6573ff15938ea035fd9d9b29bb13cfd16d16367 Log: JENKINS-23267 NullPointerException in XvfbBuildWrapper.setUp when configured without node label restrictions
          Hide
          zregvart zregvart added a comment -

          This slipped in 1.0.11, sorry about that. Thanks for reporting and suggesting the fix. Version 1.0.12 is released that fixes this and should be available soon on the update center.

          Show
          zregvart zregvart added a comment - This slipped in 1.0.11, sorry about that. Thanks for reporting and suggesting the fix. Version 1.0.12 is released that fixes this and should be available soon on the update center.
          Hide
          zregvart zregvart added a comment -

          closing resolved issue

          Show
          zregvart zregvart added a comment - closing resolved issue

            People

            Assignee:
            zregvart zregvart
            Reporter:
            sk1p Alexander Clausen
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: