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

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

    XMLWordPrintable

Details

    Description

      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)

      Attachments

        Issue Links

          Activity

            vlatombe 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_issue_link 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_issue_link SCM/JIRA link daemon made changes -
            Field Original Value New Value
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Resolved [ 5 ]
            stevengbrown Steven G Brown made changes -
            Link This issue is duplicated by JENKINS-16540 [ JENKINS-16540 ]

            Fix included in Timestamper 1.5.3 release.

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

            jdewinne 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.
            jdewinne Joris De Winne made changes -
            Resolution Fixed [ 1 ]
            Status Resolved [ 5 ] 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_issue_link 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
            mhschroe 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.

            mhschroe 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

            jdewinne 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
            aje Andrew Erickson made changes -
            Link This issue is duplicated by JENKINS-17590 [ JENKINS-17590 ]

            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

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

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

            stevengbrown Steven G Brown added a comment - Back from holiday. Released Timestamper 1.5.4 with this fix.
            stevengbrown Steven G Brown made changes -
            Resolution Fixed [ 1 ]
            Status Reopened [ 4 ] Resolved [ 5 ]
            marc_guenther 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_guenther 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.

            stevengbrown Steven G Brown added a comment - Great. Thanks everyone.
            stevengbrown Steven G Brown made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 147606 ] JNJira + In-Review [ 206400 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved: