slackhq/nebula · error

entry %v.mtu in tun.unsafe_routes is not an integer: %v

Error message

entry %v.mtu in tun.unsafe_routes is not an integer: %v

What it means

Config validation error in parseUnsafeRoutes: the `mtu` key of the i+1-th tun.unsafe_routes entry is neither an int nor a string parseable by strconv.Atoi. YAML gave a non-integer scalar (float, bool-as-word, etc.); the Atoi error is included.

Source

Thrown at overlay/route.go:179

	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))
				if err != nil {
					return nil, fmt.Errorf("entry %v.mtu in tun.unsafe_routes is not an integer: %v", i+1, err)
				}
			}

			if mtu != 0 && mtu < 500 {
				return nil, fmt.Errorf("entry %v.mtu in tun.unsafe_routes is below 500: %v", i+1, mtu)
			}
		}

		rMetric, ok := m["metric"]
		if !ok {
			rMetric = 0
		}

		metric, ok := rMetric.(int)
		if !ok {
			_, err = strconv.ParseInt(rMetric.(string), 10, 32)
			if err != nil {
				return nil, fmt.Errorf("entry %v.metric in tun.unsafe_routes is not an integer: %v", i+1, err)

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Write mtu as a plain integer (e.g. 1500), quoted or not
  2. Avoid float notation like 1500.0
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at overlay/route.go:179 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/47eae3c0f4798338. Report an issue: GitHub.