栏目分类:
子分类:
返回
终身学习网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
终身学习网 > IT > 软件开发 > 后端开发 > Java

Caused by: hudson.plugins.git.GitException: Command “git fetch --tags --progress -- https://github.

Java 更新时间:发布时间: 百科书网 趣学号
一.问题描述:

由于最近一直在搞java开发,没怎么搞cicd了,突然想搞搞自己的项目,所以跑了一下jenkins,却发现原来搭好的job执行失败,GitHub上面的代码拉不下来

ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/xxx.git
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:996)
	at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1237)
	at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1297)
	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
	at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	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 by: hudson.plugins.git.GitException: Command "git fetch --tags --progress --  https://github.com/xxx.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: fatal: unable to access ' https://github.com/xxx.git/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2450)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2051)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84)
	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:573)
	at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:994)
	... 11 more
二.问题分析:

首先我更新了一下Jenkins里面的全局凭据,但是结果还是拉取不了,突然想到八月份github出了新的验证政策,不再支持账号密码验证,采用access tokens的方式。所以换授权码试了一下,果然可以

三.问题解决

1.在GitHub生成token

2.后面可以采用两种方式

第一种:可以在Jenkins全局凭据配置中,增加一个username-password凭据,用户名可以随便写,密码输入保存好的token

第二种: 将token写入git的url里面,就不需要凭据了

 

 

 

 

 

转载请注明:文章转载自 www.051e.com
本文地址:http://www.051e.com/it/275921.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 ©2023-2025 051e.com

ICP备案号:京ICP备12030808号