vectordotdev/vector · error · TungsteniteError
Pong timeout
Error message
Pong timeout
What it means
The WebSocket source disconnects when no pong frame has been received within its timeout (WebSocketSourceError::PongTimeout). In run(), the source logs 'Disconnecting due to pong timeout.', emits WebSocketReceiveError with an io::Error(ErrorKind::TimedOut, 'Pong timeout') and WebSocketConnectionShutdown, then returns the error so the source is restarted. It means the remote server stopped answering keep-alive pings.
Solutions
- Raise ping_timeout in the websocket source configuration to exceed the server's keep-alive interval.
- Verify the server/proxy responds to pings and doesn't silently idle-drop connections (adjust LB idle timeout).
- Check upstream service health; the source will reconnect automatically after the error.
- Capture the emitted WebSocketReceiveError logs to correlate with upstream incidents.
Example fix
// before [sources.ws] type = "websocket" ping_timeout = 10 // after [sources.ws] type = "websocket" ping_timeout = 60
Defensive patterns
Strategy: retry
Try / catch
// Source restarts automatically on PongTimeout; monitor the emitted error warn!(message = "pong timeout, expecting reconnect", source_id = ?source_id);
Prevention
- Configure ping_timeout larger than the server's keep-alive/ping interval.
- Tune LB/proxy idle timeouts above ping_timeout.
- Alert on repeated WebSocketReceiveError TimedOut events as an upstream health signal.
When it happens
Trigger: The websocket source's ping/pong liveness check fires (WebSocketSourceError::PongTimeout) during run(); the server hasn't answered pings within ping_timeout, so the source shuts down and reports the timeout as a TimedOut io error.
Common situations: Upstream WebSocket service hangs or silently drops the connection; proxy idle timeouts sever the link without a close frame; ping_timeout set lower than the server's keep-alive interval; network outage.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
- Timeouts: ETIMEDOUT, deadlines, and hung requests — what actually expires when a request times out.
Related errors
- Pong not received in time
- {}
- Can't set keepalive on connection that has not been…
- Encountered a connection-time error during runtime
- No timeout is configured for this source.
AI-assisted analysis of vectordotdev/vector@bdb87aeaa4 (2026-09-16).
Data as JSON: /api/errors/23a3570e13a62b0c.
Report an issue: GitHub.
Appendix: source
Thrown at src/sources/websocket/source.rs:133
if let Err(error) = result {
match error {
WebSocketSourceError::RemoteClosed { frame } => {
warn!(
message = "Connection closed by server.",
code = %frame.code,
reason = %frame.reason
);
emit!(WebSocketConnectionShutdown);
}
WebSocketSourceError::RemoteClosedEmpty => {
warn!("Connection closed by server without a close frame.");
emit!(WebSocketConnectionShutdown);
}
WebSocketSourceError::PongTimeout => {
error!("Disconnecting due to pong timeout.");
emit!(WebSocketReceiveError {
error: &TungsteniteError::Io(std::io::Error::new(
std::io::ErrorKind::TimedOut,
"Pong timeout"
))
});
emit!(WebSocketConnectionShutdown);
return Err(error);
}
WebSocketSourceError::Tungstenite { source: ws_err } => {
if is_closed(&ws_err) {
emit!(WebSocketConnectionShutdown);
}
error!(message = "WebSocket connection error.", error = %ws_err);
}
// These errors should only happen during `connect` or `reconnect`,
// not in the main loop's result.
WebSocketSourceError::ConnectTimeout
| WebSocketSourceError::InitialMessageTimeout
| WebSocketSourceError::ConnectionClosedPrematurely => {View on GitHub (pinned to bdb87aeaa4)