Feeding data in dgraph (step-1 tour/moredata) is crashing

Moved from GitHub tutorial/130

Posted by Nishchit14:

I am getting this error on this step, https://tour.dgraph.io/moredata/1/

stacktrace

➜  dgraph docker exec -it dgraph dgraph live -f 1million.rdf.gz --alpha localhost:9080 --zero localhost:5080 -c 1 
[Decoder]: Using assembly version of decoder
I0326 08:50:13.525035      21 init.go:98] 

Dgraph version   : v1.2.2
Dgraph SHA-256   : 86e27921d3a53dbc4faba78e9c7d7879ce8bafd6006c9fd4b77220535b8ae1c2
Commit SHA-1     : 21cc8936
Commit timestamp : 2020-03-19 12:13:11 -0700
Branch           : HEAD
Go version       : go1.13.5

For Dgraph official documentation, visit https://docs.dgraph.io.
For discussions about Dgraph     , visit http://discuss.dgraph.io.
To say hi to the community       , visit https://dgraph.slack.com.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2018 Dgraph Labs, Inc.



Running transaction with dgraph endpoint: localhost:9080
While trying to setup connection: context deadline exceeded. Retrying...
2020/03/26 08:50:24 Could not setup connection after 1 retries
github.com/dgraph-io/dgraph/x.Fatalf
	/tmp/go/src/github.com/dgraph-io/dgraph/x/error.go:101
github.com/dgraph-io/dgraph/x.GetDgraphClient
	/tmp/go/src/github.com/dgraph-io/dgraph/x/x.go:731
github.com/dgraph-io/dgraph/dgraph/cmd/live.run
	/tmp/go/src/github.com/dgraph-io/dgraph/dgraph/cmd/live/run.go:398
github.com/dgraph-io/dgraph/dgraph/cmd/live.init.0.func1
	/tmp/go/src/github.com/dgraph-io/dgraph/dgraph/cmd/live/run.go:117
github.com/spf13/cobra.(*Command).execute
	/tmp/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:830
github.com/spf13/cobra.(*Command).ExecuteC
	/tmp/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914
github.com/spf13/cobra.(*Command).Execute
	/tmp/go/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/dgraph-io/dgraph/dgraph/cmd.Execute
	/tmp/go/src/github.com/dgraph-io/dgraph/dgraph/cmd/root.go:69
main.main
	/tmp/go/src/github.com/dgraph-io/dgraph/dgraph/main.go:73
runtime.main
	/usr/local/go/src/runtime/proc.go:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1357

MichelDiz commented :

I have no issues with it.

You are probably confusing some step in the process. Please check that the container named “dgraph” is running. Use docker ps, in the field ‘NAMES’ you should see dgraph.

This error is saying that there is no connection to the cluster (Zero + Alpha). Since this step is using the same container, this error should not occur.

This error would only happen in two scenarios.

1 - You are executing the Live load in another container and that means that the dgraph will not be in “localhost”. But in the name of the container for example “zero: 6080, alpha: 9080” or something similar.

2 - Alpha and Zero have not been started.

Test these steps:

  1. docker pull dgraph/dgraph
  2. docker run -it -p 5080:5080 -p 6080:6080 -p 8080:8080 -p 9080:9080 -p 8000:8000 --name dgraph dgraph/dgraph dgraph zero

Note that I have removed the volume binding

  1. docker exec -it dgraph dgraph alpha --lru_mb 2048 --zero localhost:5080
  2. docker exec -it dgraph sh
  3. curl -L -o 1million.rdf.gz "https://github.com/dgraph-io/tutorial/blob/master/resources/1million.rdf.gz?raw=true"
  4. curl -L -o 1million.schema https://raw.githubusercontent.com/dgraph-io/benchmarks/master/data/1million.schema
  5. exit
  6. docker exec -it dgraph dgraph live -f 1million.rdf.gz --alpha localhost:9080 --zero localhost:5080 -c 1 -s 1million.schema

You should see:

docker exec -it dgraph dgraph live -f 1million.rdf.gz --alpha localhost:9080 --zero localhost:5080 -c 1 -s 1million.schema
[Decoder]: Using assembly version of decoder
I0331 17:32:55.686207     232 init.go:99] 

Dgraph version   : v20.03.0
Dgraph SHA-256   : 07e63901be984bd20a3505a2ee5840bb8fc4f72cc7749c485f9f77db15b9b75a
Commit SHA-1     : 147c8df9
Commit timestamp : 2020-03-30 17:28:31 -0700
Branch           : HEAD
Go version       : go1.14.1

For Dgraph official documentation, visit https://docs.dgraph.io.
For discussions about Dgraph     , visit http://discuss.dgraph.io.
To say hi to the community       , visit https://dgraph.slack.com.

Licensed variously under the Apache Public License 2.0 and Dgraph Community License.
Copyright 2015-2020 Dgraph Labs, Inc.



Running transaction with dgraph endpoint: localhost:9080

Processing schema file "1million.schema"
Processed schema file "1million.schema"

Found 1 data file(s) to process
Processing data file "1million.rdf.gz"
[17:33:04Z] Elapsed: 05s Txns: 35 N-Quads: 35000 N-Quads/s [last 5s]:  7000 Aborts: 0
[17:33:09Z] Elapsed: 10s Txns: 70 N-Quads: 70000 N-Quads/s [last 5s]:  7000 Aborts: 0
[17:33:14Z] Elapsed: 15s Txns: 155 N-Quads: 155000 N-Quads/s [last 5s]: 17000 Aborts: 0
[17:33:19Z] Elapsed: 20s Txns: 232 N-Quads: 232000 N-Quads/s [last 5s]: 15400 Aborts: 0
[17:33:24Z] Elapsed: 25s Txns: 325 N-Quads: 325000 N-Quads/s [last 5s]: 18600 Aborts: 0
[17:33:29Z] Elapsed: 30s Txns: 417 N-Quads: 417000 N-Quads/s [last 5s]: 18400 Aborts: 0
[17:33:34Z] Elapsed: 35s Txns: 515 N-Quads: 515000 N-Quads/s [last 5s]: 19600 Aborts: 0
[17:33:39Z] Elapsed: 40s Txns: 608 N-Quads: 608000 N-Quads/s [last 5s]: 18600 Aborts: 0
[17:33:44Z] Elapsed: 45s Txns: 700 N-Quads: 700000 N-Quads/s [last 5s]: 18400 Aborts: 0
[17:33:49Z] Elapsed: 50s Txns: 797 N-Quads: 797000 N-Quads/s [last 5s]: 19400 Aborts: 0
[17:33:54Z] Elapsed: 55s Txns: 924 N-Quads: 924000 N-Quads/s [last 5s]: 25400 Aborts: 0
Number of TXs run            : 1042                                                                 
Number of N-Quads processed  : 1041684
Time spent                   : 1m1.987822161s
N-Quads processed per second : 17076

Cheers.