詹金斯版本:詹金斯版。 2.32.1 Google登录插件版本:1.3
重新启动詹金斯后出现此错误,有人可以建议我如何解决吗?
问题是:
-我已经确保在plugins目录中启用了google-login插件
-我没有更改插件上的任何内容,只是直接重启
-自从重新启动詹金斯以来已经很久了
hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
at hudson.WebAppMain$3.run(WebAppMain.java:248)
Caused by: org.jvnet.hudson.reactor.ReactorException: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
at jenkins.InitReactorRunner.run(InitReactorRunner.java:47)
at jenkins.model.Jenkins.executeReactor(Jenkins.java:1110)
at jenkins.model.Jenkins.<init>(Jenkins.java:926)
at hudson.model.Hudson.<init>(Hudson.java:85)
at hudson.model.Hudson.<init>(Hudson.java:81)
at hudson.WebAppMain$3.run(WebAppMain.java:231)
Caused by: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
at hudson.XmlFile.unmarshal(XmlFile.java:161)
at jenkins.model.Jenkins.loadConfig(Jenkins.java:3015)
at jenkins.model.Jenkins.access$1100(Jenkins.java:326)
at jenkins.model.Jenkins$16.run(Jenkins.java:3033)
at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:1086)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:748)
Caused by: jenkins.util.xstream.CriticalXStreamException: org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm : org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm
---- Debugging information ----
message : org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm
cause-exception : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm
class : hudson.model.Hudson
required-type : hudson.model.Hudson
converter-type : hudson.util.RobustReflectionConverter
path : /hudson/securityRealm
line number : 485
version : not available
-------------------------------
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:356)
at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:270)
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:114)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1173)
at hudson.XmlFile.unmarshal(XmlFile.java:159)
... 11 more
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException: org.jenkinsci.plugins.googlelogin.GoogleOAuth2SecurityRealm
at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:282)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:43)
at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:48)
at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:461)
at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:327)
... 22 more
答案 0 :(得分:0)
可能值得检查import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-child',
templateUrl: './child.component.html',
styleUrls: ['./child.component.css']
})
export class ChildComponent implements OnInit {
@Input('parentComponentData') parentComponentData: string;
@Output() onHit: EventEmitter<string> = new EventEmitter<string>();
constructor() { }
ngOnInit() {
}}
的umask
答案 1 :(得分:0)
今天,我在将詹金斯从2.176.1
升级到2.176.2
时遇到了类似的问题。升级本身并不是问题; 是插件。
您的帖子仅包含日志文件的一部分,但就我而言,我发现了一些指向插件的条目,它们是导致问题的原因。 日志中的重要数据是:
[...]
Jul 17, 2019 10:13:53 AM jenkins.InitReactorRunner$1 onTaskFailed
SEVERE: Failed Loading plugin SAML Plugin v1.1.2 (saml)
java.io.IOException: SAML Plugin version 1.1.2 failed to load.
- bouncycastle-api version 2.16.0 is older than required. To fix, install version 2.16.1 or later.
[...]
以及其他格式相似且传达相似信息的其他条目。
我的系统有一些带有待定更新的插件。升级服务(例如apt upgrade jenkins
等)时,通常会在该过程中重启服务。重新启动才是问题的根源,表明某些插件无法加载,因为它们现在需要更多的最新依赖项。
这些插件不会简单地导致错误记录:它们会引发异常。 Jenkins似乎不准备处理它们,并且崩溃了。访问Jenkins主页,将显示大量的堆积痕迹。
收获是,为了正确升级插件,您需要Jenkins正常运行,但是有问题的插件 prevent Jenkins不能使用首先需要的运行状态。
有几个目标:
请牢记或尝试 进入下一部分的几点:
/var/lib/jenkins/
下,并且其config.xml
文件位于此目录下。在继续之前,为此config.xml
文件创建备份!config.xml
的日志消息是伪造的;实际上, 试图说的是,当它尝试加载在那里指定的SAML Java类时,它失败了。sudo apt-get install jenkins=2.176.1
进行降级将解决此问题,但并非如此。就我而言,主要的犯罪者是上面显示的SAML插件,因为它控制了我以管理员身份登录的能力。由于我使用SAML 2.0将auth与Okta集成,因此我的config.xml
文件具有以下节点:
<securityRealm class="org.jenkinsci.plugins.saml.SamlSecurityRealm" plugin="saml@1.1.2">
[...]
</securityRealm>
从文件中删除此部分(还记得备份吗?),导致Jenkins停止尝试加载与SAML相关的Java类,这使它在我的情况下可以启动。但是,由于Okta集成(现在不存在),因此在重新启动服务后无法登录。
安全警告: 在我的情况下,此方法有效 ,因为我在公司防火墙后面,而该工具不能 >可从公司外部访问。如果您的Jenkins实例可以通过Internet访问,请 不要这样做,并找到其他方法! 。请考虑至少暂时禁止对服务器的Internet访问(例如,删除端口-解决问题时转发规则等)。 (这假设您与服务器位于同一局域网中,这样就不会切断自己的访问权限。)
就我而言,身份验证是Okta集成(即,用于访问)和Jenkins中基于角色的身份验证之间的组合,存储在config.xml
文件中。如果听起来像您,您应该有类似的内容:
<authorizationStrategy class="com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy">
[...]
<role name="admin" pattern=".*">
<permissions>
<permission>hudson.model.View.Delete</permission>
<permission>hudson.model.Computer.Connect</permission>
[...]
</permissions>
<assignedSIDs>
<sid>anonymous</sid>
[...]
</assignedSIDs>
</role>
[...]
</authorizationStrategy>
如上所示,我 临时 在<sid>anonymous</sid>
角色下添加了admin
条目。这将允许您以匿名管理员的身份临时访问您的Jenkins实例。
在此之后重新启动Jenkins服务(例如sudo systemctl restart jenkins.service
)。现在,您可以进入管理Jenkins >>管理插件部分并强制进行更新。在下载插件后,选中复选框以重新启动Jenkins,以确保它们已安装。
这时,您应该还原原始的config.xml
(例如sudo mv config.xml.backup config.xml
),然后重新启动Jenkins服务。这样做会撤消前面各节中指定的更改,无论如何,您都应该恢复到原始配置。
答案 2 :(得分:0)
我在jenkins网页而不是登录页面上遇到了同样的错误。我之所以这样,是因为我想一次更新我的Jenkins版本2.73.3上的所有插件。
和您一样,重新启动系统也无济于事。
所以我看了看日志,它们看起来很相似:
oct. 22, 2019 9:41:14 AM jenkins.InitReactorRunner$1 onTaskFailed
GRAVE: Failed Loading plugin Credentials Plugin v2.3.0 (credentials)
java.io.IOException: Credentials Plugin v2.3.0 failed to load.
- You must update Jenkins from v2.73.3 to v2.138.4 or later to run this plugin.
- Structs Plugin v1.20 failed to load. Fix this plugin first.
at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:626)
一个小细节:对我来说,由于Jenkins版本太旧,插件无法更新。与接受的解决方案中的日志完全相反。
所以我决定先更新詹金斯
sudo apt-get update
sudo apt-get install jenkins # Say N to overwrite the config.
我又得到了Jenkins,但不是所有插件:尽管服务器已启动并正在运行,但某些监视作业仍然出错。
因此,我决定在“管理”页面中重新启动插件更新(以便与jenkins的版本同步),我重新启动了对更新的搜索,并获取了所有兼容的更新。安装并重新启动后,所有操作终于恢复正常。
我认为添加此代码以完成可接受的解决方案很重要,因为您不必对config.xml进行危险的修改。