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
get: fails with head detached and no branches in place #6154
Comments
I think that What change would you suggest here? (What would you expect?) Looks like a very rare edge case to me, but I do think that the error should be handled — maybe give message such as
|
I think this is a bug, the issue here is that the repo being cloned does have a This is a pretty specific edge case though, and I think cloning a repo with no branches may still cause some other issues in DVC anyways, even if we fix the We maybe need to rethink how |
Should also note that if gitlab CI is always doing this specific detached fetch, you probably shouldn't be using @aguschin it sounds like in gitlab CI, maybe you should always be doing
I think gitlab CI should have env vars that can be used to fill in the upstream URL and the revision. Otherwise, you are probably going to run into other issues with using the local repo |
I was expecting that artefacts related to the commit
Maybe @pmrowla, thank you, I think now it's the best option. For the record, in gitlab CI this will look like
|
It turns out the same happens in GitHub Actions: https://github.com/iterative/yolov5/runs/2893101649?check_suite_focus=true
|
@pmrowla I see. Maybe addressing #3590 (comment) (applies to list/get/import) would also prevent this. Cc @aguschin so yes, |
Wait according to #3590 (comment) at least |
@jorgeorpinel The comments in #3590 are specific to This issue is marked P3 because we can potentially change The real problem here is that the user's local repo (
won't work at all in these CI environments. If the user wants consistent |
Yeah but as you suggest, that's not something DVC can do much about. So I basically see this issue as a request to not re-clone local repos with |
Not sure it should be reported here, but I encountered the issue with this approach while trying to do this in CI job triggered by Studio. In that job $GITHUB_SHA references to some unknown commit which could not be found anywhere, thus
complete log here: https://github.com/iterative/yolov5/runs/2893514130?check_suite_focus=true Not sure what is the right way to handle this in Github Actions, any suggestions would be appreciated. Right now I've hardcoded |
One other question I have here: what's the reason for using |
@pmrowla, |
@aguschin it has a DVC file though? https://github.com/iterative/yolov5/blob/dvc/yolov5s.pt.dvc |
Sorry, it seems I didn't know how to use this.
|
It should be supported if I remember correctly. I'll take a look into it tomorrow. |
I've just had a very similar problem with
Most basic scripts such as the one above result in:
I could create a dummy branch like the thread author suggested, but I wonder if there is a better way to solve this? |
@sukhovvl Could you try - uses: actions/checkout@v3
with:
fetch-depth: 0 |
@dberenbaum I think this is a separate issue. If it was a shallow/depth problem it would likely show up as an unknown git revision/object SHA and not the "no active branch" error. @sukhovvl can you run your diff command with |
Sure, here it is:
And here is the gitlab-ci.yml producting this output:
|
Bug Report
Description
With head detached and no branches available
dvc get
fails:UPDATE: Skip to #6154 (comment)
Reproduce
Environment information
Output of
dvc doctor
:Additional Information (if any):
Interesting, that dvc pull works fine.
Initially this happened with me in Gitlab CI -- it seems like Gitlab fetches the repo without any branches and with head detached:
Simple hack works, like running
git checkout -b temp-branch
first:The text was updated successfully, but these errors were encountered: