Jenkins failed to start with oic configurations
See original GitHub issue🚨 Please review the guidelines for contributing to this repository.
-
Jenkins version 2.190
-
Plugin version 1.27 (same error with 1.30, 1.33)
-
OS Openshift RHEL 7.6
Description
Jenkins fails to start with JCasC plugin. Here is the StackTrace:
2019-11-26 09:26:04.766+0000 [id=25] SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
--
| io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <oic>
| at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:673)
| at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:709)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:694)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:585)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:280)
| at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:272)
| 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:1119)
| 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)
| 2019-11-26 09:26:04.771+0000 [id=19] SEVERE hudson.util.BootFailure#publish: Failed to initialize Jenkins
| io.jenkins.plugins.casc.ConfiguratorException: No configurator for root element <oic>
| at io.jenkins.plugins.casc.ConfigurationAsCode.invokeWith(ConfigurationAsCode.java:673)
| at io.jenkins.plugins.casc.ConfigurationAsCode.checkWith(ConfigurationAsCode.java:709)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:694)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configureWith(ConfigurationAsCode.java:585)
| at io.jenkins.plugins.casc.ConfigurationAsCode.configure(ConfigurationAsCode.java:280)
| at io.jenkins.plugins.casc.ConfigurationAsCode.init(ConfigurationAsCode.java:272)
| 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:1119)
| 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:1153)
| at jenkins.model.Jenkins.<init>(Jenkins.java:960)
| 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)
| 2019-11-26 09:26:04.783+0000 [id=19] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
| 2019-11-26 09:26:04.853+0000 [id=19] INFO jenkins.model.Jenkins$18#onAttained: Started termination
| 2019-11-26 09:26:04.892+0000 [id=19] INFO jenkins.model.Jenkins$18#onAttained: Completed termination
| 2019-11-26 09:26:04.893+0000 [id=19] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
| 2019-11-26 09:26:04.899+0000 [id=19] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
| 2019-11-26 09:26:04.930+0000 [id=19] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
| 2019-11-26 09:26:04.954+0000 [id=19] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
| 2019-11-26 09:26:04.954+0000 [id=19] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
Please describe your issue here. I’m using public helm chart Chart values:
JCasC:
enabled: true
defaultConfig: false
pluginVersion: "1.27"
# it's only used when plugin version is <=1.18 for later version the
# configuration as code support plugin is no longer needed
supportPluginVersion: "1.18"
configScripts:
securityRealm: |
oic:
clientId: "aaaaaaaaaa"
clientSecret: "aaaaaaaaaaaaaaaaaaaa"
tokenServerUrl: "https://aaaaaaaaaaaaaaaaaaaaa"
authorizationServerUrl: "https://aaaaaaaaaaaaaaaa"
scopes: "openid email"
userNameField: "Email"
The final ConfigMap generated:
apiVersion: v1
kind: ConfigMap
metadata:
name: RELEASE-NAME-jenkins
namespace: default
labels:
"app.kubernetes.io/name": 'jenkins'
"helm.sh/chart": "jenkins-1.9.3"
"app.kubernetes.io/managed-by": "Tiller"
"app.kubernetes.io/instance": "RELEASE-NAME"
"app.kubernetes.io/component": "jenkins-master"
data:
apply_config.sh: |-
mkdir -p /usr/share/jenkins/ref/secrets/;
# Prevent Setup Wizard when JCasC is enabled
echo $JENKINS_VERSION > /var/jenkins_home/jenkins.install.UpgradeWizard.state
echo $JENKINS_VERSION > /var/jenkins_home/jenkins.install.InstallUtil.lastExecVersion
# Install missing plugins
cp /var/jenkins_config/plugins.txt /var/jenkins_home;
rm -rf /usr/share/jenkins/ref/plugins/*.lock
/usr/local/bin/install-plugins.sh `echo $(cat /var/jenkins_home/plugins.txt)`;
# Copy plugins to shared volume
yes n | cp -i /usr/share/jenkins/ref/plugins/* /var/jenkins_plugins/;
yes n | cp -i /var/jenkins_config/scriptapproval.xml /var/jenkins_home/scriptApproval.xml;
mkdir -p /var/jenkins_home/casc_configs;
rm -rf /var/jenkins_home/casc_configs/*
cp -v /var/jenkins_config/*.yaml /var/jenkins_home/casc_configs
# Only add config to this script if we aren't auto-reloading otherwise the pod will restart upon each config change:
securityRealm.yaml: |-
oic:
clientId: "aaaaaaaaaa"
clientSecret: "aaaaaaaaaaaaaaaaaaaa"
tokenServerUrl: "https://aaaaaaaaaaaaaaaaaaaaa"
authorizationServerUrl: "https://aaaaaaaaaaaaaaaa"
scopes: "openid email"
userNameField: "Email"
Tried looking up something for No configurator for root element <oic>
but couldn’t find anything. What am I missing here?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[JENKINS-59035] Cannot configure oic-auth plugin with JCasC
And trying to configure oic-auth via yaml fails as well. ... Error when starting up Jenkins with the above jenkins.yaml (with correct values)....
Read more >Jenkins fails to start after restart due to com.thoughtworks ...
My setup uses SAML 2.0 for Okta integration, which is important b/c it manages logins and might mean that just launching the service...
Read more >Jenkins instance fails to start - CloudBees Documentation
The recommended way to solve this issue is to stop Jenkins, and restore the backup of the JENKINS_HOME you took before you installed...
Read more >Deploy Jenkins on Oracle Cloud Infrastructure
Click Start using Jenkins to visit the main Jenkins dashboard. At this point, basic configuration of Jenkins master has been successfully ...
Read more >jenkins 4.2.17 - Artifact Hub
The leading open source automation server, Jenkins provides hundreds of ... Admin e-mail address like this because of conflicting configuration error.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I believe this is fixed in reason version of the plugin. https://github.com/jenkinsci/oic-auth-plugin/commit/9c4ea1cafb68807b7b06aa4a6857f9fbfe36bd79
See their tests for configuration example
Tried with security and unclassified but both do not provide support for oic and I cannot find any relevant demo configs here: https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos Can someone plz point me towards oic sample config?