{"record":{"id":"be64dc5825efa957","repo":"slackhq/nebula","slug":"config-s-s-w","errorCode":null,"errorMessage":"config '%s.%s': %w","messagePattern":"config '(.+?)\\.(.+?)': %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"calculated_remote.go","lineNumber":99,"sourceCode":"\tif value == nil {\n\t\treturn nil, nil\n\t}\n\n\tcalculatedRemotes := new(bart.Table[[]*calculatedRemote])\n\n\trawMap, ok := value.(map[string]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"config `%s` has invalid type: %T\", k, value)\n\t}\n\tfor rawCIDR, rawValue := range rawMap {\n\t\tcidr, err := netip.ParsePrefix(rawCIDR)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"config `%s` has invalid CIDR: %s\", k, rawCIDR)\n\t\t}\n\n\t\tentry, err := newCalculatedRemotesListFromConfig(cidr, rawValue)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"config '%s.%s': %w\", k, rawCIDR, err)\n\t\t}\n\n\t\tcalculatedRemotes.Insert(cidr, entry)\n\t}\n\n\treturn calculatedRemotes, nil\n}\n\nfunc newCalculatedRemotesListFromConfig(cidr netip.Prefix, raw any) ([]*calculatedRemote, error) {\n\trawList, ok := raw.([]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"calculated_remotes entry has invalid type: %T\", raw)\n\t}\n\n\tvar l []*calculatedRemote\n\tfor _, e := range rawList {\n\t\tc, err := newCalculatedRemotesEntryFromConfig(cidr, e)\n\t\tif err != nil {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/calculated_remote.go#L81-L117","documentation":"This is a wrapping error: when newCalculatedRemotesListFromConfig fails for a specific CIDR's entry list, NewCalculatedRemotesFromConfig re-wraps the inner error as `config '<key>.<cidr>': <inner>` so the message pinpoints the exact config section. The root cause is always in the wrapped inner error (invalid type, missing mask, bad port, family mismatch).","triggerScenarios":"NewCalculatedRemotesFromConfig calls newCalculatedRemotesListFromConfig(cidr, rawValue) and the entry list or any single entry fails validation; the inner error is wrapped with the config key and CIDR.","commonSituations":"Debugging a nebula config: this outer wrapper appears in logs whenever a calculated_remotes entry is malformed — read the text after the colon for the real problem.","solutions":["Read the wrapped inner error after `config 'lighthouse.calculated_remotes.<cidr>':` to find the actual failure","Fix the entry under the named CIDR (mask, port, or list structure) per the inner error","Validate the whole calculated_remotes block offline before reload"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate the whole calculated_remotes section before reload:\n// for each cidr key: netip.ParsePrefix(key); for each entry: map with string mask + port in 0-65535","typeGuard":null,"tryCatchPattern":"_, err := NewCalculatedRemotesFromConfig(c, \"lighthouse.calculated_remotes\")\nif err != nil {\n\t// err is `config '<k>.<cidr>': <inner>`; log err fully and surface the inner cause\n\thandleConfigError(fmt.Errorf(\"calculated_remotes rejected: %w\", err))\n}","preventionTips":["Read the full wrapped chain (text after the last colon) to find the root cause","Identify the offending cidr from the `config '<k>.<cidr>'` prefix","Keep entry structure consistent: list of maps with mask+port under each CIDR"],"tags":["nebula","config","error-wrapping","calculated-remotes"],"backgroundTag":"config-parse-error","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"}