Skip to content

CSV Export error: Search error: panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred:

Created by: jfelten-hbo

  • Sourcegraph version: 89774_2021-03-10_da20141
  • Platform information: kubernetes - eks

Steps to reproduce:

  1. Deploy source graph on kubernetes
  2. Configure connectivity to github org - Install/ Enable CSV Exporter
  3. Execute a search
  4. Export to CSV

Expected behavior:

json with search results on screen

Actual behavior:

Search error: panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred: runtime error: invalid memory address or nil pointer dereference,panic occurred: runtime ..... repeated for each search result

Fontend Container Logs:

graphql: panic occurred: runtime error: invalid memory address or nil pointer dereference
goroutine 3331794 [running]:
github.com/graph-gophers/graphql-go/log.(*DefaultLogger).LogPanic(0x5334e10, 0x3d1af48, 0xc003c67830, 0x26362a0, 0x52c4080)
	github.com/graph-gophers/[email protected]/log/log.go:21 +0x6f
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2.1(0xc000378770, 0x3d1af48, 0xc003c67830, 0xc006221e90, 0xc005f0bfc8)
	github.com/graph-gophers/[email protected]/internal/exec/exec.go:181 +0x8e
panic(0x26362a0, 0x52c4080)
	runtime/panic.go:965 +0x1b9
github.com/sourcegraph/sourcegraph/internal/database/basestore.(*Store).Query(0xc002826d68, 0x3d1af48, 0xc0058a2a50, 0xc0058a2bd0, 0x2, 0xc0058a2bd0, 0x5)
	github.com/sourcegraph/sourcegraph/internal/database/basestore/store.go:98 +0x59
github.com/sourcegraph/sourcegraph/internal/database.(*ExternalServiceStore).list(0xc0036e4870, 0x3d1af48, 0xc0058a2a50, 0x0, 0x0, 0x0, 0x0, 0xc00667ecd0, 0x1, 0x1, ...)
	github.com/sourcegraph/sourcegraph/internal/database/external_services.go:1014 +0x2c5
github.com/sourcegraph/sourcegraph/internal/database.(*ExternalServiceStore).List(0xc0036e4870, 0x3d1af48, 0xc0058a2a50, 0x0, 0x0, 0x0, 0x0, 0xc00667ecd0, 0x1, 0x1, ...)
	github.com/sourcegraph/sourcegraph/internal/database/external_services.go:974 +0x118
github.com/sourcegraph/sourcegraph/internal/database.(*PhabricatorStore).GetByName(0xc00565a828, 0x3d1af48, 0xc0058a2a50, 0xc0042d57a0, 0x28, 0x3d3f120, 0x5334e10, 0x0)
	github.com/sourcegraph/sourcegraph/internal/database/phabricator.go:165 +0x53a
github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/externallink.linksForRepository(0x3d1af48, 0xc003c67830, 0x0, 0x0, 0xc004d22dd0, 0x0, 0x0, 0x0, 0x0)
	github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/externallink/repository.go:112 +0x2d4
github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/externallink.Repository(0x3d1af48, 0xc003c67830, 0x0, 0x0, 0xc004d22dd0, 0x2732520, 0xc003c67830, 0x40, 0x7ff23e6975b8, 0x40)
	github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/externallink/repository.go:32 +0x74
github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend.(*RepositoryResolver).ExternalURLs(0xc00441a8c0, 0x3d1af48, 0xc003c67830, 0x0, 0x0, 0x0, 0x0, 0x0)
	github.com/sourcegraph/sourcegraph/cmd/frontend/graphqlbackend/repository.go:284 +0xbf
reflect.Value.call(0x29bae00, 0xc0064a5728, 0x4293, 0x2a0082c, 0x4, 0xc00565a480, 0x1, 0x1, 0x2f, 0xc0006fccf0, ...)
	reflect/value.go:476 +0x8e7
reflect.Value.Call(0x29bae00, 0xc0064a5728, 0x4293, 0xc00565a480, 0x1, 0x1, 0x4293, 0x1, 0xc003c85570)
	reflect/value.go:337 +0xb9
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2(0xc000378770, 0x3d1af48, 0xc003c67830, 0xc005f0bfc8, 0xc004ab3f80, 0xc006221ee0, 0x3d1af48, 0xc003c67830, 0x0)
	github.com/graph-gophers/[email protected]/internal/exec/exec.go:205 +0x508
github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection(0x3d1af48, 0xc003c67830, 0xc000378770, 0xc002598000, 0xc004ab3f80, 0xc005f0bfc8, 0x472301)
	github.com/graph-gophers/[email protected]/internal/exec/exec.go:225 +0x1b5
github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1(0xc003ca1f00, 0xc000378770, 0x3d1af48, 0xc003c67830, 0xc002598000, 0xc005f0bab8, 0xc004ab3f80)
	github.com/graph-gophers/[email protected]/internal/exec/exec.go:85 +0x18d
created by github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections
	github.com/graph-gophers/[email protected]/internal/exec/exec.go:81 +0x625

context: context.Background.WithValue(type *http.contextKey, val <not Stringer>).WithValue(type *http.contextKey, val 100.120.4.160:3080).WithCancel.WithCancel.WithValue(type ot.key, val <not Stringer>).WithValue(type opentracing.contextKey, val <not Stringer>).WithValue(type opentracing.contextKey, val <not Stringer>).WithValue(type trace.key, val <not Stringer>).WithValue(type trace.key, val <not Stringer>).WithValue(type trace.key, val <not Stringer>).WithValue(type trace.key, val unknown).WithValue(type sessions.contextKey, val <not Stringer>).WithValue(type actor.key, val Actor UID 1, internal false).WithValue(type mux.contextKey, val <not Stringer>).WithValue(type mux.contextKey, val <not Stringer>).WithValue(type trace.key, val SearchResults).WithValue(type trace.key, val <not Stringer>).WithValue(type string, val
                query SearchResults($query: String!) {
                    search(query: $query) {
                        results {
                            results {
                                __typename
                                ... on FileMatch {
                                    repository {
                                        name
                                        externalURLs {
                                            url
                                        }
                                    }
                                    file {
                                        path
                                        canonicalURL
                                        externalURLs {
                                            url
                                        }
                                    }
                                    lineMatches {
                                      preview
                                      offsetAndLengths
                                    }
                                }
                            }
                        }
                    }
                }
                )