slackhq/nebula · error

static_map.network must be one of ip, ip4, or ip6

Error message

static_map.network must be one of ip, ip4, or ip6

What it means

getStaticMapNetwork validates the static_map.network config value. Only 'ip', 'ip4', or 'ip6' are accepted; any other string makes config parsing fail, because the value controls which address family static_map.hosts entries resolve to.

Source

Thrown at lighthouse.go:435

	if err != nil {
		return 0, err
	}
	return d, nil
}

func getStaticMapLookupTimeout(c *config.C) (time.Duration, error) {
	lookupTimeout := c.GetString("static_map.lookup_timeout", "250ms")
	d, err := time.ParseDuration(lookupTimeout)
	if err != nil {
		return 0, err
	}
	return d, nil
}

func getStaticMapNetwork(c *config.C) (string, error) {
	network := c.GetString("static_map.network", "ip4")
	if network != "ip" && network != "ip4" && network != "ip6" {
		return "", fmt.Errorf("static_map.network must be one of ip, ip4, or ip6")
	}
	return network, nil
}

func (lh *LightHouse) loadStaticMap(c *config.C, staticList map[netip.Addr]struct{}) error {
	d, err := getStaticMapCadence(c)
	if err != nil {
		return err
	}

	network, err := getStaticMapNetwork(c)
	if err != nil {
		return err
	}

	lookupTimeout, err := getStaticMapLookupTimeout(c)
	if err != nil {
		return err

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Set static_map.network to exactly ip, ip4, or ip6
  2. Remove the static_map.network key to use the ip4 default
  3. Check for case sensitivity and whitespace in the YAML value

Example fix

// before
static_map:
  network: ipv4
// after
static_map:
  network: ip4
Defensive patterns

Strategy: validation

Validate before calling

network := c.GetString("static_map.network", "ip4")
if network != "ip" && network != "ip4" && network != "ip6" {
    return errors.New("static_map.network must be one of ip, ip4, or ip6")
}

Prevention

When it happens

Trigger: Configuring static_map.network with a value other than ip/ip4/ip6, e.g. 'ipv4', 'IPv6', 'tcp4', or an empty custom string.

Common situations: Typo like 'ipv4' instead of 'ip4'; capitalized value (config values are case-sensitive here); copying an example that used a different schema.

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 slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/0626266835be1a8e. Report an issue: GitHub.