原因: hudson.plugins.git.GitException: コマンド「git fetch --tags --progress -- https://github.

1. 問題の説明:

最近は Java 開発に取り組んでいたので cicd をあまりやっていなかったのですが、急に自分のプロジェクトを始めたくなったので jenkins を実行したのですが、元のジョブの実行に失敗し、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

2. 問題分析:

まず、Jenkins でグローバル認証情報を更新しましたが、結果はまだ取得できませんでした。ふと思ったのですが、8 月に github が新しい検証ポリシーを発行し、アカウントのパスワード検証がサポートされなくなり、アクセス トークンが使用されました。そこで認証コードを変更してみたところ、うまくいきました。

3. 問題解決

1. GitHub でトークンを生成する

2. 後で使用できる 2 つの方法

1 つ目: Jenkins のグローバル認証情報構成にユーザー名とパスワードの認証情報を追加できます。ユーザー名は気軽に記述でき、パスワードは保存されたトークンに入力できます。

2 番目の方法: git の URL にトークンを書き込みます。認証情報は必要ありません。

 

 

 

 

 

おすすめ

転載: blog.csdn.net/yiye2017zhangmu/article/details/120556053