Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: crash gracefully when dgraph binary version is incompatible with data on disk #8993

Open
skandragon opened this issue Sep 5, 2023 · 3 comments
Labels
kind/bug Something is broken.

Comments

@skandragon
Copy link

skandragon commented Sep 5, 2023

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?

  1. Open Ratel's UI.
  2. Select the dhraph alpha endpoint (in my case, http://10.45.220.6:8080)
  3. Connection is established.
  4. Click on "schema"
  5. 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
@skandragon skandragon added the kind/bug Something is broken. label Sep 5, 2023
@mangalaman93
Copy link
Contributor

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.

@skandragon
Copy link
Author

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.

@mangalaman93
Copy link
Contributor

yeah, that is reasonable. Please keep the issue open, I will update the title.

@mangalaman93 mangalaman93 changed the title [BUG]: strconv.ParseUint: parsing "\x00\x00\x00\x00\x00\x00\x00\x00dgraph.graphql": invalid syntax [BUG]: crash gracefully when dgraph binary version is incompatible with data on disk Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something is broken.
Development

No branches or pull requests

2 participants