记录jenkins的一个错误

本文记录了在使用Jenkins过程中遇到的一个错误,即需要升级Git到最新版本,并且强调了在Shell脚本中if条件语句前后必须添加空格,这是避免语法错误的关键。
Started by user admin
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/test-freestyle-job
using credential 490bf1fb-1a57-4c22-872f-8eed4adafce0
 > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/local/git/bin/git config remote.origin.url https://gitlab.example.com/root/nice-bbs.git # timeout=10
Fetching upstream changes from https://gitlab.example.com/root/nice-bbs.git
 > /usr/local/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > /usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://gitlab.example.com/root/nice-bbs.git
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1123)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159)
	at hudson.scm.SCM.checkout(SCM.java:505)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1205)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
	at hudson.model.Run.execute(Run.java:1853)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:427)
Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://gitlab.example.com/root/nice-bbs.git/': Peer's certificate issuer has been marked as not trusted by the user.

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2043)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:568)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:906)
	... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE
Started by user admin
Running as SYSTEM
Building in workspace /root/.jenkins/workspace/test-freestyle-job
using credential 490bf1fb-1a57-4c22-872f-8eed4adafce0
 > /usr/local/git/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > /usr/local/git/bin/git config remote.origin.url https://gitlab.example.com/root/nice-bbs.git # timeout=10
Fetching upstream changes from https://gitlab.example.com/root/nice-bbs.git
 > /usr/local/git/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials 
 > /usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/* # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://gitlab.example.com/root/nice-bbs.git
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:908)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1123)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1159)
	at hudson.scm.SCM.checkout(SCM.java:505)
	at hudson.model.AbstractProject.checkout(AbstractProject.java:1205)
	at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:574)
	at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:499)
	at hudson.model.Run.execute(Run.java:1853)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:427)
Caused by: hudson.plugins.git.GitException: Command "/usr/local/git/bin/git fetch --tags --progress https://gitlab.example.com/root/nice-bbs.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to access 'https://gitlab.example.com/root/nice-bbs.git/': Peer's certificate issuer has been marked as not trusted by the user.

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2429)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2043)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:80)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:568)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:906)
	... 11 more
ERROR: Error fetching remote repo 'origin'
Finished: FAILURE

 

 

需要升级git版本,还有shell的if前后都需要空格

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值