{"record":{"id":"33836e2643504bec","repo":"netbirdio/netbird","slug":"command-run-w","errorCode":null,"errorMessage":"command run: %w","messagePattern":"command run: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/iface/freebsd/link.go","lineNumber":36,"sourceCode":"}\n\nfunc NewLink(name string) *Link {\n\treturn &Link{\n\t\tname: name,\n\t}\n}\n\n// LinkByName retrieves a network interface by its name.\nfunc LinkByName(name string) (*Link, error) {\n\tout, err := exec.Command(\"ifconfig\", name).CombinedOutput()\n\tif err != nil {\n\t\tif pErr := parseError(out); pErr != nil {\n\t\t\treturn nil, pErr\n\t\t}\n\n\t\tlog.Debugf(\"ifconfig out: %s\", out)\n\n\t\treturn nil, fmt.Errorf(\"command run: %w\", err)\n\t}\n\n\ti, err := parseIfconfigOutput(out)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"parse ifconfig output: %w\", err)\n\t}\n\n\tif i.Name != name {\n\t\treturn nil, ErrNameDoesNotMatch\n\t}\n\n\treturn &Link{name: i.Name}, nil\n}\n\n// Recreate - create new interface, remove current before create if it exists\nfunc (l *Link) Recreate() error {\n\tok, err := l.isExist()\n\tif err != nil {","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/iface/freebsd/link.go#L18-L54","documentation":"The `ifconfig <name>` invocation itself failed (non-zero exit or exec error) and parseError could not classify the output into a known interface error, so the raw exec error is wrapped. LinkByName cannot determine whether the interface exists, and reports this failure to its callers (assignAddr, isExist).","triggerScenarios":"Thrown at client/iface/freebsd/link.go:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run ifconfig <name> manually to see the failure","Check that ifconfig is in PATH","Retry the lookup after transient exec issues"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","contentChangedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}