dGraph Server crash and cannot start after restart

Hi,

I run my dGraph dev stack with docker compose:

version: "3.2"
services:
  zero:
    image: dgraph/dgraph:master
    volumes:
      - type: bind
        source: /data/dgraph/data
        target: /dgraph
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --my=zero:5080
  server:
    image: dgraph/dgraph:master
    volumes:
      - type: bind
        source: /data/dgraph/data
        target: /dgraph
      - type: bind
        source: /data/dgraph/ssl
        target: /etc/ssl/private
    ports:
      - 9080:9080
      - 8080:8080
    restart: on-failure
    command: dgraph server --debugmode --my=server:7080 --lru_mb=2048 --zero=zero:5080
  ratel:  
    image: dgraph/dgraph:master
    volumes:
      - type: volume
        source: dgraph
        target: /dgraph
        volume:
          nocopy: true
    ports:
      - 8000:8000
    command: dgraph-ratel

volumes:
  dgraph:
    

This morning when I came to work and woke up my PC I can see this errors and dgraph server is not running:

ratel_1   | 2018/06/06 07:58:54 Listening on port 8000...
zero_1    | Setting up grpc listener at: 0.0.0.0:5080
zero_1    | Setting up http listener at: 0.0.0.0:6080
zero_1    | 2018/06/06 07:58:54 node.go:213: Found Snapshot, Metadata: {ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:4992 Term:5 XXX_unrecognized:[]}
zero_1    | 2018/06/06 07:58:54 node.go:228: Found hardstate: {Term:61 Vote:1 Commit:5845 XXX_unrecognized:[]}
zero_1    | 2018/06/06 07:58:54 node.go:240: Group 0 found 853 entries
zero_1    | 2018/06/06 07:58:54 raft.go:420: Restarting node for dgraphzero
zero_1    | 2018/06/06 07:58:54 pool.go:158: Echo error from server:7080. Err: rpc error: code = Unavailable desc = all SubConns are in TransientFailure
zero_1    | 2018/06/06 07:58:54 pool.go:108: == CONNECT ==> Setting server:7080
zero_1    | 2018/06/06 07:58:54 raft.go:567: INFO: 1 became follower at term 61
zero_1    | 2018/06/06 07:58:54 raft.go:315: INFO: newRaft 1 [peers: [1], term: 61, commit: 5845, applied: 4992, lastindex: 5845, lastterm: 61]
zero_1    | Running Dgraph zero...
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [is.attribute.hash], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [is.attribute.hash], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [is.attribute.hash], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [is.attribute.hash], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [pass], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [user], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [user], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [is.attribute.hash], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [organization.street], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [organization.street], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [organization.street], gid: [1]
zero_1    | 2018/06/06 07:58:54 raft.go:325: Removing tablet for attr: [organization.street], gid: [1]
zero_1    | 2018/06/06 07:58:57 raft.go:749: INFO: 1 is starting a new election at term 61
zero_1    | 2018/06/06 07:58:57 raft.go:580: INFO: 1 became candidate at term 62
zero_1    | 2018/06/06 07:58:57 raft.go:664: INFO: 1 received MsgVoteResp from 1 at term 62
zero_1    | 2018/06/06 07:58:57 raft.go:621: INFO: 1 became leader at term 62
zero_1    | 2018/06/06 07:58:57 node.go:301: INFO: raft.node: 1 elected leader 1 at term 62
server_1  | 2018/06/06 07:58:59 groups.go:78: Current Raft Id: 1
server_1  | 2018/06/06 07:58:59 gRPC server started.  Listening on port 9080
server_1  | 2018/06/06 07:58:59 HTTP server started.  Listening on port 8080
server_1  | 2018/06/06 07:58:59 worker.go:89: Worker listening at address: [::]:7080
server_1  | 2018/06/06 07:58:59 pool.go:108: == CONNECT ==> Setting zero:5080
zero_1    | 2018/06/06 07:58:59 zero.go:336: Got connection request: id:1 addr:"server:7080" 
zero_1    | 2018/06/06 07:58:59 zero.go:445: Connected
server_1  | 2018/06/06 07:58:59 groups.go:105: Connected to group zero. Assigned group: 0
server_1  | 2018/06/06 07:58:59 draft.go:170: Node ID: 1 with GroupID: 1
server_1  | 2018/06/06 07:58:59 node.go:213: Found Snapshot, Metadata: {ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:992 Term:10 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:58:59 node.go:228: Found hardstate: {Term:52 Vote:1 Commit:4083 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:58:59 node.go:240: Group 1 found 3091 entries
server_1  | 2018/06/06 07:58:59 draft.go:926: Restarting node for group: 1
server_1  | 2018/06/06 07:58:59 raft.go:567: INFO: 1 became follower at term 52
server_1  | 2018/06/06 07:58:59 raft.go:315: INFO: newRaft 1 [peers: [1], term: 52, commit: 4083, applied: 992, lastindex: 4083, lastterm: 52]
zero_1    | 2018/06/06 07:59:04 oracle.go:388: No healthy connection found to leader of group 1
server_1  | panic: runtime error: slice bounds out of range
server_1  | 
server_1  | goroutine 10587 [running]:
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).parseKV(0xc44d5243f0, 0xca0fbf5fcaed, 0x1f1)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:118 +0x546
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).Next(0xc44d5243f0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:154 +0x1e5
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).next(0xc447ca6a80)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:348 +0xb9
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).Next(0xc447ca6a80)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:399 +0x46
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*ConcatIterator).Next(0xc42ed5e1e0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:509 +0x33
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y.(*MergeIterator).Next(0xc42ed5e320)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y/iterator.go:216 +0x54
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).parseItem(0xc420150000, 0xc43d982001)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:476 +0x44e
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).Next(0xc420150000)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:389 +0x14d
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).calculateTabletSizes(0xc420110080, 0x0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:208 +0x23a
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).periodicMembershipUpdate(0xc420110080)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:474 +0x60
server_1  | created by github.com/dgraph-io/dgraph/worker.StartRaftNodes
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:123 +0x85b
zero_1    | 2018/06/06 07:59:11 zero.go:336: Got connection request: id:1 addr:"server:7080" 
zero_1    | 2018/06/06 07:59:11 zero.go:445: Connected
zero_1    | 2018/06/06 07:59:14 oracle.go:394: Error while fetching minTs from group 1, err: rpc error: code = Unavailable desc = all SubConns are in TransientFailure
zero_1    | 2018/06/06 07:59:14 pool.go:158: Echo error from server:7080. Err: rpc error: code = Unavailable desc = all SubConns are in TransientFailure
dgraph_server_1 exited with code 2
server_1  | 2018/06/06 07:58:59 groups.go:78: Current Raft Id: 1
server_1  | 2018/06/06 07:58:59 gRPC server started.  Listening on port 9080
server_1  | 2018/06/06 07:58:59 HTTP server started.  Listening on port 8080
server_1  | 2018/06/06 07:58:59 worker.go:89: Worker listening at address: [::]:7080
server_1  | 2018/06/06 07:58:59 pool.go:108: == CONNECT ==> Setting zero:5080
server_1  | 2018/06/06 07:58:59 groups.go:105: Connected to group zero. Assigned group: 0
server_1  | 2018/06/06 07:58:59 draft.go:170: Node ID: 1 with GroupID: 1
server_1  | 2018/06/06 07:58:59 node.go:213: Found Snapshot, Metadata: {ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:992 Term:10 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:58:59 node.go:228: Found hardstate: {Term:52 Vote:1 Commit:4083 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:58:59 node.go:240: Group 1 found 3091 entries
server_1  | 2018/06/06 07:58:59 draft.go:926: Restarting node for group: 1
server_1  | 2018/06/06 07:58:59 raft.go:567: INFO: 1 became follower at term 52
server_1  | 2018/06/06 07:58:59 raft.go:315: INFO: newRaft 1 [peers: [1], term: 52, commit: 4083, applied: 992, lastindex: 4083, lastterm: 52]
server_1  | panic: runtime error: slice bounds out of range
server_1  | 
server_1  | goroutine 10587 [running]:
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).parseKV(0xc44d5243f0, 0xca0fbf5fcaed, 0x1f1)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:118 +0x546
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).Next(0xc44d5243f0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:154 +0x1e5
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).next(0xc447ca6a80)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:348 +0xb9
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).Next(0xc447ca6a80)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:399 +0x46
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*ConcatIterator).Next(0xc42ed5e1e0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:509 +0x33
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y.(*MergeIterator).Next(0xc42ed5e320)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y/iterator.go:216 +0x54
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).parseItem(0xc420150000, 0xc43d982001)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:476 +0x44e
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).Next(0xc420150000)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:389 +0x14d
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).calculateTabletSizes(0xc420110080, 0x0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:208 +0x23a
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).periodicMembershipUpdate(0xc420110080)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:474 +0x60
server_1  | created by github.com/dgraph-io/dgraph/worker.StartRaftNodes
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:123 +0x85b
server_1  | 2018/06/06 07:59:11 groups.go:78: Current Raft Id: 1
server_1  | 2018/06/06 07:59:11 gRPC server started.  Listening on port 9080
server_1  | 2018/06/06 07:59:11 HTTP server started.  Listening on port 8080
server_1  | 2018/06/06 07:59:11 worker.go:89: Worker listening at address: [::]:7080
server_1  | 2018/06/06 07:59:11 pool.go:108: == CONNECT ==> Setting zero:5080
server_1  | 2018/06/06 07:59:11 groups.go:105: Connected to group zero. Assigned group: 0
server_1  | 2018/06/06 07:59:11 draft.go:170: Node ID: 1 with GroupID: 1
server_1  | 2018/06/06 07:59:12 node.go:213: Found Snapshot, Metadata: {ConfState:{Nodes:[1] XXX_unrecognized:[]} Index:992 Term:10 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:59:12 node.go:228: Found hardstate: {Term:52 Vote:1 Commit:4083 XXX_unrecognized:[]}
server_1  | 2018/06/06 07:59:12 node.go:240: Group 1 found 3091 entries
server_1  | 2018/06/06 07:59:12 draft.go:926: Restarting node for group: 1
server_1  | 2018/06/06 07:59:12 raft.go:567: INFO: 1 became follower at term 52
server_1  | 2018/06/06 07:59:12 raft.go:315: INFO: newRaft 1 [peers: [1], term: 52, commit: 4083, applied: 992, lastindex: 4083, lastterm: 52]
server_1  | panic: runtime error: slice bounds out of range
server_1  | 
server_1  | goroutine 10633 [running]:
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).parseKV(0xc4366c3050, 0xca0fbf5fcaed, 0x1f1)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:118 +0x546
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*blockIterator).Next(0xc4366c3050)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:154 +0x1e5
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).next(0xc4473ea900)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:348 +0xb9
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*Iterator).Next(0xc4473ea900)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:399 +0x46
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table.(*ConcatIterator).Next(0xc42f7e6320)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/table/iterator.go:509 +0x33
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y.(*MergeIterator).Next(0xc42f7e6460)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/y/iterator.go:216 +0x54
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).parseItem(0xc42011c070, 0xc44ad6a001)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:476 +0x44e
server_1  | github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger.(*Iterator).Next(0xc42011c070)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/vendor/github.com/dgraph-io/badger/iterator.go:389 +0x14d
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).calculateTabletSizes(0xc4203d4280, 0x0)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:208 +0x23a
server_1  | github.com/dgraph-io/dgraph/worker.(*groupi).periodicMembershipUpdate(0xc4203d4280)
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:474 +0x60
server_1  | created by github.com/dgraph-io/dgraph/worker.StartRaftNodes
server_1  | 	/home/travis/gopath/src/github.com/dgraph-io/dgraph/worker/groups.go:123 +0x85b

How can I fix it?

Hi, just try running it with the latest release v 1.0.5 , masters is not the latest one. It seems there is some data which is causing server to crash.

1 Like

@karan28aug. Thanks, it’s works.