docker/cli ยท error

cannot configure multiple ranges (%s, %s) on the same subnet

Error message

cannot configure multiple ranges (%s, %s) on the same subnet (%s)

What it means

Error "cannot configure multiple ranges (%s, %s) on the same subnet (%s)" thrown in docker/cli.

Source

Thrown at cli/command/network/create.go:181

		}
		iData[s] = &network.IPAMConfig{Subnet: sn, AuxAddress: map[string]netip.Addr{}}
	}

	// Validate and add valid ip ranges
	for _, r := range options.ipRanges {
		match := false
		for _, s := range options.subnets {
			ok, err := subnetMatches(s, r.String())
			if err != nil {
				return nil, err
			}
			if !ok {
				continue
			}

			// Using "IsValid" to check if a valid IPRange was already set.
			if iData[s].IPRange.IsValid() {
				return nil, fmt.Errorf("cannot configure multiple ranges (%s, %s) on the same subnet (%s)", r.String(), iData[s].IPRange.String(), s)
			}
			if ipRange, ok := toPrefix(r); ok {
				iData[s].IPRange = ipRange
				match = true
			}
		}
		if !match {
			return nil, fmt.Errorf("no matching subnet for range %s", r.String())
		}
	}

	// Validate and add valid gateways
	for _, g := range options.gateways {
		match := false
		for _, s := range options.subnets {
			ok, err := subnetMatches(s, g.String())
			if err != nil {
				return nil, err

View on GitHub (pinned to e9452d6e78)

When it happens

Trigger: Thrown at cli/command/network/create.go:181 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of docker/cli@e9452d6e78 (2026-08-01). Data as JSON: /data/errors/5f86aea3e39682ac.json. Report an issue: GitHub.