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

A wrong configuration of CasC yaml kill Jenkins startup

XMLWordPrintable

      While testing the CasC plugin I've found that if the yaml is wrong, Jenkins stop restarting, leaving you with an unoperational instance.

      Steps to reproduce:

      • Create a yaml with ssh credentials
      • Import this yaml
      • Remove credentials and ssh-credentials
      • Restart Jenkins

      Expected:

      • Some settings are established, others not.

      Current behavior:

      • Jenkins doesn't start.

       

      Jun 05, 2019 5:27:03 PM jenkins.InitReactorRunner$1 onTaskFailed
      Jun 05, 2019 5:27:03 PM jenkins.InitReactorRunner$1 onTaskFailed SEVERE: Failed ConfigurationAsCode.init
      java.lang.Error: java.lang.reflect.InvocationTargetException
       at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
       at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
       at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
       at jenkins.model.Jenkins$5.runTask(Jenkins.java:1096)
       at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
       at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.reflect.InvocationTargetException
       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:498) at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) ... 8 more
      Caused by: io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <credentials>
       at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:642)
       at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:666)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:650)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:549)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:277)
       at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:269) ... 13 more
      Jun 05, 2019 5:27:03 PM hudson.util.BootFailure publish SEVERE: Failed to initialize Jenkins
      hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
       at hudson.WebAppMain$3.run(WebAppMain.java:250)
      Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
       at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
       at jenkins.InitReactorRunner.run(InitReactorRunner.java:48)
       at jenkins.model.Jenkins.executeReactor(Jenkins.java:1130)
       at jenkins.model.Jenkins.<init>(Jenkins.java:932)
       at hudson.model.Hudson.<init>(Hudson.java:85)
       at hudson.model.Hudson.<init>(Hudson.java:81)
       at hudson.WebAppMain$3.run(WebAppMain.java:233)
      Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
       at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
       at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:175)
       at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
       at jenkins.model.Jenkins$5.runTask(Jenkins.java:1096)
       at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
       at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
       at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.reflect.InvocationTargetException
       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:498)
       at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:104) ... 8 more
      Caused by: io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <credentials>
       at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:642)
       at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:666)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:650)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:549)
       at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:277)
       at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:269) ... 13 more
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins cleanUp INFO: Stopping Jenkins
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins$18 onAttained INFO: Started termination
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins$18 onAttained INFO: Completed termination
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins _cleanUpDisconnectComputers INFO: Starting node disconnection
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins _cleanUpShutdownPluginManager INFO: Stopping plugin manager
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins _cleanUpPersistQueue INFO: Persisting build queue
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins _cleanUpAwaitDisconnects INFO: Waiting for node disconnection completion
      Jun 05, 2019 5:27:03 PM jenkins.model.Jenkins cleanUp INFO: Jenkins stopped
      

            ewel Ewelina Wilkosz
            mramonleon Ramon Leon
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: