一千萬個為什麽

搜索

使用“hudson.util.HudsonFailedToLoad:org.jvnet.hudson.reactor.ReactorException”重啟後,Jenkins無法啟動



一周前我不得不重新啟動我們的詹金斯,我是通過“jenkins url”/ restart這樣做的。首先它被卡在“請等待詹金斯重新啟動”之類的...... 1.5天,所以我認為出了問題。

我排除故障並重新啟動服務(守護程序)本身作為這個帖子建議。手動重啟之後,jenkins頁面吐出了這個錯誤

    hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.RuntimeException: Unable to read history for build2
    at hudson.WebAppMain$3.run(WebAppMain.java:239)
Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.RuntimeException: Unable to read history for build2
    at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
    at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
    at jenkins.model.Jenkins.executeReactor(Jenkins.java:969)
    at jenkins.model.Jenkins.(Jenkins.java:850)
    at hudson.model.Hudson.(Hudson.java:85)
    at hudson.model.Hudson.(Hudson.java:81)
    at hudson.WebAppMain$3.run(WebAppMain.java:227)
Caused by: java.lang.RuntimeException: Unable to read history for build2
    at hudson.plugins.jobConfigHistory.FileHistoryDao.getRevisions(FileHistoryDao.java:748)
    at hudson.plugins.jobConfigHistory.FileHistoryDao.hasDuplicateHistory(FileHistoryDao.java:804)
    at hudson.plugins.jobConfigHistory.ComputerHistoryListener.onChange(ComputerHistoryListener.java:94)
    at hudson.plugins.jobConfigHistory.ComputerHistoryListener.onConfigurationChange(ComputerHistoryListener.java:52)
    at hudson.model.AbstractCIBase.updateComputerList(AbstractCIBase.java:209)
    at jenkins.model.Jenkins.updateComputerList(Jenkins.java:1293)
    at jenkins.model.Nodes$7.run(Nodes.java:304)
    at hudson.model.Queue._withLock(Queue.java:1312)
    at hudson.model.Queue.withLock(Queue.java:1189)
    at jenkins.model.Nodes.load(Nodes.java:295)
    at jenkins.model.Jenkins$17.run(Jenkins.java:2739)
    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$8.runTask(Jenkins.java:958)
    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:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Unable to read /Users/Shared/Jenkins/Home/config-history/nodes/build2/2018-06-13_11-41-13/history.xml
    at hudson.XmlFile.read(XmlFile.java:144)
    at hudson.plugins.jobConfigHistory.FileHistoryDao.getRevisions(FileHistoryDao.java:746)
    ... 18 more
Caused by: com.thoughtworks.xstream.io.StreamException:  : only 1.0 is supported as <?xml version not '1.1' (position: START_DOCUMENT seen <?xml version=\'1.1\'... @1:19) 
    at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
    at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:103)
    at com.thoughtworks.xstream.io.xml.XppReader.(XppReader.java:63)
    at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:54)
    at com.thoughtworks.xstream.io.xml.AbstractXppDriver.createReader(AbstractXppDriver.java:65)
    at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1053)
    at hudson.XmlFile.read(XmlFile.java:142)
    ... 19 more
Caused by: org.xmlpull.v1.XmlPullParserException: only 1.0 is supported as <?xml version not '1.1' (position: START_DOCUMENT seen <?xml version=\'1.1\'... @1:19) 
    at org.xmlpull.mxp1.MXParser.parseXmlDeclWithVersion(MXParser.java:2608)
    at org.xmlpull.mxp1.MXParser.parseXmlDecl(MXParser.java:2592)
    at org.xmlpull.mxp1.MXParser.parsePI(MXParser.java:2466)
    at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1447)
    at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
    at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
    at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
    ... 28 more

我想這與奴隸沒有正確重新啟動有關但我不確定,有沒有人有任何猜測我的下一步應該是什麽?我已經刪除了jenkins的所有插件無濟於事。我也嘗試通過Java啟動jenkins.war文件,但它只是說putty無法啟動和中止。 jenkins在MAC上運行

對不起,如果解決方案非常明顯,我對Jenkins沒有那麽多經驗。謝謝!

轉載註明原文: 使用“hudson.util.HudsonFailedToLoad:org.jvnet.hudson.reactor.ReactorException”重啟後,Jenkins無法啟動

一共有 1 個回答:

So I feel stupid now, but I solved it. I took another look at the error and found Caused by: java.io.IOException: Unable to read /Users/Shared/Jenkins/Home/config-history/nodes/build2/2018-06-13_11-41-13/history.xml at hudson.XmlFile.read(XmlFile.java:144)

我去了文件,發現第一行說 <�?xml version ='1.1'coding ='UTF-8'?> 。我也註意到錯誤信息說

Caused by: org.xmlpull.v1.XmlPullParserException: only 1.0 is supported as <?xml version not '1.1' (position: START_DOCUMENT seen <?xml version=\'1.1\'... @1:19) 
    at org.xmlpull.mxp1.MXParser.parseXmlDeclWithVersion(MXParser.java:2608)

我將 <�?xml version ='1.1> 更改為 <�?xml version ='1.0> ,保存文件並重新啟動jenkins使用

sudo launchctl stop org.jenkins-ci
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist