bettercap/bettercap · error
'events.waitFor %s %d' timed out.
Error message
'events.waitFor %s %d' timed out.
What it means
Timeout result in events_stream's startWaitingFor: the module registered a waitFor on a tag and no matching event arrived on waitChan before the configured timeout elapsed (the timer goroutine pushes nil). The error reports the tag and the timeout in seconds and is surfaced to the user of events.waitFor.
Source
Thrown at modules/events_stream/events_stream.go:352
}
func (mod *EventsStream) startWaitingFor(tag string, timeout int) error {
if timeout == 0 {
mod.Info("waiting for event %s ...", tui.Green(tag))
} else {
mod.Info("waiting for event %s for %d seconds ...", tui.Green(tag), timeout)
go func() {
time.Sleep(time.Duration(timeout) * time.Second)
mod.waitFor = ""
mod.waitChan <- nil
}()
}
mod.waitFor = tag
event := <-mod.waitChan
if event == nil {
return fmt.Errorf("'events.waitFor %s %d' timed out.", tag, timeout)
} else {
mod.Debug("got event: %v", event)
}
return nil
}
func (mod *EventsStream) Stop() error {
return mod.SetRunning(false, func() {
mod.quit <- true
if mod.output != os.Stdout {
if fp, ok := mod.output.(*os.File); ok {
fp.Close()
}
}
})
}
View on GitHub (pinned to 8eca2820f3)
Solutions
- Increase the timeout argument of events.waitFor
- Verify the event tag matches exactly what the emitting module publishes (use events.show/events.view to inspect)
- Confirm the action that should trigger the event is actually running (e.g. the attack or recon still active)
- Poll for the event in a retry loop on the caller side if waiting is best-effort
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at modules/events_stream/events_stream.go:352 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
AI-assisted analysis of bettercap/bettercap@8eca2820f3 (2026-09-02).
Data as JSON: /api/errors/79bd00312420d945.
Report an issue: GitHub.