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

Timestamper makes the build fail if the slave if put offline during the build.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • timestamper-plugin
    • None

      If a slave is put offline during a running build, the timestamper plugin issues a NPE at the end of the build, marking the build as failed.

      The stacktrace is the following

      17:11:18 Looks like the node went offline during the build. Check the slave log for the details.FATAL: null
      17:11:18 java.lang.NullPointerException
      17:11:18 at hudson.plugins.timestamper.TimestampFormatter.<init>(TimestampFormatter.java:71)
      17:11:20 at hudson.plugins.timestamper.TimestamperConfig$1.get(TimestamperConfig.java:59)
      17:11:20 at hudson.plugins.timestamper.TimestamperConfig$1.get(TimestamperConfig.java:54)
      17:11:20 at hudson.plugins.timestamper.TimestamperConfig.formatter(TimestamperConfig.java:148)
      17:11:20 at hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory.newInstance(TimestampAnnotatorFactory.java:51)
      17:11:20 at hudson.console.ConsoleAnnotator._for(ConsoleAnnotator.java:143)
      17:11:20 at hudson.console.ConsoleAnnotator.initial(ConsoleAnnotator.java:133)
      17:11:20 at hudson.console.AnnotatedLargeText.createAnnotator(AnnotatedLargeText.java:138)
      17:11:20 at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:155)
      17:11:20 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:605)
      17:11:20 at hudson.model.Run.execute(Run.java:1543)
      17:11:20 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      17:11:20 at hudson.model.ResourceController.execute(ResourceController.java:88)
      17:11:20 at hudson.model.Executor.run(Executor.java:236)

          [JENKINS-16778] Timestamper makes the build fail if the slave if put offline during the build.

          Fix included in Timestamper 1.5.3 release.

          Steven G Brown added a comment - Fix included in Timestamper 1.5.3 release.

          I think this is still an issue:
          When a slave is taken temporary offline, at the end of a build a NullPointer Exception is thrown at
          src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory.java (line 65).

          String path = request.getPathInfo();

          So I think request is null.

          Joris De Winne added a comment - I think this is still an issue: When a slave is taken temporary offline, at the end of a build a NullPointer Exception is thrown at src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory.java (line 65). String path = request.getPathInfo(); So I think request is null.

          Code changed in jenkins
          User: StevenGBrown
          Path:
          src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory.java
          http://jenkins-ci.org/commit/timestamper-plugin/8317afcb23693e91b21e2330577dcba2db2d1058
          Log:
          Merge pull request #3 from jdewinne/master

          JENKINS-16778: Timestamper makes the build fail if the slave is put offline during the build.

          Compare: https://github.com/jenkinsci/timestamper-plugin/compare/09ec70200054...8317afcb2369

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: StevenGBrown Path: src/main/java/hudson/plugins/timestamper/annotator/TimestampAnnotatorFactory.java http://jenkins-ci.org/commit/timestamper-plugin/8317afcb23693e91b21e2330577dcba2db2d1058 Log: Merge pull request #3 from jdewinne/master JENKINS-16778 : Timestamper makes the build fail if the slave is put offline during the build. Compare: https://github.com/jenkinsci/timestamper-plugin/compare/09ec70200054...8317afcb2369

          Martin Schröder added a comment - - edited

          I can definitely confirm what Joris stated.

          The bug is still not fixed. If you mark a node as temporarily offline while a build is running, the Timestamper plugin will still throw an NPE:
          ---------------------------------------------
          10:16:03 Looks like the node went offline during the build. Check the slave log for the details.FATAL: null
          10:16:03 java.lang.NullPointerException
          10:16:03 at hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory.getOffset(TimestampAnnotatorFactory.java:65)
          10:16:03 at hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory.newInstance(TimestampAnnotatorFactory.java:52)
          10:16:03 at hudson.console.ConsoleAnnotator._for(ConsoleAnnotator.java:143)
          10:16:03 at hudson.console.ConsoleAnnotator.initial(ConsoleAnnotator.java:133)
          10:16:03 at hudson.console.AnnotatedLargeText.createAnnotator(AnnotatedLargeText.java:140)
          10:16:03 at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:157)
          10:16:03 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:605)
          10:16:03 at hudson.model.Run.execute(Run.java:1568)
          [...]
          ---------------------------------------------

          One thing to note is that this happens right in the middle of a build-step in our case. It will cause whatever is currently running to abort.

          I hope this can help you track down the issue.

          Martin Schröder added a comment - - edited I can definitely confirm what Joris stated. The bug is still not fixed. If you mark a node as temporarily offline while a build is running, the Timestamper plugin will still throw an NPE: --------------------------------------------- 10:16:03 Looks like the node went offline during the build. Check the slave log for the details.FATAL: null 10:16:03 java.lang.NullPointerException 10:16:03 at hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory.getOffset(TimestampAnnotatorFactory.java:65) 10:16:03 at hudson.plugins.timestamper.annotator.TimestampAnnotatorFactory.newInstance(TimestampAnnotatorFactory.java:52) 10:16:03 at hudson.console.ConsoleAnnotator._for(ConsoleAnnotator.java:143) 10:16:03 at hudson.console.ConsoleAnnotator.initial(ConsoleAnnotator.java:133) 10:16:03 at hudson.console.AnnotatedLargeText.createAnnotator(AnnotatedLargeText.java:140) 10:16:03 at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:157) 10:16:03 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:605) 10:16:03 at hudson.model.Run.execute(Run.java:1568) [...] --------------------------------------------- One thing to note is that this happens right in the middle of a build-step in our case. It will cause whatever is currently running to abort. I hope this can help you track down the issue.

          Martin,

          I've implemented a fix for this. So this will be fixed with the next release of the plugin. If you want you can checkout the code and use the latest version from github.

          Regards,
          Joris

          Joris De Winne added a comment - Martin, I've implemented a fix for this. So this will be fixed with the next release of the plugin. If you want you can checkout the code and use the latest version from github. Regards, Joris

          Steven, Joris, (or anyone with permissions - not sure where to see a list of people),

          Will you please publish a 1.5.4 with this latest fix?

          Thanks,
          Andy

          Andrew Erickson added a comment - Steven, Joris, (or anyone with permissions - not sure where to see a list of people), Will you please publish a 1.5.4 with this latest fix? Thanks, Andy

          Seconded.

          We're not that keen on using a self-compiled version, either. It should be a measure of last resort, after all.

          Plus, it always raises inquisitive questions by users when your productive server contains a "-SNAPSHOT" plugin.

          Best regards,
          Martin.

          Martin Schröder added a comment - Seconded. We're not that keen on using a self-compiled version, either. It should be a measure of last resort, after all. Plus, it always raises inquisitive questions by users when your productive server contains a "-SNAPSHOT" plugin. Best regards, Martin.

          Back from holiday. Released Timestamper 1.5.4 with this fix.

          Steven G Brown added a comment - Back from holiday. Released Timestamper 1.5.4 with this fix.

          Marc Günther added a comment -

          Thanks Steven. I just tested thsis, and it works now. I still get a "Looks like the slave went offline..." message in the Console, but no more exception and it doesn't fail the build.

          Marc Günther added a comment - Thanks Steven. I just tested thsis, and it works now. I still get a "Looks like the slave went offline..." message in the Console, but no more exception and it doesn't fail the build.

          Great. Thanks everyone.

          Steven G Brown added a comment - Great. Thanks everyone.

            stevengbrown Steven G Brown
            vlatombe Vincent Latombe
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: