Open OpenCode opened 2 weeks ago
Is this repository empty by chance? I previously had observed this issue with a empty repo so curious if it's the same problem
Is this repository empty by chance? I previously had observed this issue with a empty repo so curious if it's the same problem
Nope. There are branches and code.
Strange - could you:
cat HEAD
to see which reference HEAD
is referencinggit show-ref
to see what references existIs the reference HEAD
is referencing exist in that list?
Strange - could you:
- navigate into the cloned repository
- Run
cat HEAD
to see which referenceHEAD
is referencing- Run
git show-ref
to see what references existIs 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?
By removing the repo folder and relaunching sourcebot, the problem no longer occurs. Thanks @brendan-kellam.
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.
Hey @er0k thanks for raising - I will just reopen this issue.
Could you confirm that git show-ref
includes refs/heads/master
or /main
?
For the 3 repos that were erroring (I'll call them A
, B
and C
):
refs/heads/master
is included in git show-ref
I updated my config to exclude archived repos, and to exclude repo B explicitly, and now I'm no longer getting errors on repo C :tada:
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 :smile:
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 🤷♂️
no, repo C has not been updated in over a month :shrug:
Sourcebot v2.3.0
Configuration:
For a repo I receive this error: