首页 > 其他分享 >jenkins启动报错:Failed Loading global config

jenkins启动报错:Failed Loading global config

时间:2024-01-17 10:23:03浏览次数:41  
标签:Loading java global xstream 报错 jenkins hudson com thoughtworks

jenkins启动报错:Failed Loading global config

 

问题起因:

  想在构建项目中使用复选框(Extended Choice Parameter),需要安装Extended Choice Parameter插件,但是因为版本过低的原因,导致插件无法正常安装。然后根据提示,就在jenkins的web页面进行了自动升级。

  但是在升级过程中,平台就挂掉了,去jenkins服务器上去查看日志,发现是因为升级后,jdk的版本不匹配jenkins的版本导致,这里也是个坑,自动升级平台时没有去检查JDK版本的问题。

  更换了jdk版本后,jenkins任然无法正常启动,报错:

2024-01-16 10:09:50.556+0000 [id=34]    SEVERE  jenkins.InitReactorRunner$1#onTaskFailed: Failed Loading global config
com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.security.GlobalMatrixAuthorizationStrategy
        at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:411)
        at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:46)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
        at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:521)
        at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:346)
Caused: jenkins.util.xstream.CriticalXStreamException:
---- Debugging information ----
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         : 8
version             : not available
-------------------------------
        at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:381)
        at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:289)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1421)
        at hudson.util.XStream2.unmarshal(XStream2.java:189)
        at hudson.util.XStream2.unmarshal(XStream2.java:160)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1399)
        at hudson.XmlFile.unmarshal(XmlFile.java:196)
Caused: java.io.IOException: Unable to read /root/.jenkins/config.xml
        at hudson.XmlFile.unmarshal(XmlFile.java:199)
        at hudson.XmlFile.unmarshal(XmlFile.java:179)
        at jenkins.model.Jenkins.loadConfig(Jenkins.java:3296)
        at jenkins.model.Jenkins.access$1200(Jenkins.java:340)
        at jenkins.model.Jenkins$12.run(Jenkins.java:3398)
        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1158)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        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)
2024-01-16 10:09:50.563+0000 [id=21]    SEVERE  hudson.util.BootFailure#publish: Failed to initialize Jenkins
com.thoughtworks.xstream.mapper.CannotResolveClassException: hudson.security.GlobalMatrixAuthorizationStrategy
        at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:81)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:411)
        at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:46)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:125)
        at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:47)
        at hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:521)
        at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:346)
Caused: jenkins.util.xstream.CriticalXStreamException:
---- Debugging information ----
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         : 8
version             : not available
-------------------------------
        at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:381)
        at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:289)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:74)
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:68)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:52)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1421)
        at hudson.util.XStream2.unmarshal(XStream2.java:189)
        at hudson.util.XStream2.unmarshal(XStream2.java:160)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1399)
        at hudson.XmlFile.unmarshal(XmlFile.java:196)
Caused: java.io.IOException: Unable to read /root/.jenkins/config.xml
        at hudson.XmlFile.unmarshal(XmlFile.java:199)
        at hudson.XmlFile.unmarshal(XmlFile.java:179)
        at jenkins.model.Jenkins.loadConfig(Jenkins.java:3296)
        at jenkins.model.Jenkins.access$1200(Jenkins.java:340)
        at jenkins.model.Jenkins$12.run(Jenkins.java:3398)
        at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:175)
        at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:305)
        at jenkins.model.Jenkins$5.runTask(Jenkins.java:1158)
        at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:222)
        at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:121)
        at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
        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:291)
        at jenkins.InitReactorRunner.run(InitReactorRunner.java:49)
        at jenkins.model.Jenkins.executeReactor(Jenkins.java:1193)
        at jenkins.model.Jenkins.<init>(Jenkins.java:983)
        at hudson.model.Hudson.<init>(Hudson.java:86)
        at hudson.model.Hudson.<init>(Hudson.java:82)
        at hudson.WebAppMain$3.run(WebAppMain.java:247)
Caused: hudson.util.HudsonFailedToLoad
        at hudson.WebAppMain$3.run(WebAppMain.java:264)

 

解决方法:

备份/root/.jenkins/config.xml文件,然后将/root/.jenkins/config.xml文件中的<authorizationStrategy>和 <useSecurity>这2个标签删掉,然后重启。

 

总结:

  因为在平时正常的操作中,很可能会忽略其他可能发生的问题,第一个是升级jenkins平台后它所依赖的JDK版本问题,第二个问题应该是个坑,平台自动升级了后会出现配置读取的问题。

  如果要升级或者迁移jenkins,首先要备份jenkins版本信息或者程序包,还要备份/root/.jenkins/目录,然后要注意JDK的版本问题。

 

  官方提供的JDK版本与jenkins版本兼容的信息,可以参考。

https://www.jenkins.io/doc/book/platform-information/support-policy-java/

 

标签:Loading,java,global,xstream,报错,jenkins,hudson,com,thoughtworks
From: https://www.cnblogs.com/NanZhiHan/p/17969251

相关文章

  • loading改用react hooks
    //子组件importReact,{useState,useEffect}from'react';import{Modal}from'antd';constChildComponent=({onCancel})=>{const[loading,setLoading]=useState(true);//useEffect监听父组件取消事件useEffect(()=>{......
  • git pull 报错:ssh: connect to host github.com port 22: Connection timed out
    在执行gitpull时提示错误:ssh:connecttohostgithub.comport22:Connectiontimedout解决方案:添加config文件vim~/.ssh/config添加如下内容Hostgithub.comHostnamessh.github.comPort443ssh:connecttohostgithub.comport22:Connectionti......
  • Elasticsearch索引不存在时,查询接口报错怎么办?
    1、索引不存在,报错:type=index_not_found_exception,reason=nosuchindex解决办法:DSL:GET/text_index_003/_search?ignore_unavailable=truejava代码:NativeSearchQuerysearchQuery=newNativeSearchQueryBuilder().withIndicesOptions(IndicesOpti......
  • vscode报错Pylance client: couldn‘t create connection to server.解决
    问题描述:一打开vscode,右下角就弹报错,Pylanceclient:couldn’tcreateconnectiontoserver.,让我打开output,打开后似乎是在说连不上server因为连不上server,所以我的python代码没法解析,尝试重开vscode也没用问题解决:点开左侧的拓展,找到PythonExtensionPack,这就是解析python代......
  • git 提交报错
    这个问题是因为当你在终端输入gitcommit-m“XXX”,提交代码的时候,pre-commit(客户端)钩子,它会在Git键入提交信息前运行做代码风格检查。如果代码不符合相应规则,则报错,而它的检测规则就是根据.git/hooks/pre-commit文件里面的相关定义。解决方法(三种)1、第一种卸载husky。只要......
  • Elastic实战:彻底解决spring-data-elasticsearch日期、时间类型数据读取报错问题
    0.引言在使用spring-data-elasticsearch读取es中时间类型的数据时出现了日期转换报错,不少初学者会在这里困惑很久,所以今天我们专门来解读该问题的几种解决方案。1.问题分析该问题的报错形式一般是:Failedtoconvertfromtype[java.lang.String]totype[java.util.Date]f......
  • CentOS7 报错 ”Repository base is listed more than once in the configuration...
    CentOS7在使用yum时出现以下错误:RepositorybaseislistedmorethanonceintheconfigurationRepositoryupdatesislistedmorethanonceintheconfigurationRepositoryextrasislistedmorethanonceintheconfigurationRepositorycentosplusislistedmore......
  • 安装torch2trt中遇到的报错:ModuleNotFoundError: No module named 'torch2trt.flatten
    这一个报错折腾了一整天,在这里记录一下方便他人可以快速解决问题:首先说明一下本人的版本情况:Linux系统CUDA:11.8Python:3.8torch:2.0.0torchvision:0.15.0代码中报错的位置是:fromtorch2trtimporttorch2trt报错的原因是:ModuleNotFoundError:Nomodulenamed'torch2trt......
  • Unity报错记录->ArgumentNullException: Value cannot be null. Parameter name: _uni
    问题描述项目报错ArgumentNullException:Valuecannotbenull.Parametername:_unity_self不会影响项目正常运行,但是在DeBug模式下会一直卡住,非常恶心。解决方法删除项目中的Library文件夹,重新加载项目......
  • Encountered fatal error while reloading routing: Routing trace file does not mat
      efinity编译在routersetup时候报错Encounteredfatalerrorwhilereloadingrouting:Routingtracefiledoesnotmatchnetlist(netlistnetcount24888v.tracenetcount0).  解决方案:检查客户工程的PNR页面。beneficialskew页面是否打开,如果是on状态,试......