詹金斯无法读取config.xml:hudson.security.GlobalMatrixAuthorizationStrategy hudson.security.LDAPSecurityRealm

时间:2019-03-30 07:38:31

标签: jenkins

使用Jenkins 2.169

今天Jenkins服务器突然失败,并出现以下错误:

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

发现罪魁祸首是两个缺少的插件:     matrix-auth     ldap

我可以通过手动从另一台服务器复制插件来恢复Jenkins。复制的文件:

jenkins/home/plugins/matrix-auth
jenkins/home/plugins/matrix-auth.jpi
jenkins/home/plugins/ldap
jenkins/home/plugins/ldap.jpi

首先,我安装了matrix-auth。然后出现以下错误,表明ldap也存在问题:

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
-------------------------------

经过进一步调查,发现许多插件被删除了(另外,我发现了罪魁祸首,它与Jenkins无关)。因此,解决方案的一部分是从另一个Jenkins服务器复制整个插件目录。

0 个答案:

没有答案
相关问题