panic: nil error when calling `ListAll()` on zoekt backend
Created by: mrnugget
@tsenart linked me to this panic log on Google Cloud: https://console.cloud.google.com/errors/CNffpKuZvIaCAg?time=P1D&project=sourcegraph-dev&authuser=1
Here is the stack trace:
runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe467c2]
at github.com/sourcegraph/sourcegraph/pkg/search/backend.(*Zoekt).Enabled (text.go:76)
at github.com/sourcegraph/sourcegraph/pkg/search/backend.(*Zoekt).ListAll (text.go:45)
at github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.zoektIndexedRepos (textsearch.go:835)
at github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.searchFilesInRepos (textsearch.go:894)
at github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.(*searchResolver).suggestFilePaths (search.go:576)
at github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.(*searchResolver).Suggestions.func2 (search_suggestions.go:89)
at github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.(*searchResolver).Suggestions.func5 (search_suggestions.go:191)
This is probably related to this commit I made earlier today in which the zoekt backend is injected as a dependency: https://github.com/sourcegraph/sourcegraph/commit/26df02becae2bc4911fede12556a5a24320bea51
The curious bit is that the there's a nil check right at the top of the function:
and that it fails here after ListAll
is called anyway: