{"record":{"id":"9297cb54eb9396bc","repo":"probelabs/goreplay","slug":"sock-raw-error-q-interface-q","errorCode":null,"errorMessage":"sock raw error: %q, interface: %q","messagePattern":"sock raw error: %q, interface: %q","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/capture/capture.go","lineNumber":485,"sourceCode":"\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)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"sock raw error: %q, interface: %q\", err, ifi.Name)\n\t}\n\tif err = handle.SetPromiscuous(l.config.Promiscuous || l.config.Monitor); err != nil {\n\t\treturn nil, fmt.Errorf(\"promiscuous mode error: %q, interface: %q\", err, ifi.Name)\n\t}\n\tif l.config.BPFFilter == \"\" {\n\t\tl.config.BPFFilter = l.Filter(ifi)\n\t}\n\tfmt.Println(\"BPF Filter: \", l.config.BPFFilter)\n\tif err = handle.SetBPFFilter(l.config.BPFFilter); err != nil {\n\t\thandle.Close()\n\t\treturn nil, fmt.Errorf(\"BPF filter error: %q%s, interface: %q\", err, l.config.BPFFilter, ifi.Name)\n\t}\n\thandle.SetLoopbackIndex(int32(l.loopIndex))\n\treturn\n}\n\nfunc http1StartHint(pckt *tcp.Packet) (isRequest, isResponse bool) {\n\tif proto.HasRequestTitle(pckt.Payload) {","sourceCodeStart":467,"sourceCodeEnd":503,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/internal/capture/capture.go#L467-L503","documentation":"SocketHandle wraps the failure of capture.NewSocket to create the AF_PACKET raw socket for the interface (missing implementation on this platform, interface not found, or socket syscall/setsockopt errors).","triggerScenarios":"Thrown at internal/capture/capture.go:485 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm Linux support: sock_raw needs AF_PACKET and root or CAP_NET_RAW","Check the interface name exists in net.Interfaces at socket creation time","Read the wrapped inner error — it names the exact failing syscall or platform limitation"],"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"}