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

  1. Raise ping_timeout in the websocket source configuration to exceed the server's keep-alive interval.
  2. Verify the server/proxy responds to pings and doesn't silently idle-drop connections (adjust LB idle timeout).
  3. Check upstream service health; the source will reconnect automatically after the error.
  4. 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

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.

Related errors


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)