gitbutler icon indicating copy to clipboard operation
gitbutler copied to clipboard

Bug: failed load remote branches

Open wesharper opened this issue 11 months ago • 3 comments

I keep getting this for my main gitlab repo: image

I've used the Test credentials button in the project settings and everything passes. Currently on version 0.10.24. Mac M2 Pro on Sonoma 14.4.

wesharper avatar Mar 12 '24 21:03 wesharper

Would you be able to take a quick look in the logs to see if you find any errors? This toast is a result of a failed call to the list_remote_branches tauri command.

How to find your log files: https://docs.gitbutler.com/development/debugging

mtsgrd avatar Mar 12 '24 21:03 mtsgrd

I think I've tracked down the relevant log:

2024-03-13T00:54:53.454395Z ERROR list_remote_branches: gitbutler-app/src/virtual_branches/errors.rs:809: list remote branches error error=failed to convert branches

Caused by:
    not found: the reference 'refs/remotes/origin/HEAD' cannot be peeled - Cannot resolve reference; class=Invalid (3); code=NotFound (-3) [3mproject_id[0m[2m=[0m"f33b1530-8095-4f45-886d-54b6beac5c16"
2024-03-13T00:54:53.454410Z  INFO list_remote_branches: gitbutler-app/src/virtual_branches/commands.rs:539: close time.busy=152ms time.idle=22.8µs [3mproject_id[0m[2m=[0m"f33b1530-8095-4f45-886d-54b6beac5c16"
2024-03-13T00:54:53.456310Z ERROR list_remote_branches: gitbutler-app/src/virtual_branches/errors.rs:809: list remote branches error error=failed to convert branches

Caused by:
    not found: the reference 'refs/remotes/origin/HEAD' cannot be peeled - Cannot resolve reference; class=Invalid (3); code=NotFound (-3) [3mproject_id[0m[2m=[0m"f33b1530-8095-4f45-886d-54b6beac5c16"

wesharper avatar Mar 13 '24 16:03 wesharper

I was able to resolve locally by deleting .git/refs/remotes/origin/HEAD. I noticed that the contents of the file had it pointing to the wrong default branch name (we changed from 'master' to 'main').

However, this change was well before we started using GitButler on the repository and GitButler had previously worked as expected until a few days ago. I'm not certain what would have triggered this.

I did some manual branch changing, pushing, and pulling briefly when I had a few active branches that I was having trouble with in GitButler, so maybe I did something there?

wesharper avatar Mar 13 '24 17:03 wesharper

I had exactly the same issue, with the same cause (mine was also pointing 'develop' which he had since changed to 'main')

Hainesy avatar Mar 23 '24 22:03 Hainesy

I have submitted a PR with what should be a fix for this: #3584.

Byron avatar Apr 23 '24 08:04 Byron