-
Bug
-
Resolution: Fixed
-
Blocker
-
None
-
Ubuntu 24
Context: I'm trying to create a new upgraded Jenkins server based on an older server.
The original Jenkins server has a (scan org repos on github, use webhooks for auto builds) setup.
I've copied what look like all the relevent secrets over, and it can do Jenkinsfile based builds from the repos fine.... in some repos.
But for others, it dies due to LFS.
Console errors shown below.
TL;DR: its complaining about "bad credentials". But how can it be "bad" for lfs checkout, when it successfully checked out the rest of the repo pre-lfs?
Cloning the remote Git repository
Cloning with configured refspecs honoured and without tags
Cloning repository https://github.com/xxxx.git
> git init /tmp/workspace/ithub_xxxx_master # timeout=10
Fetching upstream changes from|https://github.com/xxxx.git
> git --version # timeout=10 > git --version # 'git version 2.47.0' using GIT_ASKPASS to set credentials xxxxxxxx > git fetch --no-tags --force --progress – https://github.com/xxxx.git +refs/heads/master:refs/remotes/origin/master # timeout=10 Avoid second fetch Checking out Revision 026f701df5d02981ab063fd889e1ef316258d843 (master) > git config remote.origin.url https://github.com/xxxx.git # timeout=10 > git config --add remote.origin.fetch +refs/heads/master:refs/remotes/origin/master # timeout=10 > git config core.sparsecheckout # timeout=10 > git checkout -f 026f701df5d02981ab063fd889e1ef316258d843 # timeout=10 ERROR: Checkout failed hudson.plugins.git.GitException: Command "git checkout -f 026f701df5d02981ab063fd889e1ef316258d843" returned status code 128: stdout: stderr: Downloading xxxx/diag_minimizer/doc/diag_cloud_logger_component.png (54 KB) Error downloading object: xxxx/diag_minimizer/doc/diag_cloud_logger_component.png (220c7db): Smudge error: Error downloading xxxx/diag_minimizer/doc/diag_cloud_logger_component.png (220c7db45e0515fea9f948153a35f3bdfa6df3226fa1174d1a1d44a30f473dce): batch response: Bad credentials
The git checkout operation is usually a purely local operation, reading from the local file system and writing to the local file system. When git lfs is added, then the git checkout command is no longer a purely local operation. When git lfs is enabled, if a large file is needed by a checkout operation and is not already stored locally, then git lfs must request the large file from the remote server. If the remote server requires credentials, then that request to the remote server must provide those credentials.
When the Jenkins job definition declares that it is enabling git LFS, the git plugin provides credentials to the git checkout command. Are you sure that your Jenkins job on the new server declares that it needs git LFS?