{"record":{"id":"23a3570e13a62b0c","repo":"vectordotdev/vector","slug":"pong-timeout","errorCode":null,"errorMessage":"Pong timeout","messagePattern":"Pong timeout","errorType":"exception","errorClass":"TungsteniteError","httpStatus":null,"severity":"error","filePath":"src/sources/websocket/source.rs","lineNumber":133,"sourceCode":"\n            if let Err(error) = result {\n                match error {\n                    WebSocketSourceError::RemoteClosed { frame } => {\n                        warn!(\n                            message = \"Connection closed by server.\",\n                            code = %frame.code,\n                            reason = %frame.reason\n                        );\n                        emit!(WebSocketConnectionShutdown);\n                    }\n                    WebSocketSourceError::RemoteClosedEmpty => {\n                        warn!(\"Connection closed by server without a close frame.\");\n                        emit!(WebSocketConnectionShutdown);\n                    }\n                    WebSocketSourceError::PongTimeout => {\n                        error!(\"Disconnecting due to pong timeout.\");\n                        emit!(WebSocketReceiveError {\n                            error: &TungsteniteError::Io(std::io::Error::new(\n                                std::io::ErrorKind::TimedOut,\n                                \"Pong timeout\"\n                            ))\n                        });\n                        emit!(WebSocketConnectionShutdown);\n                        return Err(error);\n                    }\n                    WebSocketSourceError::Tungstenite { source: ws_err } => {\n                        if is_closed(&ws_err) {\n                            emit!(WebSocketConnectionShutdown);\n                        }\n                        error!(message = \"WebSocket connection error.\", error = %ws_err);\n                    }\n                    // These errors should only happen during `connect` or `reconnect`,\n                    // not in the main loop's result.\n                    WebSocketSourceError::ConnectTimeout\n                    | WebSocketSourceError::InitialMessageTimeout\n                    | WebSocketSourceError::ConnectionClosedPrematurely => {","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sources/websocket/source.rs#L115-L151","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n[sources.ws]\n  type = \"websocket\"\n  ping_timeout = 10\n// after\n[sources.ws]\n  type = \"websocket\"\n  ping_timeout = 60","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Source restarts automatically on PongTimeout; monitor the emitted error\nwarn!(message = \"pong timeout, expecting reconnect\", source_id = ?source_id);","preventionTips":["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."],"tags":["websocket","timeout","keepalive","source","network"],"backgroundTag":"request-timeout","analyzedSha":"bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013","analyzedAt":"2026-09-16T02:53:35.741Z","contentChangedAt":"2026-09-16T02:53:35.741Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}