{"record":{"id":"2b96cafd79d5084e","repo":"probelabs/goreplay","slug":"raw-socket-handles-error-s","errorCode":null,"errorMessage":"raw socket handles error:%s","messagePattern":"raw socket handles error:(.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/capture/capture.go","lineNumber":677,"sourceCode":"\tvar e error\n\tfor _, ifi := range l.Interfaces {\n\t\tif _, found := l.Handles[ifi.Name]; found {\n\t\t\tcontinue\n\t\t}\n\n\t\tvar handle Socket\n\t\thandle, e = l.SocketHandle(ifi)\n\t\tif e != nil {\n\t\t\tmsg += (\"\\n\" + e.Error())\n\t\t\tcontinue\n\t\t}\n\t\tl.Handles[ifi.Name] = packetHandle{\n\t\t\thandler: handle,\n\t\t\tips:     interfaceIPs(ifi),\n\t\t}\n\t}\n\tif len(l.Handles) == 0 {\n\t\treturn fmt.Errorf(\"raw socket handles error:%s\", msg)\n\t}\n\treturn nil\n}\n\nfunc (l *Listener) activatePcapFile() (err error) {\n\tvar handle *pcap.Handle\n\tvar e error\n\tif handle, e = pcap.OpenOffline(l.host); e != nil {\n\t\treturn fmt.Errorf(\"open pcap file error: %q\", e)\n\t}\n\n\ttmp := l.host\n\tl.host = \"\"\n\tl.config.BPFFilter = l.Filter(pcap.Interface{})\n\tl.host = tmp\n\n\tif e = handle.SetBPFFilter(l.config.BPFFilter); e != nil {\n\t\thandle.Close()","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/internal/capture/capture.go#L659-L695","documentation":"activateRawSocket collects per-interface SocketHandle errors and, when no interface produced a working raw socket, returns this aggregated error with all the underlying messages — raw capture cannot start.","triggerScenarios":"Thrown at internal/capture/capture.go:677 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the aggregated inner errors for the real cause per interface","Run as root or with CAP_NET_RAW so AF_PACKET sockets can be opened","Verify interface names and Linux kernel support for TPACKET_V2"],"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"}