dgraph
dgraph copied to clipboard
[BUG]: crash gracefully when dgraph binary version is incompatible with data on disk
What version of Dgraph are you using?
Dgraph version : v23.1.0
Dgraph codename : dgraph
Dgraph SHA-256 : 2b0d2fb977807f9d681c3a8e5f67a6fb133c99c772009158107aa6b1ac4cbd10
Commit SHA-1 : 2b18d19
Commit timestamp : 2023-08-17 13:27:10 -0500
Branch : HEAD
Go version : go1.19.12
jemalloc enabled : true
Tell us a little more about your go-environment?
Running in Docker, so not using Go
Have you tried reproducing the issue with the latest release?
Yes
What is the hardware spec (RAM, CPU, OS)?
Kubernetes, 32 GB nodes, amd64
What steps will reproduce the bug?
- Open Ratel's UI.
- Select the dhraph alpha endpoint (in my case, http://10.45.220.6:8080)
- Connection is established.
- Click on "schema"
- dgraph-alhpa-{0,1,2} all crash.
Expected behavior and actual result.
No response
Additional information
2023/09/05 18:07:18 strconv.ParseUint: parsing "\x00\x00\x00\x00\x00\x00\x00\x00dgraph.graphql": invalid syntax
github.com/dgraph-io/dgraph/x.Check
/home/runner/work/dgraph/dgraph/x/error.go:42
github.com/dgraph-io/dgraph/x.strToUint
/home/runner/work/dgraph/dgraph/x/keys.go:139
github.com/dgraph-io/dgraph/x.ParseNamespaceAttr
/home/runner/work/dgraph/dgraph/x/keys.go:108
github.com/dgraph-io/dgraph/query.filterTypesForNamespace
/home/runner/work/dgraph/dgraph/query/query.go:2970
github.com/dgraph-io/dgraph/query.(*Request).Process
/home/runner/work/dgraph/dgraph/query/query.go:2958
github.com/dgraph-io/dgraph/edgraph.processQuery
/home/runner/work/dgraph/dgraph/edgraph/server.go:1433
github.com/dgraph-io/dgraph/edgraph.(*Server).doQuery
/home/runner/work/dgraph/dgraph/edgraph/server.go:1349
github.com/dgraph-io/dgraph/edgraph.(*Server).QueryNoGrpc
/home/runner/work/dgraph/dgraph/edgraph/server.go:1218
github.com/dgraph-io/dgraph/dgraph/cmd/alpha.queryHandler
/home/runner/work/dgraph/dgraph/dgraph/cmd/alpha/http.go:260
net/http.HandlerFunc.ServeHTTP
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2109
net/http.(*ServeMux).ServeHTTP
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2487
github.com/dgraph-io/dgraph/ee/audit.AuditRequestHttp.func1
/home/runner/work/dgraph/dgraph/ee/audit/interceptor_ee.go:93
net/http.HandlerFunc.ServeHTTP
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2109
net/http.(*ServeMux).ServeHTTP
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2487
net/http.serverHandler.ServeHTTP
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:2947
net/http.(*conn).serve
/opt/hostedtoolcache/go/1.19.12/x64/src/net/http/server.go:1991
runtime.goexit
/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/asm_amd64.s:1594
It seems to me that you have upgraded your dgraph binary to a new version, and the old and the new version are not compatible. What you should do instead is, run the old version of dgraph, export the data and then import it into a new cluster running newer version of dgraph.
Perhaps a version check warning me of this rather than crashing with what seems like normal activity would be warranted. :)
That said, yes, I allowed dgraph to update over time (this is a test lab) and was using :latest
tag, so I got what I deserved I suppose, but a crash in something that is often very critical from user input seems bad as well.
yeah, that is reasonable. Please keep the issue open, I will update the title.
This issue has been stale for 60 days and will be closed automatically in 7 days. Comment to keep it open.