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

Broken submodule kills self-hosted runners completely #590

Open
rtsisyk opened this issue Sep 22, 2021 · 4 comments
Open

Broken submodule kills self-hosted runners completely #590

rtsisyk opened this issue Sep 22, 2021 · 4 comments

Comments

@rtsisyk
Copy link

rtsisyk commented Sep 22, 2021

  1. Add a submodule which points to missing commit
  2. Run GH actions using a self-hosted runner
  3. The self-hosted runner will be completely handicapped after that - all further tasks will fail, even from different branches:
[REDACTED]
Run actions/checkout@v2
  with:
    repository: xxx/yyy
    token: ***
    ssh-strict: true
    persist-credentials: true
    clean: true
    fetch-depth: 1
    lfs: false
    submodules: false
Syncing repository: xxx/yyy
Getting Git version info
  Working directory is '/home/runner/_work/xxx/yyy'
  /usr/bin/git version
  git version 2.25.1
/usr/bin/git config --local --get remote.origin.url
https://github.com/xxx/yyy
Removing previously created refs, to avoid conflicts
  /usr/bin/git rev-parse --symbolic-full-name --verify --quiet HEAD
  HEAD
  /usr/bin/git rev-parse --symbolic-full-name --branches
  /usr/bin/git rev-parse --symbolic-full-name --remotes=origin
  refs/remotes/origin/master
Cleaning the repository
  /usr/bin/git clean -ffdx
  /usr/bin/git reset --hard HEAD
  HEAD is now at d12323f XXXXXXXX
Disabling automatic garbage collection
  /usr/bin/git config --local gc.auto 0
Setting up auth
  /usr/bin/git config --local --name-only --get-regexp core\.sshCommand
  /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
  Error: fatal: No url found for submodule path 'broken/submodule' in .gitmodules
  Error: The process '/usr/bin/git' failed with exit code 128

To clarify - you need to run CI on this branch ONCE and all further runs on ALL branches will fail.

@aibaars
Copy link

aibaars commented Nov 16, 2021

We ran into the same issue, except that instead of adding a submodule that references a non-existing commit we accidentally committed a submodule reference in a pull request without having the submodule mentioned in .gitmodules.

The problem is that the actions/checkout action stays on the broken commit forever because and gets stuck in the "setup auth" step which will fail for every subsequent job. I think this problem can be avoided by splitting the setup auth steps for the main repo from the setup auth steps of the submodules. Something like:

  • main repo: setup auth
  • main repo: fetch and checkout ref
  • submodules: setup auth
  • submodules: update

I think this way the action can switch away from the broken commit and recover.

@gh2o
Copy link

gh2o commented Nov 16, 2021

I've been working around the issue by running this command before the checkout step:

git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :

This sets HEAD to a dummy commit before checking out the tree. The checkout step will then do a git clean which will wipe the tree before the auth step, preventing this issue from occurring again.

sveitser added a commit to EspressoSystems/cape that referenced this issue Feb 4, 2022
sveitser added a commit to EspressoSystems/cape that referenced this issue Feb 4, 2022
sveitser added a commit to EspressoSystems/cape that referenced this issue Feb 4, 2022
philippecamacho pushed a commit to EspressoSystems/cape that referenced this issue Feb 4, 2022
* Remove arbitrum submodule

* Potential fix for submodule error

actions/checkout#590 (comment)
bfish713 pushed a commit to EspressoSystems/cape that referenced this issue Feb 8, 2022
* Remove arbitrum submodule

* Potential fix for submodule error

actions/checkout#590 (comment)
@jsoref
Copy link
Contributor

jsoref commented Aug 22, 2022

This appears to be a duplicate of #385

@jokreliable
Copy link
Contributor

this should be resolved now... with some changes to the checkout code in #964..

isarkis added a commit to isarkis/cobalt that referenced this issue May 13, 2023
This sets HEAD to a dummy commit before checking
out the tree. The checkout step will then do a git
clean which will wipe the tree before the auth step,
preventing this issue from occurring again. See
actions/checkout#590 (comment)

b/282361986
isarkis added a commit to isarkis/cobalt that referenced this issue May 13, 2023
This sets HEAD to a dummy commit before checking
out the tree. The checkout step will then do a git
clean which will wipe the tree before the auth step,
preventing this issue from occurring again. See
actions/checkout#590 (comment)

b/282361986
isarkis added a commit to isarkis/cobalt that referenced this issue May 13, 2023
This sets HEAD to a dummy commit before checking
out the tree. The checkout step will then do a git
clean which will wipe the tree before the auth step,
preventing this issue from occurring again. See
actions/checkout#590 (comment)

b/282361986
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

5 participants