{"record":{"id":"eb80f716c915ea00","repo":"dgraph-io/dgraph","slug":"reuse-addr-duplicate-address-to-existing-member","errorCode":null,"errorMessage":"REUSE_ADDR: Duplicate address to existing member: %+v. Self: +%v","messagePattern":"REUSE_ADDR: Duplicate address to existing member: %\\+v\\. Self: \\+(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"dgraph/cmd/zero/zero.go","lineNumber":569,"sourceCode":"\t\t}\n\t}\n\n\tnumberOfNodes := len(ms.Zeros)\n\tfor _, group := range ms.Groups {\n\t\tfor _, member := range group.Members {\n\t\t\tswitch {\n\t\t\tcase member.Addr == m.Addr && m.Id == 0:\n\t\t\t\tglog.Infof(\"Found a member with the same address. Returning: %+v\", member)\n\t\t\t\tconn.GetPools().Connect(m.Addr, s.tlsClientConfig)\n\t\t\t\treturn &pb.ConnectionState{\n\t\t\t\t\tState:  ms,\n\t\t\t\t\tMember: member,\n\t\t\t\t}, nil\n\n\t\t\tcase member.Addr == m.Addr && member.Id != m.Id:\n\t\t\t\t// Same address. Different Id. If Id is zero, then it might be trying to connect for\n\t\t\t\t// the first time. We can just directly return the membership information.\n\t\t\t\treturn nil, errors.Errorf(\"REUSE_ADDR: Duplicate address to existing member: %+v.\"+\n\t\t\t\t\t\" Self: +%v\", member, m)\n\n\t\t\tcase member.Addr != m.Addr && member.Id == m.Id:\n\t\t\t\t// Same Id. Different address.\n\t\t\t\tif pl, err := conn.GetPools().Get(member.Addr); err == nil && pl.IsHealthy() {\n\t\t\t\t\t// Found a healthy connection.\n\t\t\t\t\treturn nil, errors.Errorf(\"REUSE_RAFTID: Healthy connection to a member\"+\n\t\t\t\t\t\t\" with same ID: %+v\", member)\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumberOfNodes++\n\t\t}\n\t}\n\n\t// Create a connection and check validity of the address by doing an Echo.\n\tconn.GetPools().Connect(m.Addr, s.tlsClientConfig)\n\n\tcreateProposal := func() *pb.ZeroProposal {","sourceCodeStart":551,"sourceCodeEnd":587,"githubUrl":"https://github.com/dgraph-io/dgraph/blob/759e242be62c91f8d084da06ad0c8d21256d9c07/dgraph/cmd/zero/zero.go#L551-L587","documentation":"Zero detected two different Raft IDs claiming the same network address. When an incoming Connect request's Addr equals an existing member's Addr but the IDs differ, Zero refuses the connection because a single host cannot host two distinct Raft members and routing would be ambiguous. Note the message has a typo: \"Self: +%v\" (extra +).","triggerScenarios":"Connect with m.Addr equal to a current member's Addr while m.Id differs from that member's Id; restarting an alpha behind the same address after its Raft state was wiped (new ID), or two containers sharing a service IP/hostPort.","commonSituations":"Kubernetes services/NAT making distinct pods appear at one address; re-provisioned node with new raft ID but old address; DNS entry pointing at the wrong instance; copying config with a duplicate --my value.","solutions":["Ensure the re-provisioned node keeps its original Raft ID (restore p directory) or use a new unique address via --my.","Fix networking so every dgraph server has a unique, directly reachable --my address (avoid shared service IPs for membership).","Check /state on Zero to find which member owns the address and remove/reconfigure the conflicting node.","Correct duplicate --my flags in deployment manifests (StatefulSet pod identity, hostPort collisions)."],"exampleFix":"// before\ndgraph alpha --my=alpha-svc:7080 --raft \"id=9\" // alpha-svc already owned by id=2\n\n// after\ndgraph alpha --my=alpha3.default.svc:7080 --raft \"id=9\"","handlingStrategy":"validation","validationCode":"state := fetchZeroState(\"http://zero:6080/state\")\nfor _, groups := range state.Groups {\n    for id, m := range groups.Members {\n        if m.Addr == myAddr && id != myRaftID {\n            return fmt.Errorf(\"address %s already owned by member id %d\", myAddr, id)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"_, err := zc.Connect(ctx, m)\nif err != nil && strings.Contains(err.Error(), \"REUSE_ADDR\") {\n    return fmt.Errorf(\"address %s is taken by another member; fix --my or networking: %w\", m.Addr, err)\n}","preventionTips":["Give every dgraph server a unique --my address; don't share service IPs for raft membership.","Re-provision nodes with the same raft id and address together.","Audit k8s manifests for duplicate hostPorts/service addresses."],"tags":["dgraph-zero","membership","networking","configuration"],"backgroundTag":"duplicate-member-address","analyzedSha":"759e242be62c91f8d084da06ad0c8d21256d9c07","analyzedAt":"2026-09-01T14:42:12.034Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}