Reputation: 1145
Using Jenkins 2.169
A Jenkins server suddenly failed today with the following error:
SEVERE: Failed Loading global config
java.io.IOException: Unable to read /somewhere/jenkins/home/config.xml
at hudson.XmlFile.unmarshal(XmlFile.java:181)
at hudson.XmlFile.unmarshal(XmlFile.java:161)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3043)
at jenkins.model.Jenkins.access$1300(Jenkins.java:309)
at jenkins.model.Jenkins$13.run(Jenkins.java:3145)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
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:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: jenkins.util.xstream.CriticalXStreamException: hudson.security.GlobalMatrixAuthorizationStrategy : hudson.security.GlobalMatrixAuthorizationStrategy
---- Debugging information ----
message : hudson.security.GlobalMatrixAuthorizationStrategy
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : hudson.security.GlobalMatrixAuthorizationStrategy
class : hudson.model.Hudson
required-type : hudson.model.Hudson
converter-type : hudson.util.RobustReflectionConverter
path : /hudson/authorizationStrategy
line number : 12
version : not available
-------------------------------
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:354)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:268)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1189)
at hudson.util.XStream2.unmarshal(XStream2.java:161)
at hudson.util.XStream2.unmarshal(XStream2.java:132)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
at hudson.XmlFile.unmarshal(XmlFile.java:178)
... 12 more
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.security.GlobalMatrixAuthorizationStrategy
Found out that the culprit were two missing plugins:
matrix-auth
ldap
I could recover Jenkins, by manually copying the plugins from another server. Files copied:
jenkins/home/plugins/matrix-auth
jenkins/home/plugins/matrix-auth.jpi
jenkins/home/plugins/ldap
jenkins/home/plugins/ldap.jpi
First, I installed matrix-auth. Then I got the following error that indicated that ldap was also having issues:
Caused by: jenkins.util.xstream.CriticalXStreamException:
hudson.security.LDAPSecurityRealm : hudson.security.LDAPSecurityRealm
---- Debugging information ----
message : hudson.security.LDAPSecurityRealm
cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : hudson.security.LDAPSecurityRealm
class : hudson.model.Hudson
required-type : hudson.model.Hudson
converter-type : hudson.util.RobustReflectionConverter
path : /hudson/securityRealm
line number : 53
version : not available
-------------------------------
After further investigation found out that lots of plugins got deleted (also, I found out the culprit and it is NOT related to Jenkins). So part of the solution was to copy the entire plugin directory from another Jenkins server.
Upvotes: 7
Views: 21506
Reputation: 11
I struggled a lot with this issue.
I upgraded the jenkins from 2.377 to 2.433
and jenkins refused to start with the same error as you experienced.
What I did was like this to resolve the issue.
Take a backup of config.xml
Open config.xml and
Changed
--- useSecurity true useSecurity to
----useSecurity false useSecurity
And removed everything from
---<authorizationStrategy
----class="hudson.security.GlobalMatrixAuthorizationStrategy">
.....
until the second appearance of
----/securityRealm>
systemctl stop jenkins systemctl start jenkins Update the plugin that is shown in the right corner of the jenkins home page
Then upgrade the jenkins and verify that no more warnings are shown. Finally copy the config.xml backup to config.xml And restart jenkins And it's done.
Upvotes: 1
Reputation: 1
This happened to me while trying to update Jenkins while having an old version of Matrix Authentication Strategy.
I was terrified of a downtime on the service (we didn't have a good staging environment). But everything went well after updating the plugin to its latest version and then updating Jenkins too.
Upvotes: 0
Reputation: 324
It happened because your config file syntax is incorrect.
sudo service jenkins stop
mv config.xml config.xml_bkp
sudo service jenkins start
this will fix it as it will create new config.xml in the jenkins directory on your master server
Upvotes: 2