dgraph-io/dgraph · error

REUSE_ADDR: Duplicate address to existing member: %+v. Self:

Error message

REUSE_ADDR: Duplicate address to existing member: %+v. Self: +%v

What it means

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 +).

Source

Thrown at dgraph/cmd/zero/zero.go:569

		}
	}

	numberOfNodes := len(ms.Zeros)
	for _, group := range ms.Groups {
		for _, member := range group.Members {
			switch {
			case member.Addr == m.Addr && m.Id == 0:
				glog.Infof("Found a member with the same address. Returning: %+v", member)
				conn.GetPools().Connect(m.Addr, s.tlsClientConfig)
				return &pb.ConnectionState{
					State:  ms,
					Member: member,
				}, nil

			case member.Addr == m.Addr && member.Id != m.Id:
				// Same address. Different Id. If Id is zero, then it might be trying to connect for
				// the first time. We can just directly return the membership information.
				return nil, errors.Errorf("REUSE_ADDR: Duplicate address to existing member: %+v."+
					" Self: +%v", member, m)

			case member.Addr != m.Addr && member.Id == m.Id:
				// Same Id. Different address.
				if pl, err := conn.GetPools().Get(member.Addr); err == nil && pl.IsHealthy() {
					// Found a healthy connection.
					return nil, errors.Errorf("REUSE_RAFTID: Healthy connection to a member"+
						" with same ID: %+v", member)
				}
			}
			numberOfNodes++
		}
	}

	// Create a connection and check validity of the address by doing an Echo.
	conn.GetPools().Connect(m.Addr, s.tlsClientConfig)

	createProposal := func() *pb.ZeroProposal {

View on GitHub (pinned to 759e242be6)

Solutions

  1. Ensure the re-provisioned node keeps its original Raft ID (restore p directory) or use a new unique address via --my.
  2. Fix networking so every dgraph server has a unique, directly reachable --my address (avoid shared service IPs for membership).
  3. Check /state on Zero to find which member owns the address and remove/reconfigure the conflicting node.
  4. Correct duplicate --my flags in deployment manifests (StatefulSet pod identity, hostPort collisions).

Example fix

// before
dgraph alpha --my=alpha-svc:7080 --raft "id=9" // alpha-svc already owned by id=2

// after
dgraph alpha --my=alpha3.default.svc:7080 --raft "id=9"
Defensive patterns

Strategy: validation

Validate before calling

state := fetchZeroState("http://zero:6080/state")
for _, groups := range state.Groups {
    for id, m := range groups.Members {
        if m.Addr == myAddr && id != myRaftID {
            return fmt.Errorf("address %s already owned by member id %d", myAddr, id)
        }
    }
}

Try / catch

_, err := zc.Connect(ctx, m)
if err != nil && strings.Contains(err.Error(), "REUSE_ADDR") {
    return fmt.Errorf("address %s is taken by another member; fix --my or networking: %w", m.Addr, err)
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dgraph-io/dgraph@759e242be6 (2026-09-01). Data as JSON: /api/errors/eb80f716c915ea00. Report an issue: GitHub.