java.io.IOException: Unable to read /data/jenkins/config.xml

背景

需要更新jenkins的某個插件,安裝準備重啓時,報錯了,具體報錯如下:

# 只放上相關錯誤
java.io.IOException: Unable to read /data/jenkins/config.xml

Caused: jenkins.util.xstream.CriticalXStreamException: hudson.security.ProjectMatrixAuthorizationStrategy : hudson.security.ProjectMatrixAuthorizationStrategy

---- Debugging information ----
message             : hudson.security.ProjectMatrixAuthorizationStrategy
cause-exception     : com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message       : hudson.security.ProjectMatrixAuthorizationStrategy
class               : hudson.model.Hudson
required-type       : hudson.model.Hudson
converter-type      : hudson.util.RobustReflectionConverter
path                : /hudson/authorizationStrategy
line number         : 12
version             : not available

解決過程

看報錯是權限的問題,百度谷歌了一圈,有個類似的答案是說:在plugins下的matrix-auth…這個文件夾是空的,需要刪除config.xml後就可以進jenkins了,然後再去插件管理裏安裝matrix-auth即可。

但是我看了下plugins/matrix-auth下的WEBINFO裏是有東西的。並不爲空。我看到在plugins下很多*.disabled的文件,網上說,安裝一個插件就會在plugins下新建一個文件夾和插件同名的文件。如果禁用插件,就會生成一個:..jpi.disabled 文件來標誌該插件禁用。
在這裏插入圖片描述
可能是因爲有些插件禁用的原因(至於爲什麼禁用,我不確定但是更新插件是否有亂點到),於是我通過命令把這個後綴爲disabled的文件刪除了ls *.disabled | xargs rm -f.刪除後,再次重啓jenkins就進入了。

最後重啓jenkins我發現也有個坑。這臺服務器上有好多jenkis.一開始我用service jenkins restart 後沒有生效,我就stop了,但是發現服務還能通過url訪問。說明我stop的並非是這個。後來通過全局搜索Jenkins.war文件,原來Jenkins放在了tomcat下的webapps,那就簡單了,重啓tomcat後,就生效了!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章