{"record":{"id":"c08681eb53e261aa","repo":"slackhq/nebula","slug":"calculated-remotes-entry-w","errorCode":null,"errorMessage":"calculated_remotes entry: %w","messagePattern":"calculated_remotes entry: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"calculated_remote.go","lineNumber":118,"sourceCode":"\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 {\n\t\t\treturn nil, fmt.Errorf(\"calculated_remotes entry: %w\", err)\n\t\t}\n\t\tl = append(l, c)\n\t}\n\n\treturn l, nil\n}\n\nfunc newCalculatedRemotesEntryFromConfig(cidr netip.Prefix, raw any) (*calculatedRemote, error) {\n\trawMap, ok := raw.(map[string]any)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"invalid type: %T\", raw)\n\t}\n\n\trawValue := rawMap[\"mask\"]\n\tif rawValue == nil {\n\t\treturn nil, fmt.Errorf(\"missing mask: %v\", rawMap)\n\t}\n\trawMask, ok := rawValue.(string)","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/slackhq/nebula/blob/dd8f660c0ac37903ec4080ca4d3c861ba9342ceb/calculated_remote.go#L100-L136","documentation":"This is a wrapping error emitted by newCalculatedRemotesListFromConfig when one entry in a CIDR's list fails in newCalculatedRemotesEntryFromConfig. It prefixes the inner error with `calculated_remotes entry:` so operators know the failure came from a specific entry; the actionable detail is in the wrapped message.","triggerScenarios":"Any single entry in a calculated_remotes list is malformed (not a map, missing mask, bad mask type, unparseable mask, missing/invalid port) — the per-entry error gets wrapped by this line.","commonSituations":"Nebula reload failures where the log shows `calculated_remotes entry: <inner>`; scan the rest of the chained message to find which field was wrong.","solutions":["Read the wrapped inner error after `calculated_remotes entry:` for the real cause","Fix the offending entry map (mask/port) inside the list under the failing CIDR","Test each entry independently with netip.ParsePrefix and port range checks"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for _, e := range entryList {\n\tm, ok := e.(map[string]any)\n\tif !ok { continue }\n\tif _, ok := m[\"mask\"].(string); !ok { continue }\n\tif _, err := netip.ParsePrefix(m[\"mask\"].(string)); err != nil { continue }\n\t// entry looks structurally valid\n}","typeGuard":null,"tryCatchPattern":"if err != nil {\n\tif strings.Contains(err.Error(), \"calculated_remotes entry:\") {\n\t\t// unwrap with errors.Unwrap / %v of chain to find the per-entry cause\n\t\tlog.Printf(\"bad entry: %v\", err)\n\t}\n}","preventionTips":["Validate each entry map (mask string CIDR, port 0-65535) before reload","Check every element of every list — one bad entry fails the whole section","Use errors.Unwrap in a loop to print the full cause chain from logs"],"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"}