{"record":{"id":"c322c1d455cc0aa2","repo":"slackhq/nebula","slug":"entry-v-metric-in-tun-unsafe-routes-is-not-in-ran","errorCode":null,"errorMessage":"entry %v.metric in tun.unsafe_routes is not in range (0-%d) : %v","messagePattern":"entry (.+?)\\.metric in tun\\.unsafe_routes is not in range \\(0-(.+?)\\) : (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/route.go","lineNumber":202,"sourceCode":"\t\t\t\treturn nil, fmt.Errorf(\"entry %v.mtu in tun.unsafe_routes is below 500: %v\", i+1, mtu)\n\t\t\t}\n\t\t}\n\n\t\trMetric, ok := m[\"metric\"]\n\t\tif !ok {\n\t\t\trMetric = 0\n\t\t}\n\n\t\tmetric, ok := rMetric.(int)\n\t\tif !ok {\n\t\t\t_, err = strconv.ParseInt(rMetric.(string), 10, 32)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"entry %v.metric in tun.unsafe_routes is not an integer: %v\", i+1, err)\n\t\t\t}\n\t\t}\n\n\t\tif metric < 0 || metric > math.MaxInt32 {\n\t\t\treturn nil, fmt.Errorf(\"entry %v.metric in tun.unsafe_routes is not in range (0-%d) : %v\", i+1, math.MaxInt32, metric)\n\t\t}\n\n\t\trVia, ok := m[\"via\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"entry %v.via in tun.unsafe_routes is not present\", i+1)\n\t\t}\n\n\t\tvar gateways routing.Gateways\n\n\t\tswitch via := rVia.(type) {\n\t\tcase string:\n\t\t\tviaIp, err := netip.ParseAddr(via)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"entry %v.via in tun.unsafe_routes failed to parse address: %v\", i+1, err)\n\t\t\t}\n\n\t\t\tgateways = routing.Gateways{routing.NewGateway(viaIp, 1)}\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/route.go#L184-L220","documentation":"Config validation error in parseUnsafeRoutes: the i+1-th entry's metric is outside the allowed 0..MaxInt32 range (negative or too large). Route metrics feed OS routing APIs that require a non-negative 32-bit value.","triggerScenarios":"Thrown at overlay/route.go:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set metric between 0 and 2147483647","Remove the metric key to use the default"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}