Version of your agent? v2.171.1
OS of the machine running the agent? Windows
dev.azure.com (formerly visualstudio.com)
I receive the following error message with the checkout step:
steps:
- checkout: self
clean: true
lfs: true
git lfs install --local
git: 'lfs' is not a git command. See 'git --help'.
##[error]Git-lfs installation failed with exit code: 1
I solved this problem by manually installing git and git-lfs on my build agent host system.
Is there any way to install this automatically for any build agent that I use?
i have the same issue,
git lfs install --local
git: 'lfs' is not a git command. See 'git --help'.
is there a way to have this working, the documentation here it should be pretty straightforward
I solved this problem by manually installing git and git-lfs on my build agent host system.
Is there any way to install this automatically for any build agent that I use?
you did it with a task scrip something like
steps:
can you shed some light?
For anyone still experiencing this issue, updating the build agent fixes the problem.
Apparently older agents include a version of Git that does not support LFS natively.
Installing Git or Git LFS externally is unnecessary since it is included in the agent,
Updating should be possible from the DevOps agents list without physical access to the self-hosted machine (although the remote update failed halfway in my case, I had to complete it manually)
2021-01-05T05:23:51.6085219Z Current agent version: '2.179.0'
.
.
.
2021-01-05T05:23:51.7672015Z ##[section]Starting: Checkout [REDACTED]@azure-pipelines to s
2021-01-05T05:23:51.8717791Z ==============================================================================
2021-01-05T05:23:51.8718237Z Task : Get sources
2021-01-05T05:23:51.8718682Z Description : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
2021-01-05T05:23:51.8718915Z Version : 1.0.0
2021-01-05T05:23:51.8719184Z Author : Microsoft
2021-01-05T05:23:51.8719595Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
2021-01-05T05:23:51.8719820Z ==============================================================================
2021-01-05T05:23:52.2096582Z Syncing repository: [REDACTED] (Git)
2021-01-05T05:23:52.2190664Z Prepending Path environment variable with directory containing 'git.exe'.
2021-01-05T05:23:52.2228691Z ##[command]git version
2021-01-05T05:23:52.2893399Z git version 2.28.0.windows.1
2021-01-05T05:23:52.3041263Z ##[command]git lfs version
2021-01-05T05:23:53.2139842Z git-lfs/2.13.1 (GitHub; windows amd64; go 1.14.12; git e896fc7a)
2021-01-05T05:23:53.2185534Z ##[command]git config --get remote.origin.url
2021-01-05T05:23:53.2194633Z ##[command]git clean -ffdx
2021-01-05T05:23:53.2200589Z Removing [REDACTED]/x64/
2021-01-05T05:23:53.2201162Z Removing [REDACTED]/x64/
2021-01-05T05:23:53.2201612Z Removing x64/
2021-01-05T05:23:53.2203660Z ##[command]git reset --hard HEAD
2021-01-05T05:23:53.2208617Z HEAD is now at a36aa09 Update azure-pipelines.yml for Azure Pipelines
2021-01-05T05:23:53.2213027Z ##[command]git submodule foreach --recursive "git clean -ffdx"
2021-01-05T05:23:54.4320461Z ##[command]git submodule foreach --recursive "git reset --hard HEAD"
2021-01-05T05:23:55.6927970Z ##[command]git config gc.auto 0
2021-01-05T05:23:55.7458027Z ##[command]git config --get-all http.https://[REDACTED]
2021-01-05T05:23:55.7904624Z ##[command]git config --get-all http.proxy
2021-01-05T05:23:55.8345177Z ##[command]git config http.version HTTP/1.1
2021-01-05T05:23:55.8802182Z ##[command]git lfs install --local
2021-01-05T05:23:56.5351741Z Updated git hooks.
2021-01-05T05:23:56.5352809Z Git LFS initialized.
2021-01-05T05:23:56.5492703Z ##[command]git -c http.extraheader="AUTHORIZATION: bearer ***" fetch --force --tags --prune --progress --no-recurse-submodules origin
2021-01-05T05:23:57.7052570Z remote: Azure Repos
.
.
.
I am also experiencing this issue intermittently. Please see details for git-lfs failing agent and successful agent. I have checked Agent version and both are 2.181.0. I have checked box "Checkout files from LFS" in Pipeline. Both logs are from the same pipeline, but different agents.
It seems some hosted agents have git-lfs and some do not, but I believe all should have git-lfs
Failing agent
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az75-927'
Current agent version: '2.181.0'
Operating System
Microsoft Windows Server 2019
10.0.17763
Datacenter
Virtual Environment
Environment: windows-2019
Version: 20201210.0
`git version
git version 2.28.0.windows.1
git lfs version
git: 'lfs' is not a git command. See 'git --help'.
git init "D:\a\1\s"
Initialized empty Git repository in D:/a/1/s/.git/
git remote add origin xxxxxxxxxxxxxxxx
git config gc.auto 0
git config --get-all xxxxxxxxxxxxxxxxxxx
git config --get-all http.proxy
git config http.version HTTP/1.1
git lfs install --local
git: 'lfs' is not a git command. See 'git --help'.
`
Successful agent
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az93-413'
Current agent version: '2.181.0'
Operating System
Microsoft Windows Server 2019
10.0.17763
Datacenter
Virtual Environment
Environment: windows-2019
Version: 20201210.0
git version
git version 2.28.0.windows.1
git lfs version
git-lfs/2.12.1 (GitHub; windows amd64; go 1.14.10; git 85b28e06)
git init "D:\a\1\s"
Initialized empty Git repository in D:/a/1/s/.git/
git remote add origin xxxxxxxxxxxxxxxxxxxxxxxxxxx
git config gc.auto 0
git config --get-all xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
git config --get-all http.proxy
git config http.version HTTP/1.1
git lfs install --local
Updated git hooks.
Git LFS initialized.
@indivara should I open a new issue, as this one refers to release v2.171.1 and I see the same error on 2.181
On further investigation I established that re-runnning older build attempts that did work, still worked, and taking the YAML from those builds and running in the most recent pipeline environ didn't work.
I have established that the declaration of a variable in the pipeline, (not within the YAML, but using the pipelines variable form), which I naively called 'path' was somehow stopping the use of git-LFS. Perhaps messing up some PATH system/environ variable.
Hi everyone, according to docs git-lfs requires git v1.8.2 or higher to be installed.
The windows agent have in-the-box git, but for linux - it's required to be installed on system.
@pri-kise could you please try to update your agent version to the latest one?
@MaxB504 probably there were some changes for Path environment variable - could you please check that relevant git version is available for agent at the moment of 'git lfs install' call?
Hi @anatolybolshakov
I no longer have any issues on the AzDO hosted build agents. git-lfs is functioning as expected
@MaxB504 ok thanks!
@pri-kise let me close this issue since it seems to be resolved - please let us know if it's still actual for you.
Updating the build agent did not fix this issue for me on a self hosted build machine. Installing the LFS manually did allow me to run it manually on the machine in the externals folder, but the build is still failing. @anatolybolshakov
@TroySchmidt do you see the same error? Do you use agent on windows or some other platform?