対応するプラグインを使用してgitリポジトリをクローンするJenkinsを設定しようとしています。資格情報を使用しているときにJenkins git認証が失敗する
しかし、私は理由はわかりませんが、認証しようとすると失敗します。
Iはジェンキンスを介して認証情報を定義しようとしたが、それは失敗:
Building in workspace /var/lib/jenkins/workspace/CLARA
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://hola.int/git-repos/ # timeout=10
Fetching upstream changes from https://hola.int/git-repos/
> /usr/bin/git --version # timeout=10
using GIT_ASKPASS to set credentials Access to CLARA
Setting http proxy: proxy.es:80
> /usr/bin/git fetch --tags --progress https://hola.int/git-repos/ +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://hola.int/git-repos/
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1729)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress https://hola.int/git-repos/ +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: Authentication failed for 'https://hola.int/git-repos/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
... 11 more
Iはまた、資格情報を空にし、ユーザーが挙げ/リポジトリにgitのパスを渡す残すことを試みたが、それはまた失敗:
Building in workspace /var/lib/jenkins/workspace/CLARA
> /usr/bin/git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> /usr/bin/git config remote.origin.url https://XXXX:[email protected]/git-repos/ # timeout=10
Fetching upstream changes from https://[email protected]/git-repos/
> /usr/bin/git --version # timeout=10
Setting http proxy: proxy.es:80
> /usr/bin/git fetch --tags --progress https://[email protected]/git-repos/ +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://[email protected]/git-repos/
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:803)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1063)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1094)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1278)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:604)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
at hudson.model.Run.execute(Run.java:1729)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: hudson.plugins.git.GitException: Command "/usr/bin/git fetch --tags --progress https://[email protected]/git-repos/ +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout:
stderr: fatal: Authentication failed for 'https://[email protected]/git-repos/'
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1745)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1489)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:64)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:315)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:801)
... 11 more
しかし、私がジェンキンスノードのリポジトリを自分で複製しようとすると、それは動作します。ジェンキンスは何をしているのですか:
git config --global http.proxy http://proxy.es:80
/usr/bin/git fetch --tags --progress https://[email protected]/git-repos/ +refs/heads/*:refs/remotes/origin/*
私はパスワードを尋ねて失敗することなく続けます。パスを使用して
も動作します:
git config --global http.proxy http://proxy.es:80
/usr/bin/git fetch --tags --progress https://XXXX:[email protected]/git-repos/ +refs/heads/*:refs/remotes/origin/*
マイネットは、プロキシの下にあります。しかし、私は既にJenkinsにプロキシの詳細を含めておき、gitプラグインはそれを使用することになっています。
ジェンキンスのバージョンは2.37で、gitプラグイン3.0.1です。
ビルドは、Dockerプラグインを使用してDockerコンテナ内で行われます。しかし、私はそれが重要ではないと思う。私はドッカーなしで同じ問題を抱えています。私が前にチェックしたのは、ドッカーの画像にコンテナを作成して、ジェンキンスのことを正確に再現することでした。
ご協力いただきありがとうございます。
デバッグが難しい。しかし、http://だけでなく、git pluginにもhttps_proxy = http://proxy.es:80を指定する必要があります。ただし、失敗した認証エラーは変です。 – lvthillo
ありがとうございますが、gitプラグインのプロキシオプションを指定する方法がわかりません。 – cardogar
事務所の代理人の問題であったため、投稿が閉鎖されました。 –