gmacario / easy-jenkins

Easily deploy a Jenkins CI/CD infrastructure via docker-compose
MIT License
35 stars 9 forks source link

io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <plugins> #298

Closed gmacario closed 5 years ago

gmacario commented 5 years ago

Reproduced on host gmpowerhorse after executing

docker-compose down -v
git checkout master
git pull --all --prune
docker-compose build --pull --no-cache
./runme.sh

Error message displayed on http://gmpowerhorse.gmacario.it:9080/

io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <plugins>
    at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:641)
    at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:665)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:649)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:548)
    at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:277)
    at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:269)
Caused: 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)
Caused: java.lang.Error
    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: org.jvnet.hudson.reactor.ReactorException
    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: hudson.util.HudsonFailedToLoad
    at hudson.WebAppMain$3.run(WebAppMain.java:250)
gmacario commented 5 years ago

The configuration-as-code-plugin removed support for the <plugin> root element since v1.8. See https://github.com/jenkinsci/configuration-as-code-plugin/releases/tag/configuration-as-code-1.8

WORKAROUND: Edit file casc_plugins/gmpowerhorse.yaml

gmacario@gmpowerhorse:~/github/gmacario/easy-jenkins (master)*$ git diff
diff --git a/casc_configs/gmpowerhorse.yaml b/casc_configs/gmpowerhorse.yaml
index c3fd6b2..b8875a3 100644
--- a/casc_configs/gmpowerhorse.yaml
+++ b/casc_configs/gmpowerhorse.yaml
@@ -1,9 +1,9 @@
 # File: casc_plugins/gmpowerhorse.yaml

-plugins:
-  sites:
-  - id: "default"
-    url: "https://updates.jenkins.io/update-center.json"
+# plugins:
+#   sites:
+#   - id: "default"
+#     url: "https://updates.jenkins.io/update-center.json"
 jenkins:
   agentProtocols:
   - "JNLP4-connect"
gmacario@gmpowerhorse:~/github/gmacario/easy-jenkins (master)*$ vi casc_configs/gmpowerhorse.yaml 
gmacario@gmpowerhorse:~/github/gmacario/easy-jenkins (master)*$ git diff
diff --git a/casc_configs/gmpowerhorse.yaml b/casc_configs/gmpowerhorse.yaml
index c3fd6b2..2d78c89 100644
--- a/casc_configs/gmpowerhorse.yaml
+++ b/casc_configs/gmpowerhorse.yaml
@@ -1,9 +1,5 @@
 # File: casc_plugins/gmpowerhorse.yaml

-plugins:
-  sites:
-  - id: "default"
-    url: "https://updates.jenkins.io/update-center.json"
 jenkins:
   agentProtocols:
   - "JNLP4-connect"
gmacario@gmpowerhorse:~/github/gmacario/easy-jenkins (master)*$