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.

          Vincent Latombe created issue -

          Code changed in jenkins
          User: StevenGBrown
          Path:
          src/main/java/hudson/plugins/timestamper/TimestampFormatter.java
          src/test/java/hudson/plugins/timestamper/TimestampFormatterTest.java
          http://jenkins-ci.org/commit/timestamper-plugin/4029ac433521b354014aeb730509acd9e61e10e6
          Log:
          [FIXED JENKINS-16778] Allow for a null stapler request


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: StevenGBrown Path: src/main/java/hudson/plugins/timestamper/TimestampFormatter.java src/test/java/hudson/plugins/timestamper/TimestampFormatterTest.java http://jenkins-ci.org/commit/timestamper-plugin/4029ac433521b354014aeb730509acd9e61e10e6 Log: [FIXED JENKINS-16778] Allow for a null stapler request – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Steven G Brown made changes -
          Link New: This issue is duplicated by JENKINS-16540 [ JENKINS-16540 ]

          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.
          Joris De Winne made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          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

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

              Created:
              Updated:
              Resolved: