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

LFS-enabled repo failing with permission and/or lfs issue #223

Closed
plato-gst opened this issue Aug 3, 2023 · 6 comments
Closed

LFS-enabled repo failing with permission and/or lfs issue #223

plato-gst opened this issue Aug 3, 2023 · 6 comments

Comments

@plato-gst
Copy link

plato-gst commented Aug 3, 2023

Hi,

I'm getting this with a (private) repo having lfs enabled:

Notice: Creating branch python-coverage-comment-action-data
Error: Critical error. This error possibly occurred because the permissions of the workflow are set incorrectly. You can see the correct setting of permissions here: https://github.com/py-cov-action/python-coverage-comment-action#basic-usage
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 17, in run
    return subprocess.run(
  File "/usr/local/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('git', 'fetch', 'origin', 'python-coverage-comment-action-data')' returned non-zero exit status 128.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 54, in _git
    return run(
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 25, in run
    raise SubProcessError("\n".join([exc.stdout, exc.stderr])) from exc
coverage_comment.subprocess.SubProcessError: 
fatal: couldn't find remote ref python-coverage-comment-action-data

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/storage.py", line 41, in checked_out_branch
    git.fetch("origin", branch)
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 62, in _git
    raise GitError from exc
coverage_comment.subprocess.GitError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 17, in run
    return subprocess.run(
  File "/usr/local/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('git', 'switch', '--orphan', 'python-coverage-comment-action-data')' returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 54, in _git
    return run(
  File "/usr/local/lib/python3.10/site-packages/coverage_comment/subprocess.py", line 25, in run
    raise SubProcessError("\n".join([exc.stdout, exc.stderr])) from exc
coverage_comment.subprocess.SubProcessError:

then at the end:

Switched to a new branch 'python-coverage-comment-action-data'

This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks').

I'm not sure which error is the real one..

is lfs issue or permission issue ?

EDIT:

fwiw: have NOT lfs: true in my checkout step before but given the last message I'm not sure that would help..

EDIT2: well, should I only:

rm .git/hooks/post-checkout

before the step as proposed by the last error message ?

@ewjoachim ewjoachim changed the title LFS enable repo failing with permission and/or lfs issue LFS-enabled repo failing with permission and/or lfs issue Aug 4, 2023
@ewjoachim
Copy link
Member

Indeed, this is not a case we had tested for. I've never worked with LFS.

Do you want to work on that a submit a PR, or would you rather not ? I can't promise we'll do it right away, but I'd wager if you know how git LFS works, you're already a step ahead of me :)

@kieferro
Copy link
Member

kieferro commented Aug 4, 2023

I have been able to reproduce the error locally in a small test case in Docker and it seems to me that the only thing we need to do is to replace apt-get install -y git with apt-get install -y git-lfs in the Dockerfile.build file to install lfs.

@ewjoachim
Copy link
Member

Seems fine to me. Time for a v3 then :)

@kieferro
Copy link
Member

kieferro commented Aug 4, 2023

@plato-gst It should work now. Feel free to test it and give us feedback

@ewjoachim
Copy link
Member

(Closing for now, but don't hesitate to re-open if anything doesn't work as well as it should)

@plato-gst
Copy link
Author

hi @kieferro @ewjoachim

all good, it's been correctly running since then!

thx for fast response 👍

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

3 participants