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

NPE on job save when no expressions provided for label expression axis

    XMLWordPrintable

Details

    Description

      javax.servlet.ServletException: java.lang.NullPointerException
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:778)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
      	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1074)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	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 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
      	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
      	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      	at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
      	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
      	at org.mortbay.jetty.Server.handle(Server.java:285)
      	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:765)
      	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:628)
      	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
      Caused by: java.lang.NullPointerException
      	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:187)
      	at com.google.common.collect.SingletonImmutableSet.<init>(SingletonImmutableSet.java:47)
      	at com.google.common.collect.ImmutableSet.of(ImmutableSet.java:88)
      	at com.google.common.collect.ImmutableSet.copyFromCollection(ImmutableSet.java:341)
      	at com.google.common.collect.ImmutableSet.copyOf(ImmutableSet.java:329)
      	at com.google.common.collect.Sets$CartesianSet$Axis.<init>(Sets.java:1086)
      	at com.google.common.collect.Sets$CartesianSet.<init>(Sets.java:998)
      	at com.google.common.collect.Sets.cartesianProduct(Sets.java:935)
      	at hudson.matrix.AxisList.list(AxisList.java:82)
      	at hudson.matrix.MatrixProject.rebuildConfigurations(MatrixProject.java:630)
      	at hudson.matrix.MatrixProject.submit(MatrixProject.java:887)
      	at hudson.model.Job.doConfigSubmit(Job.java:1154)
      	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:773)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
      	... 39 more
      

      Attachments

        Issue Links

          Activity

            oleg_nenashev Oleg Nenashev added a comment -

            Unfortunately, the form validation and error handling is not good for all axis types

            oleg_nenashev Oleg Nenashev added a comment - Unfortunately, the form validation and error handling is not good for all axis types
            oleg_nenashev Oleg Nenashev added a comment - - edited

            Similar to JENKINS-9277 (just another field)

            oleg_nenashev Oleg Nenashev added a comment - - edited Similar to JENKINS-9277 (just another field)
            olivergondza Oliver Gondža added a comment - Proposing fix https://github.com/jenkinsci/matrix-project-plugin/pull/14 .

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/hudson/matrix/AxisDescriptor.java
            src/main/java/hudson/matrix/JDKAxis.java
            src/main/java/hudson/matrix/LabelExpAxis.java
            src/main/resources/hudson/matrix/Messages.properties
            src/test/java/hudson/matrix/AxisTest.java
            http://jenkins-ci.org/commit/matrix-project-plugin/9ea857b279b86dd9c27268ffddad1359b3df8e27
            Log:
            [FIXED JENKINS-9277 JENKINS-25448] Reject invalid axis name/value at the time of configuration

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/matrix/AxisDescriptor.java src/main/java/hudson/matrix/JDKAxis.java src/main/java/hudson/matrix/LabelExpAxis.java src/main/resources/hudson/matrix/Messages.properties src/test/java/hudson/matrix/AxisTest.java http://jenkins-ci.org/commit/matrix-project-plugin/9ea857b279b86dd9c27268ffddad1359b3df8e27 Log: [FIXED JENKINS-9277 JENKINS-25448] Reject invalid axis name/value at the time of configuration

            Code changed in jenkins
            User: Oliver Gondža
            Path:
            src/main/java/hudson/matrix/AxisDescriptor.java
            src/main/java/hudson/matrix/JDKAxis.java
            src/main/java/hudson/matrix/LabelExpAxis.java
            src/main/java/hudson/matrix/MatrixProject.java
            src/main/java/hudson/matrix/TextAxis.java
            src/main/resources/hudson/matrix/Messages.properties
            src/test/java/hudson/matrix/AxisDescriptorTest.java
            src/test/java/hudson/matrix/AxisTest.java
            http://jenkins-ci.org/commit/matrix-project-plugin/1bdbe10c552928ce2547df3fc180c1c5db4d9588
            Log:
            Merge pull request #14 from olivergondza/validate-axes

            [FIXED JENKINS-9277 JENKINS-25448 JENKINS-23614] Disallow special chars in axis names and values

            Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/6be15fe17421...1bdbe10c5529

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/matrix/AxisDescriptor.java src/main/java/hudson/matrix/JDKAxis.java src/main/java/hudson/matrix/LabelExpAxis.java src/main/java/hudson/matrix/MatrixProject.java src/main/java/hudson/matrix/TextAxis.java src/main/resources/hudson/matrix/Messages.properties src/test/java/hudson/matrix/AxisDescriptorTest.java src/test/java/hudson/matrix/AxisTest.java http://jenkins-ci.org/commit/matrix-project-plugin/1bdbe10c552928ce2547df3fc180c1c5db4d9588 Log: Merge pull request #14 from olivergondza/validate-axes [FIXED JENKINS-9277 JENKINS-25448 JENKINS-23614] Disallow special chars in axis names and values Compare: https://github.com/jenkinsci/matrix-project-plugin/compare/6be15fe17421...1bdbe10c5529

            People

              olivergondza Oliver Gondža
              olivergondza Oliver Gondža
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: