slackhq/nebula · error

entry %v.route in tun.routes is not present

Error message

entry %v.route in tun.routes is not present

What it means

Config validation error in parseRoutes (overlay/route.go): the i+1-th entry of tun.routes lacks the required `route` key, so there is no CIDR to install. The map for that entry was read (mtu was validated just above) but contains no route prefix.

Source

Thrown at overlay/route.go:113

		if !ok {
			return nil, fmt.Errorf("entry %v.mtu in tun.routes is not present", i+1)
		}

		mtu, ok := rMtu.(int)
		if !ok {
			mtu, err = strconv.Atoi(rMtu.(string))
			if err != nil {
				return nil, fmt.Errorf("entry %v.mtu in tun.routes is not an integer: %v", i+1, err)
			}
		}

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

		rRoute, ok := m["route"]
		if !ok {
			return nil, fmt.Errorf("entry %v.route in tun.routes is not present", i+1)
		}

		r := Route{
			Install: true,
			MTU:     mtu,
		}

		r.Cidr, err = netip.ParsePrefix(fmt.Sprintf("%v", rRoute))
		if err != nil {
			return nil, fmt.Errorf("entry %v.route in tun.routes failed to parse: %v", i+1, err)
		}

		found := false
		for _, network := range networks {
			if network.Contains(r.Cidr.Addr()) && r.Cidr.Bits() >= network.Bits() {
				found = true
				break
			}

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Add a route key containing a CIDR prefix (e.g. route: 10.0.0.0/24) to the entry
  2. Check for typos: the key must be exactly route
  3. Use the reported entry index to locate the incomplete object
  4. Ensure templating always emits the route key even when variables are filled late

Example fix

// before
- mtu: 1300
// after
- mtu: 1300
  route: 10.0.0.0/24
Defensive patterns

Strategy: validation

Validate before calling

for i, e := range routes.([]any) {
    m, _ := e.(map[string]any)
    if _, ok := m["route"]; !ok {
        return fmt.Errorf("tun.routes entry %d missing required key route", i+1)
    }
}

Prevention

When it happens

Trigger: getAllRoutesFromConfig encounters an entry like {mtu: 1300} with no route field, or a typo such as routes/cidr/network instead of route.

Common situations: Entries added by templating where the CIDR variable was empty and the key dropped; typos in key naming; incomplete configs edited by hand.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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