1、更新插件替換為國內(nèi)鏡像插件源
替換原因:進(jìn)入 Manage Jenkins -》 Manage Plugin,發(fā)現(xiàn)Updates tab頁沒數(shù)據(jù),報(bào)There were errors checking the update sites: SocketTimeoutException: connect timed out錯(cuò)誤(連接更新插件源超時(shí))

問題分析:首先切換到Advanced tab頁,Advanced tab頁最下面有 Update Site 設(shè)置,看下當(dāng)前Jenkins服務(wù)配置的更新插件源為:https://updates.jenkins.io/update-center.json,然后ssh到Jenkins服務(wù)所在服務(wù)器,驗(yàn)證此服務(wù)器是否能連通當(dāng)前配置的更新插件源,經(jīng)測試網(wǎng)絡(luò)不通。

解決方案:將更新插件源替換為替換為服務(wù)器節(jié)點(diǎn)能夠連通的國內(nèi)插件源:
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
或者:
http://mirror.xmission.com/jenkins/updates/update-center.json
修改完后可以點(diǎn)擊Submit按鈕,然后點(diǎn)擊Check now檢查下,如果能重啟Jenkins服務(wù)的話點(diǎn)擊Submit按鈕后可以直接重啟下Jenkins服務(wù)。
2、maven流水線構(gòu)建報(bào)以下錯(cuò)誤
+ mvn clean deploy Error: missing `server' JVM at `/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.i386/jre/lib/i386/server/libjvm.so'. Please install or use the JRE or JDK that contains these missing components. script returned exit code 4
據(jù)項(xiàng)目組開發(fā)人員反饋,上午流水線任務(wù)構(gòu)建還正常,下午流水線構(gòu)建就報(bào)上面錯(cuò)誤了,期間并沒有修改過流水線配置、源碼里面并沒調(diào)整過JDK版本相關(guān)內(nèi)容。
解決思路:經(jīng)排查Jenkins Pod運(yùn)行正常,maven打包容器也能拉取源碼,只不過執(zhí)行mvn命令時(shí)報(bào)錯(cuò),所以基本可以排除Jenkins組件問題,于是網(wǎng)上搜索類似問題,找到類似問題文章:
adcfgclone.pl Error: missing `server' JVM at libjvm.so。

于是ssh到流水線打包節(jié)點(diǎn),經(jīng)排查操作系統(tǒng)正好是centos7.x,docker數(shù)據(jù)盤目錄掛載的數(shù)據(jù)盤文件系統(tǒng)格式正是XFS,切掛載點(diǎn)超過了1T。

解決方案:修改容器云打包節(jié)點(diǎn)到docker數(shù)據(jù)盤<1T的節(jié)點(diǎn)上,至此問題解決。
3、解決Jenkins流水線任務(wù)拉取代碼報(bào)git config File exists錯(cuò)誤
錯(cuò)誤信息:
returned status code 255:
stdout:
stderr: error: could not lock config file .git/config: File exists
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2380)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2376)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1923)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1935)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.setRemoteUrl(CliGitAPIImpl.java:1549)
at hudson.plugins.git.GitAPI.setRemoteUrl(GitAPI.java:161)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:357)
at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:330)
at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:396)
at jenkins.scm.api.SCMSource.fetch(SCMSource.java:582)
at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:100)
at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)
at hudson.model.ResourceController.execute(ResourceController.java:99)
at hudson.model.Executor.run(Executor.java:432)
Finished: FAILURE
解決方案:
到Jenkins數(shù)據(jù)目錄查找,可以發(fā)現(xiàn)在Jenkins安裝目錄下有個(gè)caches目錄
/var/jenkins_home/caches/git-762b1469bb9de7658adbaec8d8b12877/.git/config ...... /var/jenkins_home/caches/git-6dff59f087b2f03588f3905a47012c3c/.git/config /var/jenkins_home/caches/git-259c3ec0c808380e583d66552ba73d06/.git/config /var/jenkins_home/caches/git-08f22672d5e50dba23f07dcd52f3100d/.git/config /var/jenkins_home/caches/git-ee60fb5e6f1859e7ee4717f127258a34/.git/config /var/jenkins_home/.config/jgit/config
在某個(gè)git-xxx目錄里面有.git/config文件和.git/config.lock文件,刪除config.lock文件即可
find / -name "config.lock" -type f rm xxx.xxx/config.lock
4、maven流水線構(gòu)建報(bào)unable to allocate file descriptoe table - out of ....錯(cuò)誤
錯(cuò)誤信息:

解決方案:
1)先檢查Jenkins打包節(jié)點(diǎn)文件句柄數(shù)配置
ulimit-n
如果值過小,通過以下命令進(jìn)行配置
ci節(jié)點(diǎn)配置limit: echo "* soft nofile 65535" >>/etc/security/limits.conf echo "* hard nofile 65535" >>/etc/security/limits.conf ulimit -n 65535
2)檢查Jenkins打包節(jié)點(diǎn)docker服務(wù)句柄數(shù)配置
docker服務(wù)配置文件配置limit
/usr/lib/systemd/system/docker.service --default-ulimit nofile=65535:65535

重啟docker服務(wù)
systemctl daemon-reload systemctl restart docker
鏈接:https://www.cnblogs.com/zhangmingcheng/p/16206435.html
-
服務(wù)器
+關(guān)注
關(guān)注
14文章
10251瀏覽量
91480 -
開源
+關(guān)注
關(guān)注
3文章
4204瀏覽量
46130 -
鏡像
+關(guān)注
關(guān)注
0文章
180瀏覽量
11642 -
jenkins
+關(guān)注
關(guān)注
0文章
34瀏覽量
5485
原文標(biāo)題:Jenkins常見問題解決
文章出處:【微信號:magedu-Linux,微信公眾號:馬哥Linux運(yùn)維】歡迎添加關(guān)注!文章轉(zhuǎn)載請注明出處。
發(fā)布評論請先 登錄
labview有哪些常見問題?labview三個(gè)常見問題和解決方法概述
互感器常見問題的預(yù)防和解決方案
3C鋰電池pack測試常見問題分析和解決方案
Brocade存儲(chǔ)擴(kuò)展解決方案常見問題
Jenkins常見問題分析和解決方案
評論