Error while trying to call ReadIndex: context deadline exceeded

Hi,

We’ve spin up 1 zero and 1 alpha docker containers and we have another container service that performs query and mutation operations to DGraph. We continue to encounter error below. Is there anything we should configure in our container for zero? Please help. Thanks!

zero | E1204 10:26:35.835508 16 node.go:713] [0x1] While trying to do lin read index: context deadline exceeded
zero | E1204 10:26:49.732154 16 node.go:660] Error while trying to call ReadIndex: context deadline exceeded
zero | W1204 10:26:49.774440 16 raft.go:788] Raft.Ready took too long to process: Timer Total: 15.13s. Breakdown: [{advance 5.424s} {disk 4.588s} {proposals 1.319s}]. Num entries: 0. MustSync: false
zero | E1204 10:26:51.141878 16 node.go:713] [0x1] While trying to do lin read index: context deadline exceeded
zero | E1204 10:27:03.523704 16 node.go:660] Error while trying to call ReadIndex: context deadline exceeded
zero | E1204 10:27:06.835512 16 node.go:713] [0x1] While trying to do lin read index: context deadline exceeded
zero | E1204 10:27:11.903326 16 node.go:660] Error while trying to call ReadIndex: context deadline exceeded
zero

Can you share details of your configs in the cluster?
Also, have you tried to start it from scratch? cuz sometimes when doing tests, killing and starting up the cluster again. Some configs get messy, so start from scratch would solve those issues.

Hi we’re just using the compose file provided by the site.
Yes, we start from scratch with docker-compose up then perform mutation/query operations.
We also have tests where we stop zero and check if we are still able to query from our alpha.

if I stop, remove all docker containers and prune system, then up compose again, is this as good as starting from scratch? Thank you.

docker-compose.yml:

zero:
image: dgraph/dgraph
container_name: zero
volumes:
- /data/db/dgraph:/dgraph
ports:
- “5080:5080”
- “6080:6080”
restart: always
command: dgraph zero --my=zero:5080
alpha:
image: dgraph/dgraph
container_name: alpha
volumes:
- /data/db/dgraph:/dgraph
ports:
- “8080:8080”
- “9080:9080”
environment:
- DGRAPH_ALPHA_LRU_MB=${DGRAPH_ALPHA_LRU_MB}
restart: always
command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --enable_sentry=false --whitelist=192.168.0.0/16,172.0.0.0/8
depends_on:
- zero

Stop this test. Dgraph’s cluster depends on the zero.

Yes, but just pruning the volumes and cleaning up the path /data/db/dgraph is already good enough.

Your YAML seems fine.