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

Saving/Applying multi-branch job config causes NullPointerException hudson.scm.SCMS.parseSCM

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • Jenkins 2.9 & Jenkins 2.10
      Multi-Branch Project Plugin 0.4.2
      SCM API Plugin 1.2
      Git Client Plugin 1.19.6
      Git Plugin 2.4.4
      Ubuntu 12.04 & 14.04 & 16.04

      While saving a "multi-branch" job configuration the Exception occurs (even when there is no change). But the projects auto created (one per branch) are saveable.

      javax.servlet.ServletException: java.lang.NullPointerException
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      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 jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      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 jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      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:67)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
      at hudson.scm.SCMS.parseSCM(SCMS.java:60)
      at hudson.model.AbstractProject.submit(AbstractProject.java:1864)
      at hudson.model.Project.submit(Project.java:230)
      at hudson.model.Job.doConfigSubmit(Job.java:1229)
      at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:795)
      at com.github.mjdetullio.jenkins.plugins.multibranch.AbstractMultiBranchProject.submit(AbstractMultiBranchProject.java:539)
      at com.cloudbees.hudson.plugins.folder.AbstractFolder.doConfigSubmit(AbstractFolder.java:713)
      at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.doConfigSubmit(ComputedFolder.java:225)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:497)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
      at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:52)
      at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      ... 60 more

        1. 1.jpg
          1.jpg
          98 kB
        2. 2.jpg
          2.jpg
          207 kB

          [JENKINS-36043] Saving/Applying multi-branch job config causes NullPointerException hudson.scm.SCMS.parseSCM

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - It's regression due to the JENKINS-35098 fix by jglick . https://github.com/jenkinsci/jenkins/commit/d33df0f2e4cbe5a6e35f34ece96059826aa7471d . Reassigning to the core

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - Pull request: https://github.com/jenkinsci/jenkins/pull/2422

          Jesse Glick added a comment -

          Probably another symptom of JENKINS-35906.

          Jesse Glick added a comment - Probably another symptom of JENKINS-35906 .

          Jesse Glick added a comment -

          It is not really a core bug, though a core change resulted in the bug. This crazy code is failing to define a NullSCM the way it should (CC mjdetullio). So the call to templateProject.doConfigSubmit is passing an invalid form.

          Jesse Glick added a comment - It is not really a core bug, though a core change resulted in the bug. This crazy code is failing to define a NullSCM the way it should (CC mjdetullio ). So the call to templateProject.doConfigSubmit is passing an invalid form.

          Crazy code indeed. Shouldn't be too hard to add more crazy code there to fix it.

          Matthew DeTullio added a comment - Crazy code indeed. Shouldn't be too hard to add more crazy code there to fix it.

          Marcus Olk added a comment -

          Same here:

          Jenkins ver. 2.11
          Multi-Branch Project Plugin 0.4.2
          Folders Plugin 5.12
          SCM API Plugin 1.2
          GitPlugin 2.5.0

          mjdetullio Matthew DeTullio
          Crazy code indeed. Shouldn't be too hard to add more crazy code there to fix it.

          Any idea when to expect a crazy coded fix? I know: it's ready when it's ready ...

          Marcus Olk added a comment - Same here: Jenkins ver. 2.11 Multi-Branch Project Plugin 0.4.2 Folders Plugin 5.12 SCM API Plugin 1.2 GitPlugin 2.5.0 mjdetullio Matthew DeTullio Crazy code indeed. Shouldn't be too hard to add more crazy code there to fix it. Any idea when to expect a crazy coded fix ? I know: it's ready when it's ready ...

          Oleg Nenashev added a comment -

          Closing as a Duplicate

          Oleg Nenashev added a comment - Closing as a Duplicate

          Oleg Nenashev added a comment -

          https://github.com/jenkinsci/jenkins/pull/2426 has been integrated into the core. To be released in 2.12

          Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/2426 has been integrated into the core. To be released in 2.12

          Matthew DeTullio added a comment - Also fixed retroactively with https://github.com/jenkinsci/multi-branch-project-plugin/commit/93ac3771f550230f18d7f7f0eb99983db6d38d52 , part of 0.5 release

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/scm/SCMS.java
          http://jenkins-ci.org/commit/jenkins/27d8f06f1baabb320cc86527250bed5a7dacf85e
          Log:
          JENKINS-35906 Ensure that SCMDescriptor.newInstance overrides are honored (#2426)

          • [FIXED JENKINS-35906] Ensure that SCMDescriptor.newInstance overrides are honored.
          • [FIXED JENKINS-36043] Work around fragile form submission design in multi-branch-project-plugin.

          (cherry picked from commit 1d176d1f19bfc717ffc335046539ffdd079efdf4)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/scm/SCMS.java http://jenkins-ci.org/commit/jenkins/27d8f06f1baabb320cc86527250bed5a7dacf85e Log: JENKINS-35906 Ensure that SCMDescriptor.newInstance overrides are honored (#2426) [FIXED JENKINS-35906] Ensure that SCMDescriptor.newInstance overrides are honored. [FIXED JENKINS-36043] Work around fragile form submission design in multi-branch-project-plugin. (cherry picked from commit 1d176d1f19bfc717ffc335046539ffdd079efdf4)

            jglick Jesse Glick
            bbernardin BERNARDIN Benoit
            Votes:
            8 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: