{"record":{"id":"212dd2308f15ca0c","repo":"netbirdio/netbird","slug":"create-ipset-s-w-212dd2","errorCode":null,"errorMessage":"create ipset %s: %w","messagePattern":"create ipset (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/firewall/iptables/router_linux.go","lineNumber":1155,"sourceCode":"// ipsetName returns the ipset name, suffixed with \"-v6\" for the v6 router\n// to avoid collisions since ipsets are global in the kernel.\nfunc (r *router) ipsetName(name string) string {\n\tif r.v6 {\n\t\treturn name + \"-v6\"\n\t}\n\treturn name\n}\n\nfunc (r *router) createIPSet(name string) error {\n\topts := ipset.CreateOptions{\n\t\tReplace: true,\n\t}\n\tif r.v6 {\n\t\topts.Family = ipset.FamilyIPV6\n\t}\n\n\tif err := ipset.Create(name, ipset.TypeHashNet, opts); err != nil {\n\t\treturn fmt.Errorf(\"create ipset %s: %w\", name, err)\n\t}\n\n\tlog.Debugf(\"created ipset %s with type hash:net\", name)\n\treturn nil\n}\n\nfunc (r *router) addPrefixToIPSet(name string, prefix netip.Prefix) error {\n\taddr := prefix.Addr()\n\tip := addr.AsSlice()\n\n\tentry := &ipset.Entry{\n\t\tIP:      ip,\n\t\tCIDR:    uint8(prefix.Bits()),\n\t\tReplace: true,\n\t}\n\n\tif err := ipset.Add(name, entry); err != nil {\n\t\treturn fmt.Errorf(\"add prefix to ipset %s: %w\", name, err)","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/firewall/iptables/router_linux.go#L1137-L1173","documentation":"Error \"create ipset %s: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/firewall/iptables/router_linux.go:1155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}