{"record":{"id":"064d6399862f61db","repo":"slackhq/nebula","slug":"entry-weight-in-tun-unsafe-routes-v-via-v-is-064d63","errorCode":null,"errorMessage":"entry .weight in tun.unsafe_routes[%v].via[%v] is not in range (1-%d) : %v","messagePattern":"entry \\.weight in tun\\.unsafe_routes\\[(.+?)\\]\\.via\\[(.+?)\\] is not in range \\(1-(.+?)\\) : (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/route.go","lineNumber":258,"sourceCode":"\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"entry .gateway in tun.unsafe_routes[%v].via[%v] failed to parse address: %v\", i+1, ig+1, err)\n\t\t\t\t}\n\n\t\t\t\trGatewayWeight, ok := gatewayMap[\"weight\"]\n\t\t\t\tif !ok {\n\t\t\t\t\trGatewayWeight = 1\n\t\t\t\t}\n\n\t\t\t\tgatewayWeight, ok := rGatewayWeight.(int)\n\t\t\t\tif !ok {\n\t\t\t\t\t_, err = strconv.ParseInt(rGatewayWeight.(string), 10, 32)\n\t\t\t\t\tif err != nil {\n\t\t\t\t\t\treturn nil, fmt.Errorf(\"entry .weight in tun.unsafe_routes[%v].via[%v] is not an integer\", i+1, ig+1)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif gatewayWeight < 1 || gatewayWeight > math.MaxInt32 {\n\t\t\t\t\treturn 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)\n\t\t\t\t}\n\n\t\t\t\tgateways[ig] = routing.NewGateway(gatewayIp, gatewayWeight)\n\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"entry %v.via in tun.unsafe_routes is not a string or list of gateways: found %T\", i+1, rVia)\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.unsafe_routes is not present\", i+1)\n\t\t}\n\n\t\tinstall := true\n\t\trInstall, ok := m[\"install\"]\n\t\tif ok {","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/route.go#L240-L276","documentation":"Config validation error in parseUnsafeRoutes: a via-list gateway weight is outside 1..MaxInt32 (zero, negative, or too large). Weights drive multipath traffic distribution and must be positive 32-bit values.","triggerScenarios":"Thrown at overlay/route.go:258 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set weight to at least 1 (and at most 2147483647)","Remove the weight key to use the default of 1"],"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"}