{"record":{"id":"d5d29d371c4bffe9","repo":"probelabs/goreplay","slug":"pcap-activate-device-error-q-interface-q","errorCode":null,"errorMessage":"PCAP Activate device error: %q, interface: %q","messagePattern":"PCAP Activate device error: %q, interface: %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/capture/capture.go","lineNumber":465,"sourceCode":"\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"snapshot length error: %q, interface: %q\", err, ifi.Name)\n\t}\n\tif l.config.BufferSize > 0 {\n\t\terr = inactive.SetBufferSize(int(l.config.BufferSize))\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"handle buffer size error: %q, interface: %q\", err, ifi.Name)\n\t\t}\n\t}\n\tif l.config.BufferTimeout == 0 {\n\t\tl.config.BufferTimeout = 2000 * time.Millisecond\n\t}\n\terr = inactive.SetTimeout(l.config.BufferTimeout)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"handle buffer timeout error: %q, interface: %q\", err, ifi.Name)\n\t}\n\thandle, err = inactive.Activate()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"PCAP Activate device error: %q, interface: %q\", err, ifi.Name)\n\t}\n\n\tbpfFilter := l.config.BPFFilter\n\tif bpfFilter == \"\" {\n\t\tbpfFilter = l.Filter(ifi)\n\t}\n\tfmt.Println(\"Interface:\", ifi.Name, \". BPF Filter:\", bpfFilter)\n\terr = handle.SetBPFFilter(bpfFilter)\n\tif err != nil {\n\t\thandle.Close()\n\t\treturn nil, fmt.Errorf(\"BPF filter error: %q%s, interface: %q\", err, bpfFilter, ifi.Name)\n\t}\n\treturn\n}\n\n// SocketHandle returns new unix ethernet handle associated with this listener settings\nfunc (l *Listener) SocketHandle(ifi pcap.Interface) (handle Socket, err error) {\n\thandle, err = NewSocket(ifi)","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/internal/capture/capture.go#L447-L483","documentation":"PcapHandle wraps the pcap library's failure to activate the prepared inactive handle on the given network interface (device busy, permissions, interface gone) and includes the interface name for diagnosis.","triggerScenarios":"Thrown at internal/capture/capture.go:465 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run gor with sufficient privileges (root or CAP_NET_RAW/CAP_NET_ADMIN)","Verify the interface is up and not renamed/removed between listing and activation","Close competing handles on the same interface"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"251e45abd242886bb64ff2b2dc98789556b56330","analyzedAt":"2026-09-02T16:44:11.369Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}