{"record":{"id":"4038767c2ad24d20","repo":"slackhq/nebula","slug":"entry-weight-in-tun-unsafe-routes-v-via-v-is","errorCode":null,"errorMessage":"entry .weight in tun.unsafe_routes[%v].via[%v] is not an integer","messagePattern":"entry \\.weight in tun\\.unsafe_routes\\[(.+?)\\]\\.via\\[(.+?)\\] is not an integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"overlay/route.go","lineNumber":253,"sourceCode":"\t\t\t\tif !ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"entry .gateway in tun.unsafe_routes[%v].via[%v] is not a string\", i+1, ig+1)\n\t\t\t\t}\n\n\t\t\t\tgatewayIp, err := netip.ParseAddr(parsedGateway)\n\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)","sourceCodeStart":235,"sourceCodeEnd":271,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/overlay/route.go#L235-L271","documentation":"Config validation error in parseUnsafeRoutes: the `weight` key of a via-list gateway is a string that ParseInt(bitsize 32) rejected — not a valid 32-bit integer. Weight defaults to 1 when the key is absent, but an unparseable explicit value fails.","triggerScenarios":"Thrown at overlay/route.go:253 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write weight as a plain integer (1..MaxInt32)","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"}