{"record":{"id":"e0664e44a99195c4","repo":"slackhq/nebula","slug":"entry-v-mtu-in-tun-routes-is-not-present","errorCode":null,"errorMessage":"entry %v.mtu in tun.routes is not present","messagePattern":"entry (.+?)\\.mtu in tun\\.routes is not present","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/route.go","lineNumber":96,"sourceCode":"\trawRoutes, ok := r.([]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"tun.routes is not an array\")\n\t}\n\n\tif len(rawRoutes) < 1 {\n\t\treturn []Route{}, nil\n\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}","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/route.go#L78-L114","documentation":"A tun.routes entry object is missing the required mtu key. parseRoutes looks up m[\"mtu\"] for each entry and errors when the key is absent. MTU is mandatory because the library installs the route with that interface MTU.","triggerScenarios":"getAllRoutesFromConfig encounters a route object like {route: 10.0.0.0/24} with no mtu field, or a typo such as mtu_size/MTU.","commonSituations":"Minimal configs copied from docs that omit mtu; key-name typos or wrong casing; older config formats predating the mtu requirement.","solutions":["Add an mtu key (integer, >= 500) to every tun.routes entry","Check for typos/casing: the key must be exactly mtu","Use the reported entry index to find which object is missing the field","Adopt a config schema/linter that enforces required keys"],"exampleFix":"// before\n- route: 10.0.0.0/24\n// after\n- mtu: 1300\n  route: 10.0.0.0/24","handlingStrategy":"validation","validationCode":"for i, e := range routes.([]any) {\n    m, _ := e.(map[string]any)\n    if _, ok := m[\"mtu\"]; !ok {\n        return fmt.Errorf(\"tun.routes entry %d missing required key mtu\", i+1)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include mtu in every route entry","Key name is lowercase exactly: mtu","Enforce required keys via config schema validation","Copy working example entries rather than writing from memory"],"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"}