Build Agent doesn`t support git-lfs

Answered
  Failed to perform checkout on agent: /usr/local/bin/git -c core.askpass=/Users/user/Documents/TeamCity/buildAgent/temp/buildTmp/pass -c credential.helper= -c credential.helper=/Users/user/Documents/TeamCity/buildAgent/temp/buildTmp/credHelper.sh checkout -q -f release/2 command failed.
  exit code: 128
  stderr: git-lfs filter-process: git-lfs: command not found
  fatal: the remote end hung up unexpectedly

on the Agent side
TEAMCITY_GIT_PATH     /usr/local/bin/git
TEAMCITY_GIT_VERSION     2.38.0.0

TeamCity Professional 2022.10 (build 116751)


user@iMac-User-3 ~ % which git-lfs
/usr/local/bin/git-lfs

2
17 comments

If I read it correctly you use the locally installed git version? In that case shouldn't you manually install git-lfs on that system? 

 

 

0

>If I read it correctly you use the locally installed git version? In that case shouldn't you manually install git-lfs on that system? 
I have showed data from the build machine where git installed.

0

That wasn't clear for me from the random command lines. Did you setup TeamCity to use the locally installed git instead of it's internal one? And can you manually execute the commands on the system to checkout the repository?

1

>Did you setup TeamCity to use the locally installed git instead of it's internal one?
git have been installed as well on machine

>And can you manually execute the commands on the system to checkout the repository?
I can build the project manually via command line if you meant this

0

if you have 

Native Git operations:
enabled

under Diagnostics > Git

And you have rebooted the system after Git installation.

 

Then I'm unsure what the possible problem could be.

 

0

I have deleted git-lfs that I have installed manual.
In the  Diagnostics > Git

0

resolved- need to delete local  git-lfs support from your build machine.

0

UPD:
>resolved- need to delete local  git-lfs support from your build machine.
after this the error still exists.

result of git lfs install is Git LFS initialized.

I got this type of error:
Failed to perform checkout on agent:  command failed.
  exit code: 128
  stderr: git-lfs filter-process: git-lfs: command not found
  fatal: the remote end hung up unexpectedly
build machine completely has in .bash file this and the same in .zshrc
export PATH=/usr/local/bin:$PATH
export PATH=/usr/local/bin/git-lfs:$PATH

0

Pavel Bahratsou

Pavel Bahratsou

Hello Pavel,

Did you manage to resolve the problem?

I am having the same issue with TeamCity Professional 2023.05 (build 129203). 

Failed to perform checkout on agent: /usr/bin/git -c credential.helper= checkout -q -f master command failed. exit code: 128 stderr: git-lfs filter-process: git-lfs: command not found fatal: the remote end hung up unexpectedly

git-lfs program is available to all systems, even I click for "Open Terminal" on a build agent, however in every checkout there is a problem with "git-lfs" not being found.

Niels, maybe you have some more ideas on this one?

Thanks!

0
Please note that git-lfs installation is user-specific. If it is available for one user account, it doesn't mean it is also available for others. Check which user account the build agent uses, and make sure that the executable is found when you run `which git-lfs` / `Get-Command git-lfs` on behalf of that user.
0

Anatoly Cherenkov

Thanks for the comment, although it was unhelpful.

TL;DR I managed solve the problem by creating a symbolic link to git lfs executable: https://stackoverflow.com/a/69007609

0

At version 2024.3 TeamCity supports the https protocol for submodule and lfs. I wonder how to deal with http lfs? Since many in-house dedicated lfs repos (with different ip with repo) are employed just with http protocol instead of https.

0

Kethers Hi,

You're correct, accessing submodule repositories and LFS files is currently supported only via secure HTTPS protocol. Using HTTP for such access seems unsafe to me. However, if you think there is a valid scenario where it can be used safely, I suggest creating a feature request in our issue tracker and describing your scenario in detail there: https://youtrack.jetbrains.com/issues/TW.

Best regards,
Anton

0
Hi,

I have a confirmation that TeamCity can work with LFS and submodules via HTTP, even though it's not recommended.
We're adjusting the documentation on this topic to be more correct.
In the meantime, please let me know if you have additional questions.

Best regards,
Anton
0

Hi Anton Vakhtel ,

    Which version did you test http work? Is http dedicated lfs server supported in 2024.12? Since I have tried 2024.7 before and it's not working. When checkout another branch at build, it will forever stuck at credentials helper to access the dedicated lfs server until it reaches timeout limit. 

    If 2024.12 works fine then I will try update to newer version. By the way how to set the param for dedicated lfs/submodule? Do http/https share the same parameter names or not?

    It would be great if you can share more precise information with me, or please inform me when documentation adjustment is done.

 

Best Regards.

0
Hi,

What is the value of teamcity.git.https.credentials.<ALIAS>.url configuration parameter in your case (https://www.jetbrains.com/help/teamcity/git.html#Additional+Credentials)?
The parameter names are the same.
The version should not matter for this.

Best regards,
Anton
0

The conclusion, for everyone finding this discussion later:

We have confirmed that HTTP URL in teamcity.git.https.credentials.<ALIAS>.url works (TeamCity 2024.12).

0

Please sign in to leave a comment.