google / zoekt

Fast trigram based code search
1.67k stars 113 forks source link

zoekt-git-index fails with indexGitRepo(...): reference not found #133

Closed henrik242 closed 2 years ago

henrik242 commented 3 years ago

zoekt-git-index has started failing for us. The only change I can see in the indexing output is

indexGitRepo(/home/travis/gopath/src/github.example.io/foo/codesearch/github_repos/github.example.io/foo/foo-incident-starter.git): reference not found

It seems to finish all indexing, but fails with exit 1 at the end.

hanwen commented 3 years ago

started failing for us

after an upgrade of anything, or just out of the blue?

henrik242 commented 3 years ago

Not an upgrade, just out of the blue. But we figured it out: foo/foo-incident-starter is a completely empty repo, without any commits. If we delete it or add a commit, indexing works again.

henrik242 commented 2 years ago

@hanwen Any ideas if this could be fixed?

hanwen commented 2 years ago

I added a test for indexing an empty repo in https://gerrit-review.googlesource.com/c/zoekt/+/313865

the test passes. I suspect something else is wrong. Can you delve a little bit deeper?

henrik242 commented 2 years ago

Thanks! Changes in zoekt might have improved things since I opened this issue. I haven't actually seen this lately, but I'll investigate some more.

hanwen commented 2 years ago

I'll close this for now. Please reopen when you find something.

henrik242 commented 2 years ago

@hanwen This failed for us again because of a new/empty repo. I haven't got any more debug data than the reference not found message above. We run zoekt againt Github Enterprise (v3.1.4), I don't know it that has anything to do with it.

henrik242 commented 2 years ago

@hanwen This still fals. I'm not able to reopen this issue, should I make a new one?

henrik242 commented 2 years ago

Maybe it actually works, but exits with a non-zero exit code when the indexGitRepo has been encountered? Because it continues indexing after the error has occured.

Our indexing script fails on non-zero exit codes, and thus aborts deployment of the new index. We would need to differentiate between an actual error and a non-error like this.