{"record":{"id":"6f596cd63adbce69","repo":"probelabs/goreplay","slug":"afpacket-socket-is-only-available-on-linux","errorCode":null,"errorMessage":"afpacket socket is only available on linux","messagePattern":"afpacket socket is only available on linux","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/capture/sock_others.go","lineNumber":13,"sourceCode":"//go:build !linux || arm64 || darwin\n\npackage capture\n\nimport (\n\t\"errors\"\n\n\t\"github.com/google/gopacket/pcap\"\n)\n\n// NewSocket returns new M'maped sock_raw on packet version 2.\nfunc NewSocket(_ pcap.Interface) (Socket, error) {\n\treturn nil, errors.New(\"afpacket socket is only available on linux\")\n}\n","sourceCodeStart":1,"sourceCodeEnd":15,"githubUrl":"https://github.com/probelabs/goreplay/blob/251e45abd242886bb64ff2b2dc98789556b56330/internal/capture/sock_others.go#L1-L15","documentation":"Platform stub: on non-Linux (or arm64/darwin builds per the build tag) capture.NewSocket has no AF_PACKET implementation, so any attempt to use the sock_raw listener gets this sentinel error instead of a socket.","triggerScenarios":"Thrown at internal/capture/sock_others.go:13 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run on Linux x86_64 where the real AF_PACKET socket implementation is compiled in","Use the pcap-based listener instead of --input-raw-worker/sock_raw on unsupported platforms","Switch capture engine if the build tag excluded sock_raw"],"exampleFix":null,"handlingStrategy":"fallback","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"}