• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • build-timeout-plugin
    • None
    • Jenkins: 2.426
      OS: Alpine docker image
      Java: JDK11 and JDK17
      git-plugin: 5.2.0

      Hello,

      After updating Jenkins from 2.425 to 2.426 I am not able to Save/Apply changes to jobs that use git as SCM.

      The error is JSONObject["scm"] is not a JSONObject. with the following stacktrace:

      net.sf.json.JSONException: JSONObject["scm"] is not a JSONObject.
      	at net.sf.json.JSONObject.getJSONObject(JSONObject.java:2006)
      	at hudson.scm.SCMS.parseSCM(SCMS.java:57)
      	at hudson.model.AbstractProject.submit(AbstractProject.java:1833)
      	at hudson.model.Project.submit(Project.java:228)
      	at hudson.model.Job.doConfigSubmit(Job.java:1345)
      	at hudson.model.AbstractProject.doConfigSubmit(AbstractProject.java:775)
      	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
      	at org.kohsuke.stapler.SelectionInterceptedFunction$Adapter.invoke(SelectionInterceptedFunction.java:36)
      	at org.kohsuke.stapler.verb.HttpVerbInterceptor.invoke(HttpVerbInterceptor.java:48)
      	at org.kohsuke.stapler.SelectionInterceptedFunction.bindAndInvoke(SelectionInterceptedFunction.java:26)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      	at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:289)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:698)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:248)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
      	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:163)
      	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at hudson.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:112)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at io.jenkins.plugins.audit.filter.RequestContextFilter.doFilter(RequestContextFilter.java:52)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:64)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at jenkins.util.HttpServletFilter$1.doFilter(HttpServletFilter.java:76)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:166)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at jenkins.ErrorAttributeFilter.doFilter(ErrorAttributeFilter.java:29)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
      	at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
      	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:110)
      	at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:101)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
      	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:97)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:117)
      	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:111)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:172)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:53)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:549)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      	at org.eclipse.jetty.server.Server.handle(Server.java:563)
      	at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      	at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
      	at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
      	at java.base/java.lang.Thread.run(Unknown Source)
       

      This is the same issue reported in StackOverflow: https://stackoverflow.com/questions/77272132/after-upgrading-from-jenkins-2-384-to-2-426-i-get-jsonobjectscm-is-not-a-js

          [JENKINS-72202] Error when saving job that uses git

          Mark Waite added a comment -

          I can't duplicate the issue as reported. I've been running Jenkins 2.426 on my primary CI server since 2.426 was released. Steps that I took while attempting to duplicate the bug:

          1. Download Jenkins plugins as listed in my plugins.txt file
          2. Run Jenkins 2.426
          3. Modify an existing freestyle job to add Git SCM that it was previously not using
          4. Save the freestyle job and confirm that no failures are reported
          5. Open the freestyle job and confirm that the changes were saved

          There may be an outdated plugin installed on your controller. Refer to detailed steps on community.jenkins.io for guidance in the investigation of your installed plugins.

          There could be other issues. You'll need to provide more information so that others can duplicate the issue.

          Mark Waite added a comment - I can't duplicate the issue as reported. I've been running Jenkins 2.426 on my primary CI server since 2.426 was released. Steps that I took while attempting to duplicate the bug: Download Jenkins plugins as listed in my plugins.txt file Run Jenkins 2.426 Modify an existing freestyle job to add Git SCM that it was previously not using Save the freestyle job and confirm that no failures are reported Open the freestyle job and confirm that the changes were saved There may be an outdated plugin installed on your controller. Refer to detailed steps on community.jenkins.io for guidance in the investigation of your installed plugins. There could be other issues. You'll need to provide more information so that others can duplicate the issue.

          Sem added a comment - - edited

          Ran into this too.

          We had a few back-to-back upgrades and might have not noticed when it broke between 2.425-2.428.

          Currently rolled back to 2.424 and no longer see this message when modifying Maven project jobs, maintenance is coming up so will try to slowly inch up the versions to see when I get this (along with another) error message.

          EDIT: Some offline testing later can confirm something broke with 2.426. 2.425 works without any errors.

          Sem added a comment - - edited Ran into this too. We had a few back-to-back upgrades and might have not noticed when it broke between 2.425-2.428. Currently rolled back to 2.424 and no longer see this message when modifying Maven project jobs, maintenance is coming up so will try to slowly inch up the versions to see when I get this (along with another) error message. EDIT: Some offline testing later can confirm something broke with 2.426. 2.425 works without any errors.

          Mark Waite added a comment -

          Thanks nuno_sc and stv for reporting the issue. Unfortunately, I can't duplicate it with a maven project on Jenkins 2.426.

          Can you provide the precise list of plugins installed on your Jenkins controller? The "How to report an issue" page includes a Groovy script that generates the plugin identifiers and versions in a format that can be easily be used to recreate the same set of plugins and versions as you are running.

          Mark Waite added a comment - Thanks nuno_sc and stv for reporting the issue. Unfortunately, I can't duplicate it with a maven project on Jenkins 2.426. Can you provide the precise list of plugins installed on your Jenkins controller? The "How to report an issue" page includes a Groovy script that generates the plugin identifiers and versions in a format that can be easily be used to recreate the same set of plugins and versions as you are running.

          Nuno added a comment - - edited

          Thanks for trying to reproduce it Mark, I will also try it on a clean instance.

           

          I noticed that the issue only happens in instances where when creating/updating a Freestyle job, the Git fields are always visible even though no SCM is selected e.g:

           

          And looking at browser's developer tools there are some JS errors related to build-timeout plugin, more specifically version 1.21.

          Upon updating to build-timeout:1.31 the issue is gone and jobs can be edited once again in Jenkins 2.428.

          Nuno added a comment - - edited Thanks for trying to reproduce it Mark, I will also try it on a clean instance.   I noticed that the issue only happens in instances where when creating/updating a Freestyle job, the Git fields are always visible even though no SCM is selected e.g:   And looking at browser's developer tools there are some JS errors related to build-timeout plugin, more specifically version 1.21. Upon updating to build-timeout:1.31 the issue is gone and jobs can be edited once again in Jenkins 2.428 .

          Sem added a comment -

          Thanks nuno_sc. We're pretty much in the same position, have `build-timeout` at 1.21.
          Will update later today and report back.

          Sem added a comment - Thanks nuno_sc . We're pretty much in the same position, have `build-timeout` at 1.21. Will update later today and report back.

          Sem added a comment -

          Better late than never, but yep updating `build-timeout` worked here as well.

          Sem added a comment - Better late than never, but yep updating `build-timeout` worked here as well.

            Unassigned Unassigned
            nuno_sc Nuno
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: