cloudflare/cloudflared · error

invalid value for edge-bind-address: %s

Error message

invalid value for edge-bind-address: %s

What it means

Configuration validation error in parseConfigBuildAddress: the value given for edge-bind-address (flag or config file) is non-empty but net.ParseIP cannot parse it, so cloudflared cannot determine the local address to bind edge connections to and preparation of the tunnel config fails.

Source

Thrown at cmd/cloudflared/tunnel/configuration.go:318

		v = allregions.IPv4Only
	case "6":
		v = allregions.IPv6Only
	case "auto":
		v = allregions.Auto
	default: // unspecified or invalid
		err = fmt.Errorf("invalid value for edge-ip-version: %s", version)
	}
	return
}

func parseConfigBindAddress(ipstr string) (net.IP, error) {
	// Unspecified - it's fine
	if ipstr == "" {
		return nil, nil
	}
	ip := net.ParseIP(ipstr)
	if ip == nil {
		return nil, fmt.Errorf("invalid value for edge-bind-address: %s", ipstr)
	}
	return ip, nil
}

func testIPBindable(ip net.IP) error {
	// "Unspecified" = let OS choose, so always bindable
	if ip == nil {
		return nil
	}

	addr := &net.UDPAddr{IP: ip, Port: 0}
	listener, err := net.ListenUDP("udp", addr)
	if err != nil {
		return err
	}
	_ = listener.Close()
	return nil
}

View on GitHub (pinned to 2253eeeb25)

Solutions

  1. Replace the value with a literal IP address such as `0.0.0.0`, `::`, or the host's interface IP.
  2. Resolve the hostname manually (`dig +short host`) and use the resulting IP if a hostname was intended.
  3. Remove edge-bind-address to let the OS select the address.

Example fix

// before
edge-bind-address: myhost.example.com
// after
edge-bind-address: 192.0.2.10
Defensive patterns

Strategy: validation

Validate before calling

// shell: ensure value parses as an IP literal
[[ "$EDGE_BIND_ADDR" =~ ^[0-9.]+$ || "$EDGE_BIND_ADDR" == *:* ]] || unset EDGE_BIND_ADDR
python3 -c "import ipaddress,sys; ipaddress.ip_address('$EDGE_BIND_ADDR')" || { echo 'not an IP'; exit 1; }

Prevention

When it happens

Trigger: Passing `--edge-bind-address example.com`, `10.0.0.0/24`, `localhost`, or a mistyped IP that net.ParseIP cannot parse, via flag or config.

Common situations: Using hostnames instead of literal IPs (DNS resolution is intentionally not attempted); copy-pasting a CIDR block from interface listings; trailing whitespace or quotes in YAML values.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06). Data as JSON: /api/errors/6e48abaa40d5cb77. Report an issue: GitHub.