{"record":{"id":"2ea1c8c006e05281","repo":"netbirdio/netbird","slug":"add-addr-s-w","errorCode":null,"errorMessage":"add addr %s: %w","messagePattern":"add addr (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/wg_link_linux.go","lineNumber":148,"sourceCode":"\t}\n\n\treturn nil\n}\n\nfunc (l *wgLink) addAddr(ifaceName string, prefix netip.Prefix) error {\n\tlog.Debugf(\"adding address %s to interface: %s\", prefix, ifaceName)\n\n\taddr := &netlink.Addr{\n\t\tIPNet: &net.IPNet{\n\t\t\tIP:   prefix.Addr().AsSlice(),\n\t\t\tMask: net.CIDRMask(prefix.Bits(), prefix.Addr().BitLen()),\n\t\t},\n\t}\n\n\tif err := netlink.AddrAdd(l, addr); os.IsExist(err) {\n\t\tlog.Infof(\"interface %s already has the address: %s\", ifaceName, prefix)\n\t} else if err != nil {\n\t\treturn fmt.Errorf(\"add addr %s: %w\", prefix, err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":130,"sourceCodeEnd":153,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/wg_link_linux.go#L130-L153","documentation":"Error \"add addr %s: %w\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/iface/device/wg_link_linux.go:148 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"}