slackhq/nebula · error

entry %v.via in tun.unsafe_routes is not a string or list of

Error message

entry %v.via in tun.unsafe_routes is not a string or list of gateways: found %T

What it means

Config validation error in parseUnsafeRoutes: the `via` key of the i+1-th entry is neither a string nor a []any of gateway mappings — its dynamic Go type (shown with %T) is something else entirely, e.g. an int or nested map at the top level of via.

Source

Thrown at overlay/route.go:266

				gatewayWeight, ok := rGatewayWeight.(int)
				if !ok {
					_, err = strconv.ParseInt(rGatewayWeight.(string), 10, 32)
					if err != nil {
						return nil, fmt.Errorf("entry .weight in tun.unsafe_routes[%v].via[%v] is not an integer", i+1, ig+1)
					}
				}

				if gatewayWeight < 1 || gatewayWeight > math.MaxInt32 {
					return nil, fmt.Errorf("entry .weight in tun.unsafe_routes[%v].via[%v] is not in range (1-%d) : %v", i+1, ig+1, math.MaxInt32, gatewayWeight)
				}

				gateways[ig] = routing.NewGateway(gatewayIp, gatewayWeight)

			}

		default:
			return nil, fmt.Errorf("entry %v.via in tun.unsafe_routes is not a string or list of gateways: found %T", i+1, rVia)
		}

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

		install := true
		rInstall, ok := m["install"]
		if ok {
			install, err = strconv.ParseBool(fmt.Sprintf("%v", rInstall))
			if err != nil {
				return nil, fmt.Errorf("entry %v.install in tun.unsafe_routes is not a boolean: %v", i+1, err)
			}
		}

		r := Route{
			Via:     gateways,

View on GitHub (pinned to dd8f660c0a)

Solutions

  1. Write via as either a single IP string or a list of {gateway, weight} mappings
Defensive patterns

Strategy: validation

When it happens

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