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

Azure container agents - When saving cloud configuration jenkins got an issue

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

       Saving cloud configuration page always ends with 

      java.lang.ClassNotFoundException: cached miss for ["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"]

       

      It happens all the time after latest upgrade of Jenkins and the plugin. It's impossible to save any changes to cloud configuration. 

      java.lang.ClassNotFoundException: cached miss for ["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"]
      	at hudson.PluginManager$UberClassLoader.findClass(PluginManager.java:2028)
      	at java.lang.ClassLoader.loadClass(Unknown Source)
      	at java.lang.ClassLoader.loadClass(Unknown Source)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:669)
      Caused: java.lang.IllegalArgumentException: Class ["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"] is specified in JSON, but no such class found in classLoader hudson.PluginManager$UberClassLoader
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:674)
      Caused: java.lang.IllegalArgumentException: Failed to instantiate class hudson.slaves.RetentionStrategy from {"stapler-class":["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"],"$class":["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"]}
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:681)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
      	at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:843)
      	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:793)
      	at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)
      Caused: java.lang.Error: Failed to instantiate class com.microsoft.jenkins.containeragents.PodTemplate from {"name":"buildmfxi","label":"ks-build","image":"jenkinsdockerimages.azurecr.io/build-mfxi:v36","privateRegistryCredentials":{"url":"jenkinsdockerimages.azurecr.io","includeUser":"false","credentialsId":"jenkinsdockerimagesUserPass","stapler-class":"org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint","$class":"org.jenkinsci.plugins.docker.commons.credentials.DockerRegistryEndpoint"},"command":"powershell.exe","args":"-command .\\jenkinsSlave.ps1 -url ${rootUrl} ${secret} ${nodeName}","rootFs":"","launchMethodType":"jnlp","includeUser":"false","sshCredentialsId":"","sshPort":"","":"0","retentionStrategy":{"stapler-class":["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"],"$class":["com.microsoft.jenkins.containeragents.strategy.ContainerOnceRetentionStrategy","com.microsoft.jenkins.containeragents.strategy.ContainerIdleRetentionStrategy"]},"specifyNode":"","privileged":false,"requestCpu":"7300","requestMemory":"14000","limitCpu":"7300","limitMemory":"14000","stapler-class":"com.microsoft.jenkins.containeragents.PodTemplate","$class":"com.microsoft.jenkins.containeragents.PodTemplate"}
      	at hudson.model.Descriptor.newInstance(Descriptor.java:606)
      	at hudson.model.Descriptor$NewInstanceBindInterceptor.onConvert(Descriptor.java:675)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:621)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:728)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
      	at org.kohsuke.stapler.RequestImpl.injectSetters(RequestImpl.java:843)
      	at org.kohsuke.stapler.RequestImpl.instantiate(RequestImpl.java:793)
      	at org.kohsuke.stapler.RequestImpl.access$200(RequestImpl.java:83)
      	at org.kohsuke.stapler.RequestImpl$TypePair.convertJSON(RequestImpl.java:678)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:478)
      	at org.kohsuke.stapler.RequestImpl.bindJSON(RequestImpl.java:474)
      	at hudson.model.Descriptor.newInstance(Descriptor.java:598)
      	at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:1075)
      	at hudson.model.Descriptor.newInstancesFromHeteroList(Descriptor.java:1037)
      	at hudson.util.DescribableList.rebuildHetero(DescribableList.java:208)
      	at jenkins.model.GlobalCloudConfiguration.doConfigure(GlobalCloudConfiguration.java:53)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:396)
      Caused: java.lang.reflect.InvocationTargetException
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:400)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:408)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:212)
      	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:145)
      	at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:536)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
      	at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:457)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:766)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:898)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:694)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:240)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:763)
      	at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1633)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
      	at org.jenkinsci.plugins.corsfilter.AccessControlsFilter.doFilter(AccessControlsFilter.java:79)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at jenkins.telemetry.impl.UserLanguages$AcceptLanguageFilter.doFilter(UserLanguages.java:129)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at jenkins.security.ResourceDomainFilter.doFilter(ResourceDomainFilter.java:76)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:60)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at com.cloudbees.jenkins.support.slowrequest.SlowRequestFilter.doFilter(SlowRequestFilter.java:37)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:248)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at hudson.plugins.locale.LocaleFilter.doFilter(LocaleFilter.java:42)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:151)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:153)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	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:119)
      	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:90)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:51)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:36)
      	at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:193)
      	at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1609)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:561)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:578)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1612)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1582)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      	at org.eclipse.jetty.server.Server.handle(Server.java:516)
      	at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
      	at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
      	at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
      	at java.lang.Thread.run(Unknown Source)

        Attachments

          Issue Links

            Activity

            Hide
            kingas Kinga Naras added a comment -

            Tim Jacomb that helped! Thanks a lot

            Show
            kingas Kinga Naras added a comment - Tim Jacomb  that helped! Thanks a lot
            Show
            timja Tim Jacomb added a comment - See my last comment you also need a fix in this plugin too, rc is https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/azure-container-agents/1.2.1-rc183.ae47efd83ef3/azure-container-agents-1.2.1-rc183.ae47efd83ef3.hpi
            Hide
            kingas Kinga Naras added a comment - - edited

            Unfortunately aure-commons-1.0.6 didn't  resolve the issue.

            From console logs:

             behavior.js:119 TypeError: Cannot read property 'tagName' of undefined
             at findInFollowingTR (hudson-behavior.js:389)
             at hudson-behavior.js:1218
             at Array.forEach (<anonymous>)
             at behavior.js:116
             at Array.forEach (<anonymous>)
             at behavior.js:111
             at Array.forEach (<anonymous>)
             at Object.applySubtree (behavior.js:93)
             at Object.apply (behavior.js:76)
             at behavior.js:71
            

             

            TypeError: Cannot read property 'hide' of undefined
             at setElementVisibility (config-context.js:29)
             at handleChange (config-context.js:15)
             at config-context.js:34
             at Array.forEach (<anonymous>)
             at behavior.js:116
             at Array.forEach (<anonymous>)
             at behavior.js:111
             at Array.forEach (<anonymous>)
             at Object.applySubtree (behavior.js:93)
             at Object.apply (behavior.js:76)
            Show
            kingas Kinga Naras added a comment - - edited Unfortunately aure-commons-1.0.6 didn't  resolve the issue. From console logs: behavior.js:119 TypeError: Cannot read property 'tagName' of undefined at findInFollowingTR (hudson-behavior.js:389) at hudson-behavior.js:1218 at Array.forEach (<anonymous>) at behavior.js:116 at Array.forEach (<anonymous>) at behavior.js:111 at Array.forEach (<anonymous>) at Object.applySubtree (behavior.js:93) at Object.apply (behavior.js:76) at behavior.js:71   TypeError: Cannot read property 'hide' of undefined at setElementVisibility (config-context.js:29) at handleChange (config-context.js:15) at config-context.js:34 at Array.forEach (<anonymous>) at behavior.js:116 at Array.forEach (<anonymous>) at behavior.js:111 at Array.forEach (<anonymous>) at Object.applySubtree (behavior.js:93) at Object.apply (behavior.js:76)
            Hide
            timja Tim Jacomb added a comment -

            Azure commons fixes most of the issues, there was also one javascript issue in the plugin, note that updating the azure-commons plugin isn't enough as the plugin uses maskClasses which messes with the classloading.

            Show
            timja Tim Jacomb added a comment - Azure commons fixes most of the issues, there was also one javascript issue in the plugin, note that updating the azure-commons plugin isn't enough as the plugin uses maskClasses which messes with the classloading.
            Hide
            timja Tim Jacomb added a comment -

            I suspect azure commons fixes might be all that's needed, untested though Kinga Naras could you test this please?

            Show
            timja Tim Jacomb added a comment - I suspect azure commons fixes might be all that's needed, untested though Kinga Naras could you test this please?
            Show
            timja Tim Jacomb added a comment - Kinga Naras can you please check if this pre-release helps https://repo.jenkins-ci.org/incrementals/org/jenkins-ci/plugins/azure-commons/1.0.6-rc220.c094849fd287/azure-commons-1.0.6-rc220.c094849fd287.hpi (it's required for fixing azure-vm-agents plugin in https://issues.jenkins.io/browse/JENKINS-64195 )
            Hide
            fqueiruga Félix Queiruga Balado added a comment -

            Tim Jacomb could this be a tables-to-divs issue?

            Kinga Naras can you please check if there are javascript errors on the browser's console, and paste them if there are?

            Show
            fqueiruga Félix Queiruga Balado added a comment - Tim Jacomb  could this be a tables-to-divs issue? Kinga Naras  can you please check if there are javascript errors on the browser's console, and paste them if there are?
            Hide
            kingas Kinga Naras added a comment -

            Any update regarding this one?

            It's really blocking the whole Azure agent's configuration.

            Show
            kingas Kinga Naras added a comment - Any update regarding this one? It's really blocking the whole Azure agent's configuration.

              People

              Assignee:
              azure_devops Azure DevOps
              Reporter:
              kingas Kinga Naras
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: