{"record":{"id":"5855332ed6885469","repo":"AdguardTeam/AdGuardHome","slug":"adding-q-s-to-q-q-w","errorCode":null,"errorMessage":"adding %q%s to %q %q: %w","messagePattern":"adding %q(.+?) to %q %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ipset/ipset_linux.go","lineNumber":474,"sourceCode":"\n\tn = len(entries)\n\tif n == 0 {\n\t\treturn 0, nil\n\t}\n\n\tvar conn ipsetConn\n\tswitch set.family {\n\tcase netfilter.ProtoIPv4:\n\t\tconn = m.ipv4Conn\n\tcase netfilter.ProtoIPv6:\n\t\tconn = m.ipv6Conn\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unexpected family %s for ipset %q\", set.family, set.name)\n\t}\n\n\terr = conn.Add(set.name, entries...)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"adding %q%s to %q %q: %w\", host, ips, set.name, set.typeName, err)\n\t}\n\n\t// Only add these to the cache once we're sure that all of them were\n\t// actually sent to the ipset.\n\tfor _, e := range newAddedEntries {\n\t\ts := m.nameToIpset[e.ipsetName]\n\t\tif s.isPersistent {\n\t\t\tm.addedIPs.Add(e)\n\t\t}\n\t}\n\n\treturn n, nil\n}\n\n// addToSets adds the IP addresses to the corresponding ipset.\nfunc (m *manager) addToSets(\n\tctx context.Context,\n\thost string,","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/AdguardTeam/AdGuardHome/blob/b41aefbe51c8dde65e2c50f093996afa0502edf9/internal/ipset/ipset_linux.go#L456-L492","documentation":"The netlink conn.Add call failed while adding resolved IP entries to the named ipset. Wraps the kernel error with set name, set type, and the host/IPs involved.","triggerScenarios":"Adding entries to set 'name' of typeName fails: set destroyed meanwhile, entry already exists in a set without -exist semantics, netlink timeout, or memory limits of the set (maxelem).","commonSituations":"Set removed by firewall reload mid-run, hash set full (maxelem reached), ENOBUFS on a busy netlink socket.","solutions":["Check 'ipset list <name>' still exists and its maxelem/headers","Increase maxelem when creating the set, or prune entries","Ensure sets aren't destroyed by concurrent firewall scripts"],"exampleFix":"# before\nipset create myset hash:ip\n# after\nipset create myset hash:ip maxelem 1000000","handlingStrategy":"retry","validationCode":"out, err := exec.Command(\"ipset\", \"list\", set).Output()\nif err != nil { /* set missing; recreate before proceeding */ }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"adding\") {\n\tlog.Warnf(\"ipset add failed: %v; will retry next update cycle\", err)\n}","preventionTips":["Create sets with adequate maxelem","Use -exist semantics / tolerate duplicates by ignoring EEXIST inner errors","Don't destroy sets concurrently with the service"],"tags":["ipset","netlink","runtime"],"backgroundTag":"ipset-add-failed","analyzedSha":"b41aefbe51c8dde65e2c50f093996afa0502edf9","analyzedAt":"2026-08-27T04:57:55.097Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}