{"record":{"id":"1966e8d7c8cc8115","repo":"slackhq/nebula","slug":"entry-v-mtu-in-tun-routes-is-not-an-integer-v","errorCode":null,"errorMessage":"entry %v.mtu in tun.routes is not an integer: %v","messagePattern":"entry (.+?)\\.mtu in tun\\.routes is not an integer: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/route.go","lineNumber":103,"sourceCode":"\t}\n\n\troutes := make([]Route, len(rawRoutes))\n\tfor i, r := range rawRoutes {\n\t\tm, ok := r.(map[string]any)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"entry %v in tun.routes is invalid\", i+1)\n\t\t}\n\n\t\trMtu, ok := m[\"mtu\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"entry %v.mtu in tun.routes is not present\", i+1)\n\t\t}\n\n\t\tmtu, ok := rMtu.(int)\n\t\tif !ok {\n\t\t\tmtu, err = strconv.Atoi(rMtu.(string))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"entry %v.mtu in tun.routes is not an integer: %v\", i+1, err)\n\t\t\t}\n\t\t}\n\n\t\tif mtu < 500 {\n\t\t\treturn nil, fmt.Errorf(\"entry %v.mtu in tun.routes is below 500: %v\", i+1, mtu)\n\t\t}\n\n\t\trRoute, ok := m[\"route\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"entry %v.route in tun.routes is not present\", i+1)\n\t\t}\n\n\t\tr := Route{\n\t\t\tInstall: true,\n\t\t\tMTU:     mtu,\n\t\t}\n\n\t\tr.Cidr, err = netip.ParsePrefix(fmt.Sprintf(\"%v\", rRoute))","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/route.go#L85-L121","documentation":"The mtu value of a tun.routes entry is neither an int nor a string parseable as an integer. parseRoutes accepts a native int or a numeric string (via strconv.Atoi); any other type, or a non-numeric string, produces this wrapped conversion error.","triggerScenarios":"getAllRoutesFromConfig sees mtu as a bool, float-in-YAML (e.g. 1300.0), quoted garbage like mtu: \"auto\", or an empty string.","commonSituations":"Writing mtu: \"auto\" or \"default\" expecting the library to pick a value; YAML unquoted floats or unit suffixes like 1300 bytes; templating that renders numbers with decimals.","solutions":["Set mtu to a plain integer (e.g. mtu: 1300)","If quoted, ensure the string is purely numeric: mtu: \"1300\"","Remove unit suffixes or decimals from the value","Check the inner %v for the underlying strconv error to see the offending value"],"exampleFix":"// before\n- mtu: \"auto\"\n  route: 10.0.0.0/24\n// after\n- mtu: 1300\n  route: 10.0.0.0/24","handlingStrategy":"validation","validationCode":"switch v := m[\"mtu\"].(type) {\ncase int:\n    // ok\ncase string:\n    if _, err := strconv.Atoi(v); err != nil {\n        return fmt.Errorf(\"mtu %q is not an integer\", v)\n    }\ndefault:\n    return fmt.Errorf(\"mtu must be int or numeric string\")\n}","typeGuard":"func isIntOrNumericString(v any) bool {\n    switch t := v.(type) {\n    case int:\n        return true\n    case string:\n        _, err := strconv.Atoi(t)\n        return err == nil\n    }\n    return false\n}","tryCatchPattern":null,"preventionTips":["Write mtu as a plain unquoted integer","Never use \"auto\"/\"default\" sentinels; the library has no auto mode","Avoid floats and unit suffixes (1300.0, 1300b)","Quote numeric strings only if purely digits"],"tags":["config","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"dd8f660c0ac37903ec4080ca4d3c861ba9342ceb","analyzedAt":"2026-09-03T11:13:55.444Z","contentChangedAt":"2026-09-03T11:13:55.444Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}