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

Unable to export agents as JCasC

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • libvirt-slave-plugin
    • None

      The Libvirt Agents plugin is unable to generate valid Jenkins Configuration as Code (JCasC) for its agents.

      An exception appears in the generated YAML:

        nodes:
        - virtualMachineSlave:
            beforeJobSnapshotName: "REDACTED"
            delegateLauncher:
              inbound:
                workDirSettings:
                  disabled: false
                  failIfWorkDirIsMissing: false
                  internalDir: "remoting"
            hypervisorDescription: "QEMU+ssh - REDACTED"
            launcher: |-
              FAILED TO EXPORT
              hudson.plugins.libvirt.VirtualMachineSlave#launcher: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'waitingTimeSecs' from hudson.plugins.libvirt.VirtualMachineLauncher@1914870e
                at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:478)
                at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:233)
                at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:302)
                at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:330)
                at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
                at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:330)
                at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:316)
                at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
                at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:316)
                at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:109)
                at io.vavr.control.Option.map(Option.java:392)
                at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:109)
                at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:57)
                at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:330)
                at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:257)
                at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:179)
            mode: EXCLUSIVE
            name: "Fedora-37"
            numExecutors: 1
            rebootAfterRun: false
            remoteFS: "/home/REDACTED"
            retentionStrategy: "always"
            shutdownMethod: "shutdown"
            snapshotName: "REDACTED"
            startupTimesToRetryOnFailure: 0
            startupWaitingPeriodSeconds: 60
            virtualMachineName: "Fedora-37" 

      To reproduce:

      1. Have "Libvirt Plugin" installed & configured with at least one agent added
      2. Click "Manage Jenkins"
      3. Click "Configuration as Code"
      4. Click "View Configuration"
      5. Generated JCasC will show the above error for Libvirt Agents

      Log entry that appears to correspond to the YAML-generation error:

      jenkins[801]: 2023-11-23 03:11:34.837+0000 [id=16]        WARNING        i.jenkins.plugins.casc.Attribute#describe: Failed to export
      jenkins[801]: io.jenkins.plugins.casc.ConfiguratorException: Can't read attribute 'waitingTimeSecs' from hudson.plugins.libvirt.VirtualMachineLauncher@14256f04
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute._getValue(Attribute.java:478)
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute.getValue(Attribute.java:233)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:302)
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:330)
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:264)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator.describe(DataBoundConfigurator.java:330)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$convertToNode$de0cd4f8$1(HeteroDescribableConfigurator.java:316)
      jenkins[801]:         at io.vavr.CheckedFunction0.lambda$unchecked$52349c75$1(CheckedFunction0.java:247)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.convertToNode(HeteroDescribableConfigurator.java:316)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.lambda$describe$5(HeteroDescribableConfigurator.java:109)
      jenkins[801]:         at io.vavr.control.Option.map(Option.java:392)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:109)
      jenkins[801]:         at io.jenkins.plugins.casc.impl.configurators.HeteroDescribableConfigurator.describe(HeteroDescribableConfigurator.java:57)
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute._describe(Attribute.java:330)
      jenkins[801]:         at io.jenkins.plugins.casc.Attribute.describe(Attribute.java:257)
      jenkins[801]:         at io.jenkins.plugins.casc.Configurator.describe(Configurator.java:179)
      jenkins[801]:         at io.jenkins.plugins.casc.ConfigurationAsCode.export(ConfigurationAsCode.java:547)
      jenkins[801]:         at io.jenkins.plugins.casc.ConfigurationAsCode.doViewExport(ConfigurationAsCode.java:519)
      jenkins[801]:         at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
      jenkins[801]:         at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:397)
      jenkins[801]:         at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:409)
      jenkins[801]:         at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:78)
      jenkins[801]:         at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      jenkins[801]:         at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:207)
      jenkins[801]:         at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:140)
      jenkins[801]:         at org.kohsuke.stapler.MetaClass$11.doDispatch(MetaClass.java:558)
      jenkins[801]:         at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:59)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      jenkins[801]:         at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:475)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:836)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      jenkins[801]:         at org.kohsuke.stapler.MetaClass$9.dispatch(MetaClass.java:475)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:770)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.invoke(Stapler.java:900)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.invoke(Stapler.java:698)
      jenkins[801]:         at org.kohsuke.stapler.Stapler.service(Stapler.java:248)
      jenkins[801]:         at javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:764)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1665)
      jenkins[801]:         at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:163)
      jenkins[801]:         at jenkins.util.HttpServletFilter$1.doFilter(HttpServletFilter.java:76)
      jenkins[801]:         at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:160)
      jenkins[801]:         at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:166)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at jenkins.ErrorAttributeFilter.doFilter(ErrorAttributeFilter.java:29)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:154)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:94)
      jenkins[801]:         at jenkins.security.AcegiSecurityExceptionFilter.doFilter(AcegiSecurityExceptionFilter.java:52)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:54)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:126)
      jenkins[801]:         at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:120)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:100)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:110)
      jenkins[801]:         at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:101)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)
      jenkins[801]:         at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:221)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:97)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:117)
      jenkins[801]:         at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
      jenkins[801]:         at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:63)
      jenkins[801]:         at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:99)
      jenkins[801]:         at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:111)
      jenkins[801]:         at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:172)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:53)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:86)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at jenkins.security.SuspiciousRequestFilter.doFilter(SuspiciousRequestFilter.java:38)
      jenkins[801]:         at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:202)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1635)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:527)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:131)
      jenkins[801]:         at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:569)
      jenkins[801]:         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:223)
      jenkins[801]:         at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1570)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:221)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1384)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:176)
      jenkins[801]:         at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:484)
      jenkins[801]:         at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1543)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:174)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1306)
      jenkins[801]:         at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:129)
      jenkins[801]:         at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:122)
      jenkins[801]:         at org.eclipse.jetty.server.Server.handle(Server.java:563)
      jenkins[801]:         at org.eclipse.jetty.server.HttpChannel$RequestDispatchable.dispatch(HttpChannel.java:1598)
      jenkins[801]:         at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:753)
      jenkins[801]:         at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:501)
      jenkins[801]:         at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:287)
      jenkins[801]:         at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:314)
      jenkins[801]:         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      jenkins[801]:         at org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint.onFillable(SslConnection.java:558)
      jenkins[801]:         at org.eclipse.jetty.io.ssl.SslConnection.onFillable(SslConnection.java:379)
      jenkins[801]:         at org.eclipse.jetty.io.ssl.SslConnection$2.succeeded(SslConnection.java:146)
      jenkins[801]:         at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
      jenkins[801]:         at org.eclipse.jetty.io.SelectableChannelEndPoint$1.run(SelectableChannelEndPoint.java:53)
      jenkins[801]:         at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.runTask(AdaptiveExecutionStrategy.java:421)
      jenkins[801]:         at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.consumeTask(AdaptiveExecutionStrategy.java:390)
      jenkins[801]:         at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.tryProduce(AdaptiveExecutionStrategy.java:277)
      jenkins[801]:         at org.eclipse.jetty.util.thread.strategy.AdaptiveExecutionStrategy.run(AdaptiveExecutionStrategy.java:199)
      jenkins[801]:         at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:411)
      jenkins[801]:         at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:969)
      jenkins[801]:         at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1194)
      jenkins[801]:         at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1149)
      jenkins[801]:         at java.base/java.lang.Thread.run(Thread.java:829)
      

      Expected: Valid YAML is generated and can be applied in order to create nodes via JCasC.

            m_jeanson Michael
            wtcline_intc Wade
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: