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

Configuration Slicing plugin: Discard Old Builds Slicer not works (NumberFormatException and unexpected behavior)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Windows XP SP2,
      Hudson 1.339,
      Configuration Slicing plugin 1.10
    • Similar Issues:

      Description

      As I understand plugin shows configuration in this way:
      1. For projects with "Discard Old Builds" checkbox DISABLED plugin shows:
      (Disabled) :: job1
      2. For projects with "Discard Old Builds" checkbox ENABLED, but number of builds not specified plugin shows:
      :: job2
      3. For projects with "Discard Old Builds" checkbox ENABLED and number of builds specified plugin shows:
      10 :: job3

      If I'm trying to save this configuration:
      ---------------------
      :: job2
      10 :: job3
      (Disabled) :: job1
      ---------------------

      I'm getting:

      --------------------------------------------------------------
      Status Code: 500
      Exception:
      Stacktrace:

      java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at java.lang.Integer.parseInt(Unknown Source)
      at configurationslicing.logrotator.LogRotationSlicer$LogRotationBuildsSliceSpec.setValues(LogRotationSlicer.java:145)
      at configurationslicing.logrotator.LogRotationSlicer$LogRotationBuildsSliceSpec.setValues(LogRotationSlicer.java:99)
      at configurationslicing.UnorderedStringSlicer.transform(UnorderedStringSlicer.java:33)
      at configurationslicing.UnorderedStringSlicer.transform(UnorderedStringSlicer.java:8)
      at configurationslicing.ConfigurationSlicing$SliceExecutor.transform(ConfigurationSlicing.java:84)
      at configurationslicing.ConfigurationSlicing$SliceExecutor.doSliceconfigSubmit(ConfigurationSlicing.java:109)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:185)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:318)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:318)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:492)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:408)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:117)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      at java.lang.Thread.run(Unknown Source)

      Generated by Winstone Servlet Engine v0.9.10 at Tue Jan 12 15:27:07 MSK 2010
      --------------------------------------------------------------

      This is probably due to " :: job2" field.

      Also, if I'm trying to save this configuration:
      ---------------------
      (Disabled) :: job2
      10 :: job3
      (Disabled) :: job1
      ---------------------
      I'm getting result, that can be described in configuration as:
      ---------------------
      :: job2, job1
      10 :: job3
      ---------------------

      But expected:
      ---------------------
      10 :: job3
      (Disabled) :: job2, job1
      ---------------------

      Thanks!

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : mdonohue
          Path:
          trunk/hudson/plugins/configurationslicing/.classpath
          trunk/hudson/plugins/configurationslicing/src/main/java/configurationslicing/logrotator/LogRotationSlicer.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=26006
          Log:
          Fix LogRotationSlicer to handle empty strings better JENKINS-5240

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : mdonohue Path: trunk/hudson/plugins/configurationslicing/.classpath trunk/hudson/plugins/configurationslicing/src/main/java/configurationslicing/logrotator/LogRotationSlicer.java http://fisheye4.cenqua.com/changelog/hudson/?cs=26006 Log: Fix LogRotationSlicer to handle empty strings better JENKINS-5240
          Hide
          mdonohue mdonohue added a comment -

          The 1.14 release of ConfigurationSlicing should fix the issue.

          Show
          mdonohue mdonohue added a comment - The 1.14 release of ConfigurationSlicing should fix the issue.

            People

            • Assignee:
              mdonohue mdonohue
              Reporter:
              rutsky rutsky
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: