Report a Dgraph Bug
What version of Dgraph are you using?
20.11.3
Have you tried reproducing the issue with the latest release?
NO
What is the hardware spec (RAM, OS)?
Ubuntu, Microk8s, 16GB RAM
Steps
Simple mutation as below
Stack Trace
E0423 17:30:12.196838 16 panics.go:34] panic: runtime error: invalid memory address or nil pointer dereference.
query: mutation {
addUser(input: {user: { username: "challap"}} ) {
user {
username
}
}
}
trace: goroutine 637 [running]:
runtime/debug.Stack(0xc007b22928, 0x1bc90c0, 0x2997600)
/usr/local/go/src/runtime/debug/stack.go:24 +0x9f
github.com/dgraph-io/dgraph/graphql/api.PanicHandler(0xc007b23778, 0xc006e84c00, 0x3df)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/api/panics.go:34 +0x73
panic(0x1bc90c0, 0x2997600)
/usr/local/go/src/runtime/panic.go:969 +0x1b9
github.com/dgraph-io/dgraph/graphql/schema.(*fieldDefinition).Type(0xc00775b380, 0xc006e84c20, 0x4)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/schema/wrappers.go:1832 +0x3e
github.com/dgraph-io/dgraph/graphql/resolve.existenceQueries(0x1f986a0, 0xc00775a7b0, 0x1fb0ba0, 0xc007275e20, 0x0, 0x0, 0xc0006d0c10, 0xc00775b2f0, 0xc0078218e0, 0x7ff91e4af748, ...)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/mutation_rewriter.go:1589 +0xc8f
github.com/dgraph-io/dgraph/graphql/resolve.(*AddRewriter).RewriteQueries(0xc00775b080, 0x1f986a0, 0xc00775a7b0, 0x1fb3740, 0xc00775b050, 0xc007b23098, 0xb20e9a, 0xc006d13970, 0x1d795ad, 0x3)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/mutation_rewriter.go:262 +0x525
github.com/dgraph-io/dgraph/graphql/resolve.(*dgraphResolver).rewriteAndExecute(0xc00775b0b0, 0x1f986a0, 0xc00775a7b0, 0x1fb3740, 0xc00775b050, 0x0, 0xc007b23500)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/mutation.go:267 +0x322
github.com/dgraph-io/dgraph/graphql/resolve.(*dgraphResolver).Resolve(0xc00775b0b0, 0x1f986a0, 0xc00775a7b0, 0x1fb3740, 0xc00775b050, 0x0, 0x1f98600)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/mutation.go:198 +0x35f
github.com/dgraph-io/dgraph/graphql/resolve.(*RequestResolver).Resolve(0xc000675a80, 0x1f986a0, 0xc00775a7b0, 0xc006abf680, 0xc007708370)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/resolve/resolver.go:538 +0x651
github.com/dgraph-io/dgraph/graphql/web.(*graphqlHandler).ServeHTTP(0xc000110260, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/web/http.go:228 +0x3b3
github.com/dgraph-io/graphql-transport-ws/graphqlws.NewHandlerFunc.func1(0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/go/pkg/mod/github.com/dgraph-io/graphql-transport-ws@v0.0.0-20200916064635-48589439591b/graphqlws/http.go:39 +0xd5
net/http.HandlerFunc.ServeHTTP(0xc0000c5110, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/usr/local/go/src/net/http/server.go:2042 +0x44
github.com/dgraph-io/dgraph/graphql/web.commonHeaders.func1(0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/web/http.go:332 +0x266
net/http.HandlerFunc.ServeHTTP(0xc000110280, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/usr/local/go/src/net/http/server.go:2042 +0x44
github.com/dgraph-io/dgraph/graphql/web.recoveryHandler.func1(0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/ext-go/1/src/github.com/dgraph-io/dgraph/graphql/web/http.go:345 +0xb1
net/http.HandlerFunc.ServeHTTP(0xc0001102a0, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/usr/local/go/src/net/http/server.go:2042 +0x44
net/http.(*ServeMux).ServeHTTP(0x2bbbe40, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/usr/local/go/src/net/http/server.go:2417 +0x1ad
net/http.serverHandler.ServeHTTP(0xc0004f00e0, 0x1f91ea0, 0xc00647a0e0, 0xc006406e00)
/usr/local/go/src/net/http/server.go:2843 +0xa3
net/http.(*conn).serve(0xc00617b7c0, 0x1f985e0, 0xc006abf540)
/usr/local/go/src/net/http/server.go:1925 +0x8ad
created by net/http.(*Server).Serve
/usr/local/go/src/net/http/server.go:2969 +0x36c