• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • matrix-project-plugin
    • None
    • RHEL 5.4, Java SE 1.6

      Starting with Hudson Version 1.376 every time entering the configuration of a job, all selected Slaves will be deselected.

      Trying to save such a configuration throws an exception:

      Status Code: 500
      Exception:
      Stacktrace:

      java.lang.RuntimeException: Failed to instantiate class hudson.matrix.LabelAxis from

      {"kind":"hudson.matrix.LabelAxis$DescriptorImpl","name":"label","stapler-class":"hudson.matrix.LabelAxis"}

      at hudson.model.Descriptor.newInstance(Descriptor.java:497)
      at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:767)
      at hudson.util.DescribableList.rebuildHetero(DescribableList.java:171)
      at hudson.matrix.MatrixProject.submit(MatrixProject.java:563)
      at hudson.model.Job.doConfigSubmit(Job.java:1062)
      at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:578)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:259)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:126)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:65)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:79)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:534)
      at org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:219)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:534)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:450)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:132)
      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.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      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(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at java.util.ArrayList.(ArrayList.java:131)
      at hudson.matrix.Axis.(Axis.java:74)
      at hudson.matrix.LabelAxis.(LabelAxis.java:40)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      at org.kohsuke.stapler.RequestImpl.invokeConstructor(RequestImpl.java:409)
      at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:355)
      at hudson.model.Descriptor.newInstance(Descriptor.java:488)
      ... 55 more

      Generated by Winstone Servlet Engine v0.9.10 at Fri Sep 17 15:56:52 CEST 2010

      Workaround so far, reselect nodes/labels each time.

          [JENKINS-7500] Configure Job deselects all Node/Label slaves

          pingus added a comment -

          With version 1.377 and recreating the matrix jobs, the issue is solved. Label and node selections are persistant again.

          Without recreating the job, the system only saved the lable part of the configuration (directly after upgrading to 1.377).

          (Is it OK to close this issue being the reporter in this case?)

          pingus added a comment - With version 1.377 and recreating the matrix jobs, the issue is solved. Label and node selections are persistant again. Without recreating the job, the system only saved the lable part of the configuration (directly after upgrading to 1.377). (Is it OK to close this issue being the reporter in this case?)

          pingus added a comment -

          Sorry, too early too happy.

          After a while of further configuration work, the issue reappears. Every time I open the configuration all selected nodes and labels are gone again.

          pingus added a comment - Sorry, too early too happy. After a while of further configuration work, the issue reappears. Every time I open the configuration all selected nodes and labels are gone again.

          Alan Harder added a comment -

          do you get any javascript errors reported in your browser?

          can you post steps to recreate the issue with a newly created matrix project?

          Alan Harder added a comment - do you get any javascript errors reported in your browser? can you post steps to recreate the issue with a newly created matrix project?

          pingus added a comment -

          Yes, after some additional tests I've seen the issue occurs when selecting all nodes or all labels only.

          1. Create new matrix project
          2. Add axis slave
          3.a Select all nodes
          3.b Select all labels
          4. Save
          5. Configure again
          6. Open axis and all selections are gone

          If you select only a subset, the selection will be stored.

          pingus added a comment - Yes, after some additional tests I've seen the issue occurs when selecting all nodes or all labels only. 1. Create new matrix project 2. Add axis slave 3.a Select all nodes 3.b Select all labels 4. Save 5. Configure again 6. Open axis and all selections are gone If you select only a subset, the selection will be stored.

          jpschewe added a comment -

          In my case I'm only selecting a subset.
          1. create new matrix project
          2. default axis
          3. select subset of labels
          4. save
          5. configure job
          6. all selections are gone
          At this point the save results in the exception.

          jpschewe added a comment - In my case I'm only selecting a subset. 1. create new matrix project 2. default axis 3. select subset of labels 4. save 5. configure job 6. all selections are gone At this point the save results in the exception.

          kbertelson added a comment -

          Fails on our Hudson v1.377 system w/15 slaves like so:

          Create new matrix project
          Configuration Matrix > Add Axis > Slaves > Individual nodes...

          Choose all 15 slaves
          Reopen saved matrix project
          [ FAIL. All slaves are now unchecked ]
          Choose 5 slaves
          Reopen saved matrix project
          [ FAIL. All slaves are now unchecked ]
          Choose last 3 slaves
          Reopen saved matrix project
          [ Everything looks good... ]
          Choose last 5 slaves
          Reopen saved matrix project
          [ Everything looks good... ]
          Choose last 7 slaves
          Reopen saved matrix project
          [ FAIL. All slaves are now unchecked ]
          Choose last 5 slaves
          Reopen saved matrix project
          [ Everything looks good... ]

          Thought it may be related to node Decription string length since last 5 slaves have a especially short description. But that didn't seem to matter.

          kbertelson added a comment - Fails on our Hudson v1.377 system w/15 slaves like so: Create new matrix project Configuration Matrix > Add Axis > Slaves > Individual nodes... Choose all 15 slaves Reopen saved matrix project [ FAIL. All slaves are now unchecked ] Choose 5 slaves Reopen saved matrix project [ FAIL. All slaves are now unchecked ] Choose last 3 slaves Reopen saved matrix project [ Everything looks good... ] Choose last 5 slaves Reopen saved matrix project [ Everything looks good... ] Choose last 7 slaves Reopen saved matrix project [ FAIL. All slaves are now unchecked ] Choose last 5 slaves Reopen saved matrix project [ Everything looks good... ] Thought it may be related to node Decription string length since last 5 slaves have a especially short description. But that didn't seem to matter.

          Nathan Parry added a comment -

          This happens when the total length of the names of the slaves you select exceeds 30 characters. Looks like hudson.matrix.Axis.getValueString() switches from a space delimiter to a newline delimiter at that point.

          In LabelAxis/config.jelly there is this bit of html/javascript to help determine what slaves should be checked. I'm guessing the split doesn't work when newlines are used as the delimiter.

          <div class="yahooTree labelAxis-tree" style="border: 1px solid gray; height: 10em; overflow:auto;" values="${instance.valueString}" />
          
          ...
          
          var values = (e.getAttribute("values") || "").split(" ");
          function has(v) {
              return values.include(v) ? 'checked="checked" ' : "";
          }
          

          Nathan Parry added a comment - This happens when the total length of the names of the slaves you select exceeds 30 characters. Looks like hudson.matrix.Axis.getValueString() switches from a space delimiter to a newline delimiter at that point. In LabelAxis/config.jelly there is this bit of html/javascript to help determine what slaves should be checked. I'm guessing the split doesn't work when newlines are used as the delimiter. <div class= "yahooTree labelAxis-tree" style= "border: 1px solid gray; height: 10em; overflow:auto;" values= "${instance.valueString}" /> ... var values = (e.getAttribute( "values" ) || "").split(" "); function has(v) { return values.include(v) ? 'checked= "checked" ' : ""; }

          Nathan Parry added a comment -

          Not being terribly familiar with this code I can't say if this is the best approach, but changing

          split(" ")

          to...

          split(/[ \n]/)

          seems to fix the issue. (Not sure if the space in the regex is easy to see - that is splitting on either space or newline)

          Nathan Parry added a comment - Not being terribly familiar with this code I can't say if this is the best approach, but changing split( " " ) to... split(/[ \n]/) seems to fix the issue. (Not sure if the space in the regex is easy to see - that is splitting on either space or newline)

          It's a pity that fixing this didn't make it into 1.378 seeing as the issue seems to have been identified and even possible fixes supplied.

          Could we please get this fixed in the next release?

          Brian J Murrell added a comment - It's a pity that fixing this didn't make it into 1.378 seeing as the issue seems to have been identified and even possible fixes supplied. Could we please get this fixed in the next release?

          I guess the question to my answer is no. 1.379 is out and this issue is still not fixed (not in the changelog anyway).

          It's frustrating that this isn't this getting fixed. It's marked as critical even and rightfully so in that it's entirely annoying that every time I modify a multi-configuration job (i.e. make script changes) I need to re-select all of my nodes/labels. Yes. Very annoying indeed.

          If somebody has fixed this locally and can explain how I can fix my local copy I'd be happy to do so until somebody can get this fixed into a release. Thanx.

          Brian J Murrell added a comment - I guess the question to my answer is no. 1.379 is out and this issue is still not fixed (not in the changelog anyway). It's frustrating that this isn't this getting fixed. It's marked as critical even and rightfully so in that it's entirely annoying that every time I modify a multi-configuration job (i.e. make script changes) I need to re-select all of my nodes/labels. Yes. Very annoying indeed. If somebody has fixed this locally and can explain how I can fix my local copy I'd be happy to do so until somebody can get this fixed into a release. Thanx.

          Cervator added a comment -

          Confirming that I've hit this issue too putting a new 1.379 install up. My old 1.355 stable install is still working great.

          I was going to try the manual fix to config.jelly posted above, but I can't find a LabelAxis dir or a config.jelly with split(" ") in it - any more directions for a patch-fix would be appreciated until this gets fixed for real

          Cervator added a comment - Confirming that I've hit this issue too putting a new 1.379 install up. My old 1.355 stable install is still working great. I was going to try the manual fix to config.jelly posted above, but I can't find a LabelAxis dir or a config.jelly with split(" ") in it - any more directions for a patch-fix would be appreciated until this gets fixed for real

          Tzuchien added a comment -

          I have the same problem with 1.375 also !

          Tzuchien added a comment - I have the same problem with 1.375 also !

          Andrew Bayer added a comment -

          The split change does seem to do the trick - I'm not sure the right way to do config round trip testing on this, though, since it's so heavily javascript-based. But local testing looks good - I'll commit this, and it should be in 1.381. Sorry for the delays.

          Andrew Bayer added a comment - The split change does seem to do the trick - I'm not sure the right way to do config round trip testing on this, though, since it's so heavily javascript-based. But local testing looks good - I'll commit this, and it should be in 1.381. Sorry for the delays.

          Andrew Bayer added a comment -

          Ah, no, check that, 1.382.

          Andrew Bayer added a comment - Ah, no, check that, 1.382.

          Code changed in hudson
          User: : abayer
          Path:
          branches/rc/core/src/main/resources/hudson/matrix/LabelAxis/config.jelly
          http://jenkins-ci.org/commit/35931
          Log:
          [FIXED JENKINS-7500] Fixed error when saving job configuration with matrix label axis longer than 30 characters

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: branches/rc/core/src/main/resources/hudson/matrix/LabelAxis/config.jelly http://jenkins-ci.org/commit/35931 Log: [FIXED JENKINS-7500] Fixed error when saving job configuration with matrix label axis longer than 30 characters

          Andrew Bayer added a comment -

          Ok, actually, I was right the first time. =) I put the change into the rc branch, so it should show up in 1.381.

          Andrew Bayer added a comment - Ok, actually, I was right the first time. =) I put the change into the rc branch, so it should show up in 1.381.

          dogfood added a comment -

          Integrated in hudson_main_trunk #339
          Merged revisions 35931,35963,35995,35997,36001 via svnmerge from
          https://www.dev.java.net/svn/hudson/branches/rc

          ........
          r35931 | abayer | 2010-10-14 19:54:34 +0200 (Thu, 14 Oct 2010) | 1 line

          [FIXED JENKINS-7500] Fixed error when saving job configuration with matrix label axis longer than 30 characters
          ........
          r35963 | kohsuke | 2010-10-15 10:19:59 +0200 (Fri, 15 Oct 2010) | 1 line

          fixed unnecessary packet fragmentation when writing out HTTP responses
          ........
          r35995 | kohsuke | 2010-10-16 18:25:31 +0200 (Sat, 16 Oct 2010) | 1 line

          [maven-release-plugin] prepare release hudson-1_381
          ........
          r35997 | kohsuke | 2010-10-16 18:25:44 +0200 (Sat, 16 Oct 2010) | 1 line

          [maven-release-plugin] prepare for next development iteration
          ........
          r36001 | kohsuke | 2010-10-16 19:25:57 +0200 (Sat, 16 Oct 2010) | 1 line

          updated changelog as a part of the release
          ........

          kohsuke :
          Files :

          • /trunk/hudson/main
          • /trunk/hudson/main/core/pom.xml
          • /trunk/hudson/main/war/pom.xml
          • /trunk/hudson/main/test/pom.xml
          • /trunk/hudson/main/remoting/pom.xml
          • /trunk/hudson/main/core/src/main/resources/hudson/matrix/LabelAxis/config.jelly
          • /trunk/hudson/main/debian/debian/changelog
          • /trunk/hudson/main/maven-plugin/pom.xml
          • /trunk/hudson/main/pom.xml
          • /trunk/hudson/main/cli/pom.xml
          • /trunk/hudson/main/ui-samples-plugin/pom.xml
          • /trunk/hudson/main/maven-agent/pom.xml
          • /trunk/hudson/main/maven-interceptor/pom.xml

          dogfood added a comment - Integrated in hudson_main_trunk #339 Merged revisions 35931,35963,35995,35997,36001 via svnmerge from https://www.dev.java.net/svn/hudson/branches/rc ........ r35931 | abayer | 2010-10-14 19:54:34 +0200 (Thu, 14 Oct 2010) | 1 line [FIXED JENKINS-7500] Fixed error when saving job configuration with matrix label axis longer than 30 characters ........ r35963 | kohsuke | 2010-10-15 10:19:59 +0200 (Fri, 15 Oct 2010) | 1 line fixed unnecessary packet fragmentation when writing out HTTP responses ........ r35995 | kohsuke | 2010-10-16 18:25:31 +0200 (Sat, 16 Oct 2010) | 1 line [maven-release-plugin] prepare release hudson-1_381 ........ r35997 | kohsuke | 2010-10-16 18:25:44 +0200 (Sat, 16 Oct 2010) | 1 line [maven-release-plugin] prepare for next development iteration ........ r36001 | kohsuke | 2010-10-16 19:25:57 +0200 (Sat, 16 Oct 2010) | 1 line updated changelog as a part of the release ........ kohsuke : Files : /trunk/hudson/main /trunk/hudson/main/core/pom.xml /trunk/hudson/main/war/pom.xml /trunk/hudson/main/test/pom.xml /trunk/hudson/main/remoting/pom.xml /trunk/hudson/main/core/src/main/resources/hudson/matrix/LabelAxis/config.jelly /trunk/hudson/main/debian/debian/changelog /trunk/hudson/main/maven-plugin/pom.xml /trunk/hudson/main/pom.xml /trunk/hudson/main/cli/pom.xml /trunk/hudson/main/ui-samples-plugin/pom.xml /trunk/hudson/main/maven-agent/pom.xml /trunk/hudson/main/maven-interceptor/pom.xml

            abayer Andrew Bayer
            pingus pingus
            Votes:
            17 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: