probelabs/goreplay · error

PCAP Activate device error: %q, interface: %q

Error message

PCAP Activate device error: %q, interface: %q

What it means

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.

Source

Thrown at internal/capture/capture.go:465

	if err != nil {
		return nil, fmt.Errorf("snapshot length error: %q, interface: %q", err, ifi.Name)
	}
	if l.config.BufferSize > 0 {
		err = inactive.SetBufferSize(int(l.config.BufferSize))
		if err != nil {
			return nil, fmt.Errorf("handle buffer size error: %q, interface: %q", err, ifi.Name)
		}
	}
	if l.config.BufferTimeout == 0 {
		l.config.BufferTimeout = 2000 * time.Millisecond
	}
	err = inactive.SetTimeout(l.config.BufferTimeout)
	if err != nil {
		return nil, fmt.Errorf("handle buffer timeout error: %q, interface: %q", err, ifi.Name)
	}
	handle, err = inactive.Activate()
	if err != nil {
		return nil, fmt.Errorf("PCAP Activate device error: %q, interface: %q", err, ifi.Name)
	}

	bpfFilter := l.config.BPFFilter
	if bpfFilter == "" {
		bpfFilter = l.Filter(ifi)
	}
	fmt.Println("Interface:", ifi.Name, ". BPF Filter:", bpfFilter)
	err = handle.SetBPFFilter(bpfFilter)
	if err != nil {
		handle.Close()
		return nil, fmt.Errorf("BPF filter error: %q%s, interface: %q", err, bpfFilter, ifi.Name)
	}
	return
}

// SocketHandle returns new unix ethernet handle associated with this listener settings
func (l *Listener) SocketHandle(ifi pcap.Interface) (handle Socket, err error) {
	handle, err = NewSocket(ifi)

View on GitHub (pinned to 251e45abd2)

Solutions

  1. Run gor with sufficient privileges (root or CAP_NET_RAW/CAP_NET_ADMIN)
  2. Verify the interface is up and not renamed/removed between listing and activation
  3. Close competing handles on the same interface
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at internal/capture/capture.go:465 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of probelabs/goreplay@251e45abd2 (2026-09-02). Data as JSON: /api/errors/d5d29d371c4bffe9. Report an issue: GitHub.