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

browserInstance null causes an NPE in Sauce On Demand plugin 1.154

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • sauce-ondemand-plugin
    • Jenkins 2.9 running on Red Hat Enterprise Linux Server release 6.7 (Santiago)

      Sauce on Demand plugin version 1.154
      Jenkins 2.9

      We intermittently see a “java.lang.NullPointerException” using Sauce On Demand when running a browser test using a Build Flow as trigger, which causes the tunnel creation to fail, so naturally the browser test never executes. We were never able to reproduce this error when triggering the browser test manually so we added some debug statement to src/main/java/hudson/plugins/sauce_ondemand/SauceEnvironmentUtil.java (https://github.com/imuchnik/sauce-ondemand-plugin) and waited for the problem to resurface. We examined the output log and noticed this:

      browserInstance null
      ERROR outputting environment variable
      java.lang.NullPointerException

      It appears that in some circumstances browserInstance is null, an NPE is thrown and Sauce On Demand fails to create a tunnel and the Jenkins job subsequently fails.

      We have the environmental variables output inside a try/catch block starting here (https://github.com/imuchnik/sauce-ondemand-plugin/blob/30dd383db64398f5980f6f37689bfd0d6ba08cca/src/main/java/hudson/plugins/sauce_ondemand/SauceEnvironmentUtil.java#L67) and we allow the job to continue even though browserInstance is null, as it appears that if we catch and swallow the NPE the browser test executes without problem from that point forward.

            halkeye Gavin Mogan
            orlandosoto Orlando Soto
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: