Updating Phabricator external service leads to "EOF" warning and nil pointer panic in background
Created by: mrnugget
- Sourcegraph version: k8s.sgdev.org
Steps to reproduce:
- Create new Phabricator external service: https://k8s.sgdev.org/site-admin/external-services/new?kind=phabricator
- Use a valid configuration, like this:
{
"url": "https://phabricator.sgdev.org",
"token": "api-FOOBARTOKEN",
"repos": [
{
"path": "gorilla/mux",
"callsign": "rMUX"
}
]
}
- Create external service
Expected behavior:
External service is created without any warning or error.
Actual behavior:
I see a warning:
Further investigation reveals that the request killed the frontend
process with a nil pointer dereference. Here is the panic:
"panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa8b331]
goroutine 1290 [running]:
github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos.(*PhabricatorSource).client(0xc00302fef0, 0x101eb80, 0xc0010e3c40, 0x0, 0x0, 0x0)
/buildkite/builds/buildkite-agent-6ffffdfcc4-qqx6n-1/sourcegraph/.golang/sourcegraph/src/github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos/phabricator.go:172 +0x91
github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos.(*PhabricatorSource).ListRepos(0xc00302fef0, 0x101eb80, 0xc0010e3c40, 0xc00302fef0, 0x0, 0x0, 0x1008e01, 0xc0000cb9f0)
/buildkite/builds/buildkite-agent-6ffffdfcc4-qqx6n-1/sourcegraph/.golang/sourcegraph/src/github.com/sourcegraph/sourcegraph/cmd/repo-updater/repos/phabricator.go:41 +0x5a
github.com/sourcegraph/sourcegraph/cmd/repo-updater/repoupdater.(*Server).handleExternalServiceSync.func1(0xc002eba850, 0xc002e94300, 0x101eb80, 0xc0010e3c40)
/buildkite/builds/buildkite-agent-6ffffdfcc4-qqx6n-1/sourcegraph/.golang/sourcegraph/src/github.com/sourcegraph/sourcegraph/cmd/repo-updater/repoupdater/server.go:314 +0x105
created by github.com/sourcegraph/sourcegraph/cmd/repo-updater/repoupdater.(*Server).handleExternalServiceSync
/buildkite/builds/buildkite-agent-6ffffdfcc4-qqx6n-1/sourcegraph/.golang/sourcegraph/src/github.com/sourcegraph/sourcegraph/cmd/repo-updater/repoupdater/server.go:302 +0x1db