{"record":{"id":"101bf81b537b32fc","repo":"netbirdio/netbird","slug":"up-w","errorCode":null,"errorMessage":"up: %w","messagePattern":"up: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/device/wg_link_freebsd.go","lineNumber":55,"sourceCode":"func (l *wgLink) recreate() error {\n\tif err := l.link.Recreate(); err != nil {\n\t\treturn fmt.Errorf(\"recreate: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (l *wgLink) setMTU(mtu int) error {\n\tif err := l.link.SetMTU(mtu); err != nil {\n\t\treturn fmt.Errorf(\"set mtu: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (l *wgLink) up() error {\n\tif err := l.link.Up(); err != nil {\n\t\treturn fmt.Errorf(\"up: %w\", err)\n\t}\n\n\treturn nil\n}\n\nfunc (l *wgLink) assignAddr(address *wgaddr.Address) error {\n\tlink, err := freebsd.LinkByName(l.name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"link by name: %w\", err)\n\t}\n\n\tprefixLen := address.Network.Bits()\n\tmaskBits := uint32(0xffffffff) << (32 - prefixLen)\n\tmask := fmt.Sprintf(\"0x%08x\", maskBits)\n\n\tlog.Infof(\"assign addr %s mask %s to %s interface\", address.IP, mask, l.name)\n\n\tif err := link.AssignAddr(address.IP.String(), mask); err != nil {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/device/wg_link_freebsd.go#L37-L73","documentation":"wgLink.up() on freebsd executes `ifconfig <name> up` through client/iface/freebsd/link.go and wraps a non-zero exit as 'up: <err>', with ifconfig stderr logged at debug level. It is the standalone bring-up step in wg_link_freebsd.go, distinct from the up() call inside assignAddr.","triggerScenarios":"The wg interface was destroyed between creation and this call; insufficient privileges to administer the interface; ifconfig not in the daemon's PATH; ifconfig exiting nonzero with a driver-level complaint.","commonSituations":"FreeBSD jails without interface permissions, service environments with a scrubbed minimal PATH, another process destroying the wg interface concurrently.","solutions":["Check debug logs for the ifconfig stderr captured alongside this error","Ensure ifconfig is resolvable in the service environment PATH","Run the daemon with privileges to administer network interfaces","Confirm the interface still exists (ifconfig <name>) and retry"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// confirm the interface exists before bringing it up\nif _, err := freebsd.LinkByName(ifaceName); err != nil {\n    return fmt.Errorf(\"interface %s not present: %w\", ifaceName, err)\n}","typeGuard":null,"tryCatchPattern":"if err := link.Up(); err != nil {\n    if errors.Is(err, os.ErrNotExist) || strings.Contains(err.Error(), \"does not exist\") {\n        // interface vanished: re-create before retrying\n    }\n    return fmt.Errorf(\"bring up interface: %w\", err)\n}","preventionTips":["Keep ifconfig in the daemon's PATH","Run with privileges to administer interfaces","Avoid concurrent processes creating/destroying wg interfaces"],"tags":["freebsd","ifconfig","interface","privileges","go"],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}