Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why do I have to pull the lfs separately when using lfs: 'true' #270

Open
gary-cowell opened this issue Jun 2, 2020 · 17 comments
Open

Why do I have to pull the lfs separately when using lfs: 'true' #270

gary-cowell opened this issue Jun 2, 2020 · 17 comments

Comments

@gary-cowell
Copy link

                  - name: checkout
                    uses: actions/checkout@v2
                    with:
                        lfs: 'true'
                  - name: checkoutLFS
                    uses: actions/checkout@v2
                  - run: git lfs pull

With only the first of those, the source checkout has LFS which look like this:

-rw-r--r-- 1 runner docker 133 Jun 1 15:54 largefile.zip

I.e. that's a reference only.

After the extra pull, I see:

-rw-r--r-- 1 runner docker 28956993 Jun 2 07:08 largefile.zip

The lfs: 'true' is having some effect on the first checkout because I can see it installing LFS and issuing:

/usr/bin/git lfs fetch origin refs/remotes/origin/mybranch

That does not appear to take enough time to be fetching the actual lfs, then it runs

/usr/bin/git checkout --progress --force -B mybranch refs/remotes/origin/mybranch

Which still leaves us with a reference file.

It's only when I run the second checkout and force a 'git lfs pull' do I get the actual file. I don't see any errors in the first checkout step.

@mcraiha
Copy link

mcraiha commented Sep 24, 2020

I am also wondering this.

@maximveksler
Copy link

Any input on this? Is this the expected behavior?

@yair-mantis
Copy link

yair-mantis commented Mar 22, 2021

mybe this is no longer the case, at least on ubuntu[1].
using ssh key as secret.
i use an 'ls' on one of the files after the checkout to verify

name: CI 
on:
  workflow_dispatch:
jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2.3.4
        with:
          lfs: 'true'
          submodules: 'recursive'
          ssh-key: ${{ secrets.git_ssh_key }}

        env:
          GIT_CURL_VERBOSE: '1'
          GIT_TRACE: '1'

[1] #311

@bk2204
Copy link

bk2204 commented Apr 14, 2021

Just popping in here since someone mentioned this on the Git LFS issue tracker, but are you sure the file you're seeing problems with is properly listed in .gitattributes, including case? For example, Git will not think that *.ZIP in .gitattributes matches largefile.zip or vice versa. git lfs pull may have nonstandard behavior here.

Also, do you have a public repo that demonstrates this problem? That would be helpful to help whomever is looking at this troubleshoot the problem.

@nevyn
Copy link

nevyn commented Jun 9, 2021

https://github.com/alloverse/alloplace

Here's a repo with a github actions that tries to build a docker image. the submodule marketplace has a submodule called apps/allo-house which uses LFS. Even with explicit git submodule foreach --recursive git lfs pull it doesn't fetch my LFS objects. I'm really confused and frustrated.

EDIT: Figured it out. The original checkout wasn't recursive, so that's why lfs pull didn't do anything. And, compounding the confusion: docker/build-push-action@v2 defaults to rm -rf * && git checkout --recursive before it does the rest of its things?? why???? gaah. at least now I no longer have this issue, after having set it to context: . and using @yair-mantis's submodules: recursive and lfs: true.

@itssimon
Copy link

itssimon commented Aug 9, 2021

Came across this issue today as well. The lfs: true seems to inconsistently download files for some workflows, and not for others. Haven't investigated this in detail but I think the file download works for on: push workflows but not for on: workflow_dispatch. Very confusing and should definitely be considered a bug that needs to be fixed IMO.

@slonopotamus
Copy link

slonopotamus commented Aug 9, 2021

@itssimon Your lack of way to reproduce or a link to workflow where the issue can be seen only adds confusion and should definitely be considered a bug that needs to be fixed.

lfs: true definitely works in basic case: https://github.com/slonopotamus/gh-actions-lfs-test/runs/3277921934?check_suite_focus=true

Also, yair-mantis shows in comments above that lfs: true works with submodules.

So if you're trying to claim that it doesn't works in some case, provide the evidence.

@itssimon
Copy link

itssimon commented Aug 10, 2021

Unfortunately I can't share the private repository, but below are the (truncated) log outputs of our workflow. Once it fails due to LFS files not being downloaded and once it succeeds.

SUCEEDING:

2021-08-10T01:30:52.4034469Z Can't find any online and idle self-hosted runner in the current repository, account/organization that matches the required labels: 'self-hosted'
2021-08-10T01:30:52.4034688Z Found online and busy self-hosted runner(s) in the current repository's organization account that matches the required labels: 'self-hosted'. Waiting for one of them to get assigned for this job.
2021-08-10T01:30:52.4034718Z Waiting for a self-hosted runner to pick up this job...
2021-08-10T01:33:03.7877401Z Current runner version: '2.278.0'
2021-08-10T01:33:03.7883412Z Runner name: 'github-actions-runner-jzqmc-tfldj'
2021-08-10T01:33:03.7884929Z Runner group name: 'data-science'
2021-08-10T01:33:03.7887148Z Machine name: 'github-actions-runner-jzqmc-tfldj'
2021-08-10T01:33:03.7892263Z ##[group]GITHUB_TOKEN Permissions
2021-08-10T01:33:03.7894317Z Actions: read
2021-08-10T01:33:03.7895045Z Checks: read
2021-08-10T01:33:03.7895874Z Contents: read
2021-08-10T01:33:03.7896769Z Deployments: read
2021-08-10T01:33:03.7897711Z Discussions: read
2021-08-10T01:33:03.7898490Z Issues: read
2021-08-10T01:33:03.7899271Z Metadata: read
2021-08-10T01:33:03.7900118Z Packages: read
2021-08-10T01:33:03.7900986Z PullRequests: read
2021-08-10T01:33:03.7901894Z RepositoryProjects: read
2021-08-10T01:33:03.7902941Z SecurityEvents: read
2021-08-10T01:33:03.7903768Z Statuses: read
2021-08-10T01:33:03.7904792Z ##[endgroup]
2021-08-10T01:33:03.7909420Z Prepare workflow directory
2021-08-10T01:33:03.8886134Z Prepare all required actions
2021-08-10T01:33:03.8901660Z Getting action download info
2021-08-10T01:33:04.2343737Z Download action repository 'actions/checkout@v2'
2021-08-10T01:33:05.0825012Z ##[group]Run actions/checkout@v2
2021-08-10T01:33:05.0826224Z with:
2021-08-10T01:33:05.0826866Z   lfs: true
2021-08-10T01:33:05.0827711Z   repository: genesiscare/clinex
2021-08-10T01:33:05.0829339Z   token: ***
2021-08-10T01:33:05.0830102Z   ssh-strict: true
2021-08-10T01:33:05.0831032Z   persist-credentials: true
2021-08-10T01:33:05.0831953Z   clean: true
2021-08-10T01:33:05.0832716Z   fetch-depth: 1
2021-08-10T01:33:05.0833528Z   submodules: false
2021-08-10T01:33:05.0834287Z ##[endgroup]
2021-08-10T01:33:05.2625163Z Syncing repository: genesiscare/clinex
2021-08-10T01:33:06.1177701Z ##[group]Getting Git version info
2021-08-10T01:33:06.1206330Z Working directory is '/runner/_work/clinex/clinex'
2021-08-10T01:33:06.1213636Z [command]/usr/bin/git version
2021-08-10T01:33:06.1214640Z git version 2.32.0
2021-08-10T01:33:06.1216654Z [command]/usr/bin/git lfs version
2021-08-10T01:33:06.1218122Z git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
2021-08-10T01:33:06.1220069Z ##[endgroup]
2021-08-10T01:33:06.1221574Z Deleting the contents of '/runner/_work/clinex/clinex'
2021-08-10T01:33:06.1223806Z ##[group]Initializing the repository
2021-08-10T01:33:06.1225126Z [command]/usr/bin/git init /runner/_work/clinex/clinex
2021-08-10T01:33:06.1227175Z hint: Using 'master' as the name for the initial branch. This default branch name
2021-08-10T01:33:06.1228800Z hint: is subject to change. To configure the initial branch name to use in all
2021-08-10T01:33:06.1230435Z hint: of your new repositories, which will suppress this warning, call:
2021-08-10T01:33:06.1231658Z hint: 
2021-08-10T01:33:06.1233109Z hint: 	git config --global init.defaultBranch <name>
2021-08-10T01:33:06.1234305Z hint: 
2021-08-10T01:33:06.1235771Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2021-08-10T01:33:06.1237695Z hint: 'development'. The just-created branch can be renamed via this command:
2021-08-10T01:33:06.1239006Z hint: 
2021-08-10T01:33:06.1240151Z hint: 	git branch -m <name>
2021-08-10T01:33:06.1241521Z Initialized empty Git repository in /runner/_work/clinex/clinex/.git/
2021-08-10T01:33:06.1243227Z [command]/usr/bin/git remote add origin https://github.com/genesiscare/clinex
2021-08-10T01:33:06.1244456Z ##[endgroup]
2021-08-10T01:33:06.1245280Z ##[group]Disabling automatic garbage collection
2021-08-10T01:33:06.1246420Z [command]/usr/bin/git config --local gc.auto 0
2021-08-10T01:33:06.1247076Z ##[endgroup]
2021-08-10T01:33:06.1248809Z ##[group]Setting up auth
2021-08-10T01:33:06.1249780Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-08-10T01:33:06.1251286Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-08-10T01:33:06.1252814Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-08-10T01:33:06.1254843Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-08-10T01:33:06.1282430Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2021-08-10T01:33:06.1284014Z ##[endgroup]
2021-08-10T01:33:06.1284899Z [command]/usr/bin/git lfs install --local
2021-08-10T01:33:06.1285530Z Updated git hooks.
2021-08-10T01:33:06.1286095Z Git LFS initialized.
2021-08-10T01:33:06.1286741Z ##[group]Fetching the repository
2021-08-10T01:33:06.1288585Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +b2673e0a7e08be1bc7d82317aedb44473061002a:refs/remotes/pull/20/merge
2021-08-10T01:33:06.9987238Z remote: Enumerating objects: 553, done.        
2021-08-10T01:33:06.9988520Z remote: Counting objects:   0% (1/553)        
2021-08-10T01:33:06.9994454Z remote: Counting objects:   1% (6/553)        
2021-08-10T01:33:06.9997400Z remote: Counting objects:   2% (12/553)
...
2021-08-10T01:33:09.9004541Z Resolving deltas: 100% (91/91), done.
2021-08-10T01:33:09.9548400Z From https://github.com/genesiscare/clinex
2021-08-10T01:33:09.9550595Z  * [new ref]         b2673e0a7e08be1bc7d82317aedb44473061002a -> pull/20/merge
2021-08-10T01:33:09.9587575Z ##[endgroup]
2021-08-10T01:33:09.9590510Z ##[group]Determining the checkout info
2021-08-10T01:33:09.9591639Z ##[endgroup]
2021-08-10T01:33:09.9593145Z ##[group]Fetching LFS objects
2021-08-10T01:33:09.9594101Z [command]/usr/bin/git lfs fetch origin refs/remotes/pull/20/merge
2021-08-10T01:33:09.9716508Z fetch: Fetching reference refs/remotes/pull/20/merge
2021-08-10T01:33:14.5012209Z ##[endgroup]
2021-08-10T01:33:14.5014314Z ##[group]Checking out the ref
2021-08-10T01:33:14.5019795Z [command]/usr/bin/git checkout --progress --force refs/remotes/pull/20/merge
2021-08-10T01:33:15.4421199Z Note: switching to 'refs/remotes/pull/20/merge'.
2021-08-10T01:33:15.4433621Z 
2021-08-10T01:33:15.4456509Z You are in 'detached HEAD' state. You can look around, make experimental
2021-08-10T01:33:15.4457516Z changes and commit them, and you can discard any commits you make in this
2021-08-10T01:33:15.4458493Z state without impacting any branches by switching back to a branch.
2021-08-10T01:33:15.4459130Z 
2021-08-10T01:33:15.4459700Z If you want to create a new branch to retain commits you create, you may
2021-08-10T01:33:15.4460908Z do so (now or later) by using -c with the switch command. Example:
2021-08-10T01:33:15.4461487Z 
2021-08-10T01:33:15.4462303Z   git switch -c <new-branch-name>
2021-08-10T01:33:15.4462712Z 
2021-08-10T01:33:15.4463224Z Or undo this operation with:
2021-08-10T01:33:15.4463816Z 
2021-08-10T01:33:15.4464255Z   git switch -
2021-08-10T01:33:15.4464478Z 
2021-08-10T01:33:15.4465204Z Turn off this advice by setting config variable advice.detachedHead to false
2021-08-10T01:33:15.4466030Z 
2021-08-10T01:33:15.4467091Z HEAD is now at b2673e0 Merge b6f3a5819f7c6149cc9de54f1948cacf3cad8754 into 734dea5baedae0040be6d444ebc260c0112cb17a
2021-08-10T01:33:15.4468712Z ##[endgroup]
2021-08-10T01:33:15.4469361Z [command]/usr/bin/git log -1 --format='%H'
2021-08-10T01:33:15.4470372Z 'b2673e0a7e08be1bc7d82317aedb44473061002a'
...

FAILING:

2021-08-10T01:31:11.9564272Z Can't find any online and idle self-hosted runner in the current repository, account/organization that matches the required labels: 'self-hosted'
2021-08-10T01:31:11.9564595Z Found online and busy self-hosted runner(s) in the current repository's organization account that matches the required labels: 'self-hosted'. Waiting for one of them to get assigned for this job.
2021-08-10T01:31:11.9564653Z Waiting for a self-hosted runner to pick up this job...
2021-08-10T01:35:26.5125836Z Current runner version: '2.279.0'
2021-08-10T01:35:26.5131182Z Runner name: 'github-actions-runner-jzqmc-qmw8x'
2021-08-10T01:35:26.5132648Z Runner group name: 'data-science'
2021-08-10T01:35:26.5134821Z Machine name: 'github-actions-runner-jzqmc-qmw8x'
2021-08-10T01:35:26.5139910Z ##[group]GITHUB_TOKEN Permissions
2021-08-10T01:35:26.5141678Z Actions: read
2021-08-10T01:35:26.5142489Z Checks: read
2021-08-10T01:35:26.5143254Z Contents: read
2021-08-10T01:35:26.5144080Z Deployments: read
2021-08-10T01:35:26.5144866Z Discussions: read
2021-08-10T01:35:26.5145840Z Issues: read
2021-08-10T01:35:26.5146645Z Metadata: read
2021-08-10T01:35:26.5147496Z Packages: read
2021-08-10T01:35:26.5148389Z PullRequests: read
2021-08-10T01:35:26.5149328Z RepositoryProjects: read
2021-08-10T01:35:26.5150314Z SecurityEvents: read
2021-08-10T01:35:26.5151195Z Statuses: read
2021-08-10T01:35:26.5152511Z ##[endgroup]
2021-08-10T01:35:26.5156375Z Prepare workflow directory
2021-08-10T01:35:26.5882294Z Prepare all required actions
2021-08-10T01:35:26.5894560Z Getting action download info
2021-08-10T01:35:26.9569146Z Download action repository 'actions/checkout@v2'
2021-08-10T01:35:27.6559288Z ##[group]Run actions/checkout@v2
2021-08-10T01:35:27.6559854Z with:
2021-08-10T01:35:27.6560162Z   lfs: true
2021-08-10T01:35:27.6560585Z   repository: genesiscare/clinex
2021-08-10T01:35:27.6561489Z   token: ***
2021-08-10T01:35:27.6561854Z   ssh-strict: true
2021-08-10T01:35:27.6562313Z   persist-credentials: true
2021-08-10T01:35:27.6562757Z   clean: true
2021-08-10T01:35:27.6563109Z   fetch-depth: 1
2021-08-10T01:35:27.6563502Z   submodules: false
2021-08-10T01:35:27.6563867Z ##[endgroup]
2021-08-10T01:35:28.5472015Z Syncing repository: genesiscare/clinex
2021-08-10T01:35:28.5480115Z ##[group]Getting Git version info
2021-08-10T01:35:28.5481392Z Working directory is '/runner/_work/clinex/clinex'
2021-08-10T01:35:28.5482643Z [command]/usr/bin/git version
2021-08-10T01:35:28.5483139Z git version 2.32.0
2021-08-10T01:35:28.5484452Z [command]/usr/bin/git lfs version
2021-08-10T01:35:28.5485235Z git-lfs/2.9.2 (GitHub; linux amd64; go 1.13.5)
2021-08-10T01:35:28.5488298Z ##[endgroup]
2021-08-10T01:35:28.5489772Z [command]/usr/bin/git config --local --get remote.origin.url
2021-08-10T01:35:28.5491141Z https://github.com/genesiscare/clinex
2021-08-10T01:35:28.5493405Z ##[group]Removing previously created refs, to avoid conflicts
2021-08-10T01:35:28.5495396Z [command]/usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
2021-08-10T01:35:28.5496547Z HEAD
2021-08-10T01:35:28.5498040Z [command]/usr/bin/git rev-parse --symbolic-full-name --branches
2021-08-10T01:35:28.5500049Z ##[endgroup]
2021-08-10T01:35:28.5501738Z ##[group]Cleaning the repository
2021-08-10T01:35:28.5503039Z [command]/usr/bin/git clean -ffdx
2021-08-10T01:35:29.3212073Z Removing .mypy_cache/
2021-08-10T01:35:29.3212621Z Removing demo/node_modules/
2021-08-10T01:35:29.3220569Z [command]/usr/bin/git reset --hard HEAD
2021-08-10T01:35:30.3568654Z HEAD is now at 7fe52b2 Merge 09ad0b58faeb1a9130ec3e76a9fe614c7526f443 into 734dea5baedae0040be6d444ebc260c0112cb17a
2021-08-10T01:35:30.3589641Z ##[endgroup]
2021-08-10T01:35:30.3597020Z ##[group]Disabling automatic garbage collection
2021-08-10T01:35:30.3599876Z [command]/usr/bin/git config --local gc.auto 0
2021-08-10T01:35:30.3620122Z ##[endgroup]
2021-08-10T01:35:30.3645679Z ##[group]Setting up auth
2021-08-10T01:35:30.3647543Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2021-08-10T01:35:30.3668932Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
2021-08-10T01:35:30.3898304Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2021-08-10T01:35:30.3931412Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :
2021-08-10T01:35:30.4166983Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2021-08-10T01:35:30.4214853Z ##[endgroup]
2021-08-10T01:35:30.4218210Z [command]/usr/bin/git lfs install --local
2021-08-10T01:35:30.4404814Z Updated git hooks.
2021-08-10T01:35:30.4405728Z Git LFS initialized.
2021-08-10T01:35:30.4415612Z ##[group]Fetching the repository
2021-08-10T01:35:30.4426549Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +7fe52b2cdb0942c9a3752cdf1fa35d9218b5cab4:refs/remotes/pull/21/merge
2021-08-10T01:35:31.0753958Z remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0        
2021-08-10T01:35:31.0832861Z ##[endgroup]
2021-08-10T01:35:31.0835642Z ##[group]Determining the checkout info
2021-08-10T01:35:31.0837732Z ##[endgroup]
2021-08-10T01:35:31.0840379Z ##[group]Fetching LFS objects
2021-08-10T01:35:31.0842964Z [command]/usr/bin/git lfs fetch origin refs/remotes/pull/21/merge
2021-08-10T01:35:31.0974672Z fetch: Fetching reference refs/remotes/pull/21/merge
2021-08-10T01:35:33.9228618Z ##[endgroup]
2021-08-10T01:35:33.9232406Z ##[group]Checking out the ref
2021-08-10T01:35:33.9234867Z [command]/usr/bin/git checkout --progress --force refs/remotes/pull/21/merge
2021-08-10T01:35:33.9297238Z HEAD is now at 7fe52b2 Merge 09ad0b58faeb1a9130ec3e76a9fe614c7526f443 into 734dea5baedae0040be6d444ebc260c0112cb17a
2021-08-10T01:35:33.9506829Z ##[endgroup]
2021-08-10T01:35:33.9508594Z [command]/usr/bin/git log -1 --format='%H'
2021-08-10T01:35:33.9510176Z '7fe52b2cdb0942c9a3752cdf1fa35d9218b5cab4'
...

The second run of this workflow eventually fails because LFS files have not been downloaded. Unfortunatley this is not easily reproducible as it happens intermittently.

Here's an excerpt from my workflow YAML:

name: Tests
on:
  push:
    branches:
      - main
    paths-ignore:
      - '**/README.md'
  pull_request:
    branches:
      - main

jobs:
  check:
    runs-on: [self-hosted]
    steps:
      - uses: actions/checkout@v2
      - name: Run static checks
        run: make check
      - name: Run static checks on demo app
        run: |
          cd demo && npm ci && cd ..
          make check-demo

  build:
    runs-on: [self-hosted]
    strategy:
      matrix:
        component: [api, celery, demo, inference, prodigy, jobs]
    steps:
      - uses: actions/checkout@v2
        with:
          lfs: true
      - name: Build Docker image
        run: make build-${{ matrix.component }} TAG=$GITHUB_SHA

The first job (check) runs checkout without LFS intentionally and the second job (build) does need the LFS files downloaded and has lfs: true configured accordingly.

Is it possible that if by chance these two jobs end up being run on the same worker, the second invocation of the checkout action reuses the repo pulled for the previous job and if that was without LFS files downloaded then the lfs: true has no effect?

@ioanrogers
Copy link

ioanrogers commented Aug 10, 2021

The way it is showing up for us is:

  • workflow_A: needs to use LFS files, has lfs:true set
  • workflow_B: same repo, but does not need to use any LFS files, lfs: true is not set
  1. workflow_A is triggered, it checks out binaries from LFS files, all steps run.
  2. workflow_B is then triggered by something else, happens to runs on the same runner.
  3. workflow_A is triggered again, runs on the same runner, steps fail because it has LFS pointer files instead of binaries.

Adding an extra step to workflow_A after checkout makes it all work.

- name: Check out LFS objects
  run: git lfs checkout the/files/we/need/ 

That's basically the same as the comment above, but with confirmation that if the LFS-using workflow goes first, LFS works. lfs: true on a run where there is an existing repo that had been cloned or reset without lfs: true will cause an lfs fetch, but leave the pointer files in place.

@slonopotamus
Copy link

slonopotamus commented Aug 10, 2021

Sounds like that mixing lfs: true with lfs: false in the same working copy is undefined behavior. Even if lfs: true is taught to explicitly perform git lfs pull in order to expand lfs pointers in working copy (it will fix current issue), subsequent build with lfs: falsein the same working copy will not get all files as raw pointers because they were expanded to real objects by previous build.

I'd personally suggest using consistent lfs setting across all repo builds.

@itssimon
Copy link

itssimon commented Aug 11, 2021

Using lfs: true everywhere has the downside of more LFS traffic that you have to pay for though. We only need to download these files for container builds. Other steps, like linting the code base, really don't need to download big files. I still believe this is best addressed in the action itself, so that it does what it promises consistently.

@hholst80
Copy link

I agree, the fact that I have to use git lfs pull or anything really to get lfs files in a CI/CD pipeline must be considered a bug.
That said, it did work on github, only when I started using a self-hosted runner, it stopped working for me.

@ifiddynine
Copy link

ifiddynine commented Nov 12, 2021

Ran into this same issue with the following steps:

    - name: checkout engine without LFS
      uses: actions/checkout@v2
      with:
        lfs: false
    - name: apply_lfs_filters
      run: |
        git config --local lfs.fetchexclude '**/Windows/**'
    - name: checkout engine with LFS
      uses: actions/checkout@v2
      with:
        lfs: true

I fixed it by adding a final git lfs pull step, but is definitely a bit awkward. Is there a way of configuring lfs.fetchexclude directly in checkout to avoid running checkout twice?

jsoref added a commit to jsoref/checkout that referenced this issue Feb 23, 2022
@jsoref
Copy link
Contributor

jsoref commented Feb 23, 2022

Can anyone trip on this w/o using a self-hosted runner?

What's confusing me is that in theory actions/checkout@v2 should be defaulting to with: / clean: true, which means it should wipe everything out.

@ifiddynine, here's a thing that should work for your problem:

      run: |
        git config --global lfs.fetchexclude '**/Windows/**'

You could even do it for just the one step before you run the lfs checkout, then set it to --local afterwards for the repository, and unset it for --global.

@sseveran
Copy link

I can confirm that this issue is indeed specific to self hosted runners.

@slonopotamus
Copy link

I can confirm that this issue is indeed specific to self hosted runners.

No, you can't. #270 (comment) provides a repro that doesn't involve self-hosted runner.

glesur added a commit to idefix-code/idefix that referenced this issue Jan 23, 2023
glesur added a commit to idefix-code/idefix that referenced this issue Jan 23, 2023
* add version

* Ensure that we can do a checkout

* indentation

* Ensure we are in the right directory

* Update idefix-ci.yml

* Checkout submodules

* add git lfs during checkout

* more lfs

* Manually add git lfs pull

actions/checkout#270

* full blown test suite

* update dependencies

* remove whitespace, add fork prevention

* fix lint

* change run names

* remove run name
mdbenito added a commit to mdbenito/pyDVL that referenced this issue Mar 8, 2023
@nathandunn
Copy link

@gary-cowell We had to do this as well, but when the .gitattributes lined up with what was being tracked, we no longer had to do a second explicit git lfs pull

laisspportugal added a commit to bmw-software-engineering/foxbox that referenced this issue Jul 5, 2024
**User-Facing Changes**
N/A

**Description**
Everytime that some dependabot PR was oppened the following error was
preventing the dependabot step to run:
`Error when performing the request to
https://registry.npmjs.org/yarn/latest; for troubleshooting help, see
https://github.com/nodejs/corepack#troubleshooting
3414 at fetch
(/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22762:11)`

We changed the dependabot-fix script to avoid problems when trying to
run corepack enable command.

Main changes:
- Changing the script order to avoid error when running corepack enable
command
- Adding 'lfs:true' and removing the manual command 'git lfs pull
--include .yarn/'

**Relevant links**
-
https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
-
https://github.com/foxglove/studio/actions/runs/8118725898/job/22193503028
- actions/checkout#270

**Checklist**

- [x] The web version was tested and it is running ok
- [x] The desktop version was tested and it is running ok
- [x] I've updated/created the storybook file(s)
- [x] The release version was updated on package.json files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests