-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
-
4.3.0
After recent changes on our corporate proxy server jobs that use 'checkout' step to clone git repositories started to fail during Git LFS pull with the following error:
stderr: batch response: Post https://github.com/openvinotoolkit/openvino.git/info/lfs/objects/batch: Proxy Authentication Required
Pipeline code I use to clone this repo:
checkout changelog: false, poll: false, scm: [$class: 'GitSCM', branches: [[name: '*/master']], extensions: [[$class: 'GitLFSPull']], userRemoteConfigs: [[credentialsId: 'xxx', url: 'https://github.com/openvinotoolkit/openvino.git']]]
Logs I receive:
17:35:33 The recommended git tool is: NONE 17:35:34 using credential xxx 17:35:34 Cloning the remote Git repository 17:35:34 Using shallow clone with depth 1 17:35:34 Avoid fetching tags 17:35:08 Cloning repository https://github.com/openvinotoolkit/openvino.git 17:35:08 > git init c:\j\workspace\proxy_auth_error_reproducer # timeout=10 17:35:09 Fetching upstream changes from https://github.com/openvinotoolkit/openvino.git 17:35:09 > git --version # timeout=10 17:35:09 > git --version # 'git version 2.22.0.windows.1' 17:35:09 using GIT_ASKPASS to set credentials xxx GitHub faceless account token 17:35:09 Setting http proxy: corporate.proxy.com:port 17:35:09 > git fetch --no-tags --force --progress --depth=1 -- https://github.com/openvinotoolkit/openvino.git +refs/heads/*:refs/remotes/origin/* # timeout=60 17:35:55 Avoid second fetch 17:35:55 Checking out Revision 3063afdbfc41fe0d1f9e63f2eb13c6584db287bd (origin/master) 17:35:55 Enabling Git LFS pull 17:35:29 > git config remote.origin.url https://github.com/openvinotoolkit/openvino.git # timeout=10 17:35:29 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10 17:35:29 > git rev-parse "origin/master^{commit}" # timeout=10 17:35:29 > git config core.sparsecheckout # timeout=10 17:35:29 > git checkout -f 3063afdbfc41fe0d1f9e63f2eb13c6584db287bd # timeout=60 17:35:37 > git config --get remote.origin.url # timeout=10 17:35:37 using GIT_ASKPASS to set credentials xxx GitHub faceless account token 17:35:37 Setting http proxy: corporate.proxy.com:port 17:35:37 > git lfs pull origin # timeout=60 17:36:07 [Pipeline] } 17:36:07 [Pipeline] // node 17:36:07 [Pipeline] } 17:36:07 [Pipeline] // timeout 17:36:07 [Pipeline] End of Pipeline 17:36:07 hudson.plugins.git.GitException: Command "git lfs pull origin" returned status code 2: 17:36:07 stdout: 17:36:07 stderr: batch response: Post https://github.com/openvinotoolkit/openvino.git/info/lfs/objects/batch: Proxy Authentication Required 17:36:07 batch response: Post https://github.com/openvinotoolkit/openvino.git/info/lfs/objects/batch: Proxy Authentication Required 17:36:07 batch response: Post https://github.com/openvinotoolkit/openvino.git/info/lfs/objects/batch: Proxy Authentication Required 17:36:07 error: failed to fetch some objects from 'https://github.com/openvinotoolkit/openvino.git/info/lfs' 17:36:07 17:36:07 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2639) 17:36:07 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:2079) 17:36:07 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$500(CliGitAPIImpl.java:84) 17:36:07 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$9.execute(CliGitAPIImpl.java:2968)
(the same logs I see when cloning on Linux with Git version 2.30)
It turned out that proxy username and password values are set to empty strings if they were configured via Update Center UI, and git-client-plugin uses them to fill proxy authentication data even when not needed.
There is a workaround, execute this in the Script Console:
def proxy = Jenkins.instance.proxy proxy.userName = null proxy.password = null proxy.save()