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

NullPointerException in XvfbBuildWrapper.setUp when configured without node label restrictions

    XMLWordPrintable

Details

    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

          Confirm. Introduced in 1.0.11.

          jarst Jarosław Strzelecki added a comment - Confirm. Introduced in 1.0.11.
          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
          }
          
          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 }

          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

          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
          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.

          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.
          zregvart zregvart added a comment -

          closing resolved issue

          zregvart zregvart added a comment - closing resolved issue

          People

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

            Dates

              Created:
              Updated:
              Resolved: