Skip to content

insights: panic when returning InsightsDashboardPayload on successfully attaching insight

Created by: coury-clark

Getting a panic after successfully adding an insight view to a dashboard using the mutation addInsightViewToDashboard. It seems to have something to do with the scan function here

[enterprise-frontend] graphql: panic occurred: runtime error: invalid memory address or nil pointer dereference
[enterprise-frontend] goroutine 18657 [running]:
[enterprise-frontend] github.com/graph-gophers/graphql-go/log.(*DefaultLogger).LogPanic(0x8, {0x407ade8, 0xc0041e8bd0}, {0x33be0e0, 0x5c4d590})
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/log/log.go:21 +0x65
[enterprise-frontend] github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2.1()
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:190 +0x8c
[enterprise-frontend] panic({0x33be0e0, 0x5c4d590})
[enterprise-frontend]   /usr/local/opt/go/libexec/src/runtime/panic.go:1038 +0x215
[enterprise-frontend] github.com/sourcegraph/sourcegraph/enterprise/internal/insights/store.(*InsightStore).Get(0x0, {0x407ade8, 0xc0041e8bd0}, {{0x0, 0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0, ...}, ...})
[enterprise-frontend]   /Users/couryclark/Documents/code/sourcegraph/enterprise/internal/insights/store/insight_store.go:94 +0x4a3
[enterprise-frontend] github.com/sourcegraph/sourcegraph/enterprise/internal/insights/resolvers.(*DashboardInsightViewConnectionResolver).computeConnectedViews.func1()
[enterprise-frontend]   /Users/couryclark/Documents/code/sourcegraph/enterprise/internal/insights/resolvers/dashboard_resolvers.go:219 +0x15a
[enterprise-frontend] sync.(*Once).doSlow(0x100b1ed, 0xc001e09560)
[enterprise-frontend]   /usr/local/opt/go/libexec/src/sync/once.go:68 +0xd2
[enterprise-frontend] sync.(*Once).Do(...)
[enterprise-frontend]   /usr/local/opt/go/libexec/src/sync/once.go:59
[enterprise-frontend] github.com/sourcegraph/sourcegraph/enterprise/internal/insights/resolvers.(*DashboardInsightViewConnectionResolver).computeConnectedViews(0xc0001ac300, {0x407ade8, 0xc0041e8bd0})
[enterprise-frontend]   /Users/couryclark/Documents/code/sourcegraph/enterprise/internal/insights/resolvers/dashboard_resolvers.go:199 +0x68
[enterprise-frontend] github.com/sourcegraph/sourcegraph/enterprise/internal/insights/resolvers.(*DashboardInsightViewConnectionResolver).Nodes(0xc0001ac300, {0x407ade8, 0xc0041e8bd0})
[enterprise-frontend]   /Users/couryclark/Documents/code/sourcegraph/enterprise/internal/insights/resolvers/dashboard_resolvers.go:184 +0x7a
[enterprise-frontend] reflect.Value.call({0x342d460, 0xc0027bc150, 0x18}, {0x3820f8b, 0x4}, {0xc003e68120, 0x1, 0x10bac0e})
[enterprise-frontend]   /usr/local/opt/go/libexec/src/reflect/value.go:543 +0x814
[enterprise-frontend] reflect.Value.Call({0x342d460, 0xc0027bc150, 0xc0b4da87fd}, {0xc003e68120, 0x1, 0x1})
[enterprise-frontend]   /usr/local/opt/go/libexec/src/reflect/value.go:339 +0xc5
[enterprise-frontend] github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection.func2(0xc0048ee300, {0x407ade8, 0xc0041e8bd0}, 0xc003e68108, 0xc00507e180, 0xc001e09ec0, {0x407ade8, 0xc0041e8bd0})
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:214 +0x4cb
[enterprise-frontend] github.com/graph-gophers/graphql-go/internal/exec.execFieldSelection({0x407ade8, 0xc0041e8bd0}, 0xc0005cf7a0, 0xc0035b0798, 0xc00507e180, 0xc004a1e800, 0x1)
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:234 +0x1ce
[enterprise-frontend] github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections.func1(0xc00507e180)
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:84 +0x1b4
[enterprise-frontend] created by github.com/graph-gophers/graphql-go/internal/exec.(*Request).execSelections
[enterprise-frontend]   /Users/couryclark/go/pkg/mod/github.com/graph-gophers/[email protected]/internal/exec/exec.go:80 +0x1d7
[enterprise-frontend] context: context.Background.WithValue(type *http.contextKey, val <not Stringer>).WithValue(type *http.contextKey, val [::1]:3082).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 featureflag.flagContextKey, val <not Stringer>).WithValue(type mux.contextKey, val <not Stringer>).WithValue(type mux.contextKey, val <not Stringer>).WithValue(type trace.key, val unknown).WithValue(type trace.key, val <not Stringer>).WithValue(type trace.key, val mutation addView($input:AddInsightViewToDashboardInput!) {