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

Error when re-running CI on PR: reference is not a tree #222

Open
lovasoa opened this issue Apr 19, 2020 · 6 comments
Open

Error when re-running CI on PR: reference is not a tree #222

lovasoa opened this issue Apr 19, 2020 · 6 comments
Labels
documentation Improvements or additions to documentation

Comments

@lovasoa
Copy link

lovasoa commented Apr 19, 2020

Hello,
When re-running failed tests on a PR in sql-js/sql.js#388 , actions/checkout encountered the following error :

 git checkout --progress --force 13088203ce13456b5da57c24664c2ff6f174dc2a
##[error]fatal: reference is not a tree: 13088203ce13456b5da57c24664c2ff6f174dc2a
##[error]Git checkout failed with exit code: 128
##[error]Exit code 1 returned from process: file name '/home/runner/runners/2.169.0/bin/Runner.PluginHost', arguments 'action "GitHub.Runner.Plugins.Repository.v1_0.CheckoutTask, Runner.Plugins"'.
@ericsciple
Copy link
Contributor

Are you using actions/checkout@v2 or actions/checkout@v1? This sounds like a race condition that was fixed in v2.

@lovasoa
Copy link
Author

lovasoa commented Apr 20, 2020

This error happened with actions/checkout@v1, indeed.

@ericsciple
Copy link
Contributor

Yep this is fixed in v2. V2 fetches a specific SHA.

Whereas V1 fetched the ref (refs/pull/#/merge) and then tried to checkout the SHA. It's a race condition. A new push to the PR, causes the ref to point to a new merge commit. So the old SHA isn't in the history anymore when refs/pull/#/merge is fetched.

I'm going to add a troubleshooting doc. Will add a section for this issue.

@ericsciple
Copy link
Contributor

It would also be great if the error were more actionable.

@ericsciple
Copy link
Contributor

duplicate of this issue: #23

@TomasHubelbauer
Copy link

FWIW the linked duplicate is closed, but this issue still reproduces in some cases, so it is good to have an open issue around.

jaredtao pushed a commit to jaredtao/HelloActions-Qt that referenced this issue Jan 18, 2022
> Are you using "actions/checkout@v2" or "actions/checkout@v1"? This sounds like a race condition that was fixed in v2.
> actions/checkout#222 (comment)

> Closing since I think this is fixed by "actions/checkout@v2".
> actions/checkout#23 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants
@lovasoa @TomasHubelbauer @ericsciple and others