Steps to Reproduce: [from ntulele]

      1. Enable plugin for a job
      2. Set the following:
        1. Timeout strategy: Absolute
        2. Timeout minutes: 3
        3. Time-out variable: 19
        4. Time-out actions:
          1. Abort the build
          2. Writing the build description (& enter some text)
      3. Save/Apply and attempt to execute build
      4. Note failure with stack trace per below
      5. delete "19" from the Time-out variable text box
      6. Save/Apply & re-attempt build --> PASS

      Log excerpt:

      FATAL: null
      java.lang.NullPointerException
      	at hudson.plugins.build_timeout.BuildTimeOutStrategy.hasMacros(BuildTimeOutStrategy.java:112)
      	at hudson.plugins.build_timeout.BuildTimeOutStrategy.expandAll(BuildTimeOutStrategy.java:108)
      	at hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy.getTimeOut(AbsoluteTimeOutStrategy.java:44)
      	at hudson.plugins.build_timeout.BuildTimeoutWrapper$EnvironmentImpl.<init>(BuildTimeoutWrapper.java:166)
      	at hudson.plugins.build_timeout.BuildTimeoutWrapper.setUp(BuildTimeoutWrapper.java:211)
      	at hudson.model.Build$BuildExecution.doRun(Build.java:156)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
      	at hudson.model.Run.execute(Run.java:1738)
      	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:410)
      

      from Maciej:
      It happens probably because Action field was not set. I would expect from the plugin a minimal message saying which field should not be null if it is about invalid configuration.

          [JENKINS-32968] BuildTimeOut plugin throws NullPointerException

          ikedam added a comment -

          It looks caused for "Timeout minutes" isn't set.

          But that's strange:
          As far as I know, you can never configure build-timeout in that way...
          An empty string should be set even if you leave the field empty.
          You can never have that field completely unset.

          I'll test the behavior with Jenkins 1.647 and see whethet I can reproduce the problem.
          Please let me know if you know the exact steps to reproduce the problem.

          ikedam added a comment - It looks caused for "Timeout minutes" isn't set. But that's strange: As far as I know, you can never configure build-timeout in that way... An empty string should be set even if you leave the field empty. You can never have that field completely unset. I'll test the behavior with Jenkins 1.647 and see whethet I can reproduce the problem. Please let me know if you know the exact steps to reproduce the problem.

          ikedam added a comment -

          I could not reproduce the problem.
          Please report detailed steps to reproduce that problem.

          Steps I tested:

          1. Launch newly installed Jenkins 1.647.
          2. Go to Manage Jenkins > Manage Plugin and install build timeout plugin (1.16)
          3. Go back to dashboard, and create a freestyle project.
          4. Check "Abort the build if it's stuck"
            • Time-out strategy: Absolute
              • Timeout minutes: (empty) (The initial value is 3)
            • Time-out variable: (empty)
            • Time-out actions: (none)
          5. Save the project.
          6. Run a build

          Result:

          • The build failed with the message:
            FATAL: For input string: ""
            java.lang.NumberFormatException: For input string: ""
            	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
            	at java.lang.Integer.parseInt(Integer.java:504)
            	at java.lang.Integer.parseInt(Integer.java:527)
            	at hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy.getTimeOut(AbsoluteTimeOutStrategy.java:44)
            	at hudson.plugins.build_timeout.BuildTimeoutWrapper$EnvironmentImpl.<init>(BuildTimeoutWrapper.java:166)
            	at hudson.plugins.build_timeout.BuildTimeoutWrapper.setUp(BuildTimeoutWrapper.java:211)
            	at hudson.model.Build$BuildExecution.doRun(Build.java:156)
            	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
            	at hudson.model.Run.execute(Run.java:1738)
            	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
            	at hudson.model.ResourceController.execute(ResourceController.java:98)
            	at hudson.model.Executor.run(Executor.java:410)
            

          ikedam added a comment - I could not reproduce the problem. Please report detailed steps to reproduce that problem. Steps I tested: Launch newly installed Jenkins 1.647. Go to Manage Jenkins > Manage Plugin and install build timeout plugin (1.16) Go back to dashboard, and create a freestyle project. Check "Abort the build if it's stuck" Time-out strategy: Absolute Timeout minutes: (empty) (The initial value is 3) Time-out variable: (empty) Time-out actions: (none) Save the project. Run a build Result: The build failed with the message: FATAL: For input string: "" java.lang.NumberFormatException: For input string: "" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:504) at java.lang.Integer.parseInt(Integer.java:527) at hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy.getTimeOut(AbsoluteTimeOutStrategy.java:44) at hudson.plugins.build_timeout.BuildTimeoutWrapper$EnvironmentImpl.<init>(BuildTimeoutWrapper.java:166) at hudson.plugins.build_timeout.BuildTimeoutWrapper.setUp(BuildTimeoutWrapper.java:211) at hudson.model.Build$BuildExecution.doRun(Build.java:156) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1738) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:98) at hudson.model.Executor.run(Executor.java:410)

          Paul Poling added a comment - - edited

          I encountered this after accidentally entering "19" for the "Time-out variable".
          Definitely would have appreciated a more helpful error than "FATAL: null"

          I've updated the Description with Steps to Reproduce for my case
          Thx

          Paul Poling added a comment - - edited I encountered this after accidentally entering "19" for the "Time-out variable". Definitely would have appreciated a more helpful error than "FATAL: null" I've updated the Description with Steps to Reproduce for my case Thx

          ikedam added a comment -

          I can't reproduce the issue yet even with "19" for "Time-out variable".

          Please let me know followings:

          • Versions of your Jenkins and build-timeout plugin
          • Attach config.xml of the project when the problem occurs
            • It is usually located at ${JENKINS_HOME}/jobs/(project name)/config.xml
          • What is displayed for "Timeout minutes" when you reopen the project configuration page.
          • The web browser you use
            • This sounds like a configuration issue, and might occur only with specific browsers.

          ikedam added a comment - I can't reproduce the issue yet even with "19" for "Time-out variable". Please let me know followings: Versions of your Jenkins and build-timeout plugin Attach config.xml of the project when the problem occurs It is usually located at ${JENKINS_HOME}/jobs/(project name)/config.xml What is displayed for "Timeout minutes" when you reopen the project configuration page. The web browser you use This sounds like a configuration issue, and might occur only with specific browsers.

          ikedam added a comment -

          I decided to close this issue with "Won't Fix" as:

          1. There's no way to reproduce the issue. It looks caused by a broken configuration and I can't ensure behaviors for those cases.

          2. Even if I fixed the NPE, build-timeout shouldn't work as expected without configurations.

          ikedam added a comment - I decided to close this issue with "Won't Fix" as: 1. There's no way to reproduce the issue. It looks caused by a broken configuration and I can't ensure behaviors for those cases. 2. Even if I fixed the NPE, build-timeout shouldn't work as expected without configurations.

            ikedam ikedam
            dzieciou Maciej Gawinecki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: