Vlad
Vlad

Reputation: 1919

Git LFS not working on TeamCity agent

I set up git-lfs on my private repository and everything works perfectly from the command line.

I set up my TeamCity build agents to have git-lfs installed and initialized. However, when I try running it though the TeamCity build, the git-lfs pull command hangs forever, and no data is transferred at all. My task manager shows git-lfs.exe existing, but being idle. When manually testing it from the work folder of the agent (on the agent machine), git-lfs pull or git lfs pull successfully downloads all the large files.

My build configuration has the git-lfs pull as the very first build step and it executes immediately after the sources have been updated.

Does anyone know why running git-lfs pull via TeamCity build process is any different than running git-lfs pull on the command line inside the build agent?

I'm using TeamCity 10.0.2 (42234) and my agents are updated.

Upvotes: 8

Views: 5687

Answers (3)

eAi
eAi

Reputation: 632

In my case on Mac, I had git-lfs installed from homebrew, but this wasn't in the PATH variable that the LaunchAgent was using. So I had to add a section link this to my ~/Library/LaunchAgents/jetbrains.teamcity.BuildAgent.plist file:

<dict>
       <key>PATH</key>
       <string></string>
</dict>

With the <string></string> value filled with an appropriate environment (run echo $PATH in the terminal to find what your normal PATH variable is).

Upvotes: 0

infojolt
infojolt

Reputation: 5418

With TeamCity running as the system user I was unable to get LFS working. The solution for me was to switch the service to running as a named user and run git lfs install when logged in as that user.

Upvotes: 0

ccflames
ccflames

Reputation: 101

Run "git-lfs install --system" to enable lfs feature on agent.

Upvotes: 10

Related Questions