更新插件角色策略插件后,jenkins不工作

rt4zxlrg  于 2022-12-17  发布在  Jenkins
关注(0)|答案(4)|浏览(168)

我使用的是jenkins 2.138.1。我已经在“管理插件”部分更新了role-based strategy,并尝试使用jenkinsurl/restart重新启动示例。它抛出以下错误,现在没有登录屏幕可见:

com.thoughtworks.xstream.mapper.CannotResolveClassException: com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategyat com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)atcom.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:379)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
        at org.jenkinsci.jruby.JRubyMapper.realClass(JRubyMapper.java:34)
        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)
    Caused: jenkins.util.xstream.CriticalXStreamException: com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy : com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
    ---- Debugging information ----
    message             : com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
    cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
    cause-message       : com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
    class               : hudson.model.Hudson
    required-type       : hudson.model.Hudson
    converter-type      : hudson.util.RobustReflectionConverter
    path                : /hudson/authorizationStrategy
    line number         : 11
    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: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)
    Caused: java.io.IOException: Unable to read /var/lib/jenkins/config.xml
        at hudson.XmlFile.unmarshal(XmlFile.java:181)
        at hudson.XmlFile.unmarshal(XmlFile.java:161)
        at jenkins.model.Jenkins.loadConfig(Jenkins.java:3005)
        at jenkins.model.Jenkins.access$1300(Jenkins.java:304)
        at jenkins.model.Jenkins$13.run(Jenkins.java:3104)
        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:1066)
        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:1100)
        at jenkins.model.Jenkins.<init>(Jenkins.java:904)
        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)
3qpi33ja

3qpi33ja1#

遇到同样的问题,解决方法是:
我关闭了Jenkins网址,因为这使它可用,但每个人都成为管理员
已备份config.xml,因为它将被清空。
$JENKINS_HOME/config.xml中,注解掉/删除了所有authorizationStrategy块,并将<useSecurity>true</useSecurity>更改为false。
已启动jenkins(正常启动,但未进行身份验证。
将config.xml更改为之前的原始版本(包括之前运行的所有安全性),并在原始角色策略配置就位的情况下正常恢复。

v8wbuo2f

v8wbuo2f2#

我有这个错误今天,在我的情况下是一个依赖性的问题,Role-based Authorization Strategy更新到v3.0,我更新了插件与Ansible jenkins_job module和Jenkins失败后重新启动.错误从浏览器是类似的,我得到了这个错误从服务器:

2020-06-10 20:02:24.483+0000 [id=29]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading plugin Role-based Authorization Strategy v3.0 (role-strategy)
java.io.IOException: Failed to load: Role-based Authorization Strategy (3.0)
 - Plugin is missing: extended-read-permission (3.2)
        at hudson.PluginWrapper.resolvePluginDependencies(PluginWrapper.java:933)
        at hudson.PluginManager$2$1$1.run(PluginManager.java:546)
        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:1133)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)

如您所见,有一个挂起的插件,似乎Ansible可以根据需要从依赖项更新插件,但不安装更新的依赖项。
设置类似的解决方案后,备份config.xml,删除安全性,安装依赖项Extended Read Permission,然后恢复配置,我能够恢复服务。

hivapdat

hivapdat3#

我得到了相同的错误(rolestrategy.RoleBasedAuthorizationStrategy)为jenkins运行在我的windows本地机器。I got the same error here

  • 转到安装Jenkins的C驱动器上的Jenkins文件夹。
  • 尝试在本地计算机中查找config.xml文件。
  • 它可能在此位置“C:\Programfiles\Jenkins\.jenkins\config.xml“或“C:\ProgramData\Jenkins\.jenkins\config.xml
  • 请记住,.jenkins文件夹是隐藏的默认情况下,在Windows机器上,所以首先取消隐藏所有的文件夹,然后进入“C:\Programfiles\Jenkins\“或“C:\ProgramData\Jenkins\
  • 我相信您将能够在上述路径中找到config.xml文件,或直接在Windows上搜索config.xml文件。
  • 一旦你找到了config.xml
  • 首先尝试备份config.xml文件并将其粘贴到某个地方,然后将其安全地保存在身边。
  • 关闭浏览器上的所有Jenkins url (Localhost:8080)
  • 现在转到windows〉在windows上搜索"Services"Please check this Image
    *搜索Jenkins和then right click on jenkins and click on STOPPlease check the image here
  • 现在转到config.xml,使用记事本打开,注解掉/删除所有<authorizationStrategy>数据块并将<useSecurity>true</useSecurity>更改为<useSecurity>false</useSecurity>
  • 保存config.xml文件
  • 再次返回Services搜索**Jenkinsstart****service
    *一米十九纳一x.
  • 已启动jenkins(正常启动,但未进行身份验证)。

将config.xml更改为之前的原始版本(包括之前运行的所有安全性),并在原始角色策略配置就位的情况下正常恢复。

最终解决!!!!!!!

scyqe7ek

scyqe7ek4#

检查/var/lib/jenkins的所有权。确保所有者是jenkins。

chown -R jenkins:jenkins /var/lib/jenkins

这解决了我的问题。

相关问题