slackhq/nebula · error

tun.unsafe_routes is not an array

Error message

tun.unsafe_routes is not an array

What it means

Config validation error in parseUnsafeRoutes: the value at tun.unsafe_routes did not type-assert to []any — it is present but not a YAML list (e.g. a scalar or map). The whole setting is rejected before any entry is parsed.

Source

Thrown at overlay/route.go:159

		}

		routes[i] = r
	}

	return routes, nil
}

func parseUnsafeRoutes(c *config.C, networks []netip.Prefix) ([]Route, error) {
	var err error

	r := c.Get("tun.unsafe_routes")
	if r == nil {
		return []Route{}, nil
	}

	rawRoutes, ok := r.([]any)
	if !ok {
		return nil, fmt.Errorf("tun.unsafe_routes is not an array")
	}

	if len(rawRoutes) < 1 {
		return []Route{}, nil
	}

	routes := make([]Route, len(rawRoutes))
	for i, r := range rawRoutes {
		m, ok := r.(map[string]any)
		if !ok {
			return nil, fmt.Errorf("entry %v in tun.unsafe_routes is invalid", i+1)
		}

		var mtu int
		if rMtu, ok := m["mtu"]; ok {
			mtu, ok = rMtu.(int)
			if !ok {
				mtu, err = strconv.Atoi(rMtu.(string))

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Write tun.unsafe_routes as a YAML list of mappings
  2. Check indentation so the setting is not parsed as a string/map
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at overlay/route.go:159 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of slackhq/nebula@dd8f660c0a (2026-09-03). Data as JSON: /api/errors/09c9aacae38d651a. Report an issue: GitHub.