{"record":{"id":"e5b8362a14eb903e","repo":"dgraph-io/dgraph","slug":"failed-to-get-connection-pool-for-group-d","errorCode":null,"errorMessage":"failed to get connection pool for group %d","messagePattern":"failed to get connection pool for group (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"worker/draft.go","lineNumber":730,"sourceCode":"\t\t\tx.ExtSnapshotStreamingState(true)\n\t\t\treturn nil\n\t\tcase proposal.ExtSnapshotState.DropData:\n\t\t\t// When DropData is true, it implies that there was some issue with import (e.g. some group\n\t\t\t// may have started streaming but not finished or streaming never started because p directory\n\t\t\t// was not there). We can't be certain if we have disabled x.UpdateExtSnapshotStreamingState or\n\t\t\t// not, so we are disabling it here:\n\t\t\tx.ExtSnapshotStreamingState(false)\n\t\t\tif err := posting.DeleteAll(); err != nil {\n\t\t\t\tglog.Errorf(\"[import] failed to delete all data: %v\", err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\treturn nil\n\t\tcase proposal.ExtSnapshotState.Finish && x.IsExtSnapshotStreamingStateTrue():\n\t\t\tlastApplied := n.Applied.LastIndex()\n\t\t\tpl := groups().Leader(n.gid)\n\t\t\tif pl == nil {\n\t\t\t\tglog.Errorf(\"[import] failed to get connection pool for group %d\", n.gid)\n\t\t\t\treturn errors.Errorf(\"failed to get connection pool for group %d\", n.gid)\n\t\t\t}\n\t\t\tglog.Infof(\"[import] requesting snapshot from leader\")\n\t\t\tsnap := &pb.Snapshot{\n\t\t\t\tContext: n.RaftContext,\n\t\t\t\tIndex:   lastApplied,\n\t\t\t\tReadTs:  State.GetTimestamp(false),\n\t\t\t}\n\t\t\t// Request and populate snapshot\n\t\t\tif err := n.populateSnapshot(snap, pl); err != nil {\n\t\t\t\tglog.Errorf(\"[import] failed to populate snapshot for rejoining node: %v\", err)\n\t\t\t\treturn errors.Wrapf(err, \"failed to populate snapshot for rejoining node\")\n\t\t\t}\n\n\t\t\tif err := postStreamProcessing(ctx); err != nil {\n\t\t\t\tglog.Errorf(\"[import] failed to post stream processing for rejoining node: %v\", err)\n\t\t\t\treturn errors.Wrapf(err, \"failed to post stream processing for rejoining node\")\n\t\t\t}\n\t\t\tglog.Infof(\"[import] successfully rejoined node\")","sourceCodeStart":712,"sourceCodeEnd":748,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/worker/draft.go#L712-L748","documentation":"Raised in applyCommitted (worker/draft.go:730) while finishing external snapshot streaming: the node needs its group leader's connection pool to request a snapshot, but groups().Leader(n.gid) returns nil because no leader is known for this group.","triggerScenarios":"An external snapshot completes (ExtSnapshotState.Finish) while the group has no leader — e.g. Zero hasn't assigned/confirmed a leader yet, the leader is down, or during a membership change after restore/import.","commonSituations":"Restoring into a cluster while Zero is still electing leaders; network partition between alphas and Zero; leader crash mid external-snapshot streaming.","solutions":["Wait for group leadership to be (re-)established; Zero will re-elect and the streaming can resume — the proposal may be retried.","Verify alphas can reach Zero and the leader on ports 5080/7080; fix connectivity.","Restart the leaderless alpha(s) so they rejoin and refresh group membership.","If Zero is down, restore Zero from its raft state and let membership converge before resuming imports."],"exampleFix":"// operational fix, not code\n// ensure all alphas register with Zero:\n# dgraph alpha --zero=z1:5080 --my=alpha:7080\n// and confirm leader exists:\n# dgraph zero --state  (or) curl localhost:6080/state","handlingStrategy":"fallback","validationCode":"if !groupHasLeader(gid) { waitForLeader(gid, timeout) }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to get connection pool for group\") {\n    time.Sleep(30 * time.Second)\n    return retryApplyOrResumeStreaming()\n}","preventionTips":["Ensure alphas always register with reachable Zero instances.","Monitor Zero's group membership for leaderless groups and alert.","Check 5080/7080 connectivity between alphas and Zero/leader.","Wait for elections to settle after restarts before resuming restore/import jobs."],"tags":["dgraph","raft","leader-election","snapshot"],"backgroundTag":"no-group-leader","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}