title: Jenkins unable to read config.xml: hudson.security.GlobalMatrixAuthorizationStrategy hudson.security.LDAPSecurityRealm
body: <p>Using Jenkins 2.169</p>
  
  <p>A Jenkins server suddenly failed today with the following error:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Found out that the culprit were two missing plugins:
      <code>matrix-auth</code>
      <code>ldap</code></p>
  
  <p>I could recover Jenkins, by manually copying the plugins from another server. Files copied:</p>
  
  <pre><code>jenkins/home/plugins/matrix-auth
  jenkins/home/plugins/matrix-auth.jpi
  jenkins/home/plugins/ldap
  jenkins/home/plugins/ldap.jpi
  </code></pre>
  
  <p>First, I installed matrix-auth. Then I got the following error that indicated that ldap was also having issues:</p>
  
  <pre><code>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
  -------------------------------
  </code></pre>
  
  <p>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.</p>