Jenkins 升级失败

一、Jenkins 升级失败

  • 一次性更新几十个插件导致挂了

1.1、错误信息

java.lang.IllegalStateException: An attempt to save the global configuration was made before it was loaded
    at jenkins.model.Jenkins.save(Jenkins.java:3379)
    at jenkins.model.Jenkins.saveQuietly(Jenkins.java:3398)
    at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2637)
    at jenkins.model.Jenkins$16.run(Jenkins.java:3342)
    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:1129)
    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:68)
    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:745)
Caused: org.jvnet.hudson.reactor.ReactorException
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:1162)
    at jenkins.model.Jenkins.<init>(Jenkins.java:962)
    at hudson.model.Hudson.<init>(Hudson.java:85)
    at hudson.model.Hudson.<init>(Hudson.java:81)
    at hudson.WebAppMain$3.run(WebAppMain.java:295)
Caused: hudson.util.HudsonFailedToLoad
    at hudson.WebAppMain$3.run(WebAppMain.java:312)

1.2、解决办法

  • 此操作将临时将管理角色分配给匿名用户(改为会变成匿名账号,非常不安全)
# 编辑文件
vim /var/lib/jenkins/config.xml
# 删除
<authorizationStrategy class="com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy">
    [...]
    <role name="admin" pattern=".*">
    <permissions>
        [...]
    </permissions>
    <assignedSIDs>
        <sid>anonymous</sid>
        [...]
    </assignedSIDs>
    </role>
    [...]
</authorizationStrategy>

1.3、重新配置安全

1) 系统管理/全局安全配置/授权策略

1.4、重启 Jenkins

版权声明:
作者:Akiraka
链接:https://www.akiraka.net/linux/1323.html
来源:Akiraka
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
海报
Jenkins 升级失败
一、Jenkins 升级失败 一次性更新几十个插件导致挂了 1.1、错误信息 java.lang.IllegalStateException: An attempt to save the global configuration was m……
<<上一篇
下一篇>>
文章目录
关闭
目 录