You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error: getCommit("refs/heads/", "HEAD"): reference not found #59
Run cat HEAD to see which reference HEAD is referencing
Run git show-ref to see what references exist
Is the reference HEAD is referencing exist in that list?
cat HEAD
ref: refs/heads/master
-----------
git show-ref
fatal: detected dubious ownership in repository at '/home/user/sourcebot/sourcebot_workspace/.sourcebot/repos/github.com/xxx/xxx.git'
To add an exception for this directory, call:
git config --global --add safe.directory /home/user/sourcebot/sourcebot_workspace/.sourcebot/repos/github.com/xxx/xxx.git
I'm unsure if the "dubious ownership" thing is actually the issue or not. Are you running Sourcebot in a container? If so, could you try running git show-ref again from inside of the container? My thinking is that maybe git is fussing because the container's user owns the repository, but the command is being run as the host user.
If you still get the dubious ownership error, could you try the suggested --add safe.directory fix and see if you still hit the indexing issue?
Sorry to piggyback off a closed issue, but I'm seeing this same error on 3 (out of 681) of our repos. git show-ref works as expected from inside the container and I do not get the same detected dubious ownership in repository as OP, but these errors are consistent in the logs:
Error: Command failed: zoekt-git-index -index /data/.sourcebot/index -branches HEAD /data/.sourcebot/repos/github.foo.com/foo/bar.git
2024/11/14 01:02:22 indexGitRepo(/data/.sourcebot/repos/github.foo.com/foo/bar.git, delta=false): getCommit("refs/heads/", "HEAD"): reference not found
the contents of HEAD look normal to me, either ref: refs/heads/master or ref: refs/heads/main.
I've tried removing the individual repos and relaunching sourcebot, but the problem persists. Any other suggestions?
I'm using latest (v2.4.1). If you'd prefer I open a new issue just let me know.
Hmm that's super strange - repo A & B are expected since they are empty (will fix this in #72), but not sure why repo C was failing either 🤔. But glad it's working now!
Was repo C updated between when it was failing and it started working? One theory I have is that the repo somehow gets into a bad state when it is first cloned. If HEAD is updated on the remote, then fetching will update the local reference and fix the state.. just a theory though 🤷♂️
Activity
brendan-kellam commentedon Nov 6, 2024
Is this repository empty by chance? I previously had observed this issue with a empty repo so curious if it's the same problem
OpenCode commentedon Nov 6, 2024
Nope. There are branches and code.
brendan-kellam commentedon Nov 7, 2024
Strange - could you:
cat HEADto see which referenceHEADis referencinggit show-refto see what references existIs the reference
HEADis referencing exist in that list?OpenCode commentedon Nov 7, 2024
brendan-kellam commentedon Nov 7, 2024
I'm unsure if the "dubious ownership" thing is actually the issue or not. Are you running Sourcebot in a container? If so, could you try running
git show-refagain from inside of the container? My thinking is that maybe git is fussing because the container's user owns the repository, but the command is being run as the host user.If you still get the dubious ownership error, could you try the suggested
--add safe.directoryfix and see if you still hit the indexing issue?OpenCode commentedon Nov 12, 2024
By removing the repo folder and relaunching sourcebot, the problem no longer occurs.
Thanks @brendan-kellam.
er0k commentedon Nov 14, 2024
Sorry to piggyback off a closed issue, but I'm seeing this same error on 3 (out of 681) of our repos.
git show-refworks as expected from inside the container and I do not get the samedetected dubious ownership in repositoryas OP, but these errors are consistent in the logs:the contents of
HEADlook normal to me, eitherref: refs/heads/masterorref: refs/heads/main.I've tried removing the individual repos and relaunching sourcebot, but the problem persists. Any other suggestions?
I'm using latest (v2.4.1). If you'd prefer I open a new issue just let me know.
brendan-kellam commentedon Nov 14, 2024
Hey @er0k thanks for raising - I will just reopen this issue.
Could you confirm that
git show-refincludesrefs/heads/masteror/main?er0k commentedon Nov 14, 2024
For the 3 repos that were erroring (I'll call them
A,BandC):refs/heads/masteris included ingit show-refI updated my config to exclude archived repos, and to exclude repo B explicitly, and now I'm no longer getting errors on repo C 🎉
I'm not completely sure why that fixed it... I'm happy to do some more debugging if you'd like, or we can just go ahead and close this again 😄
brendan-kellam commentedon Nov 15, 2024
Hmm that's super strange - repo A & B are expected since they are empty (will fix this in #72), but not sure why repo C was failing either 🤔. But glad it's working now!
Was repo C updated between when it was failing and it started working? One theory I have is that the repo somehow gets into a bad state when it is first cloned. If
HEADis updated on the remote, then fetching will update the local reference and fix the state.. just a theory though 🤷♂️er0k commentedon Nov 18, 2024
no, repo C has not been updated in over a month 🤷
brendan-kellam commentedon Nov 27, 2024
Hmm ok not sure then.. will close this issue for now and we can re-open if it comes back up.