{"record":{"id":"c0f80142ebc9ae16","repo":"vectordotdev/vector","slug":"pong-not-received-in-time","errorCode":null,"errorMessage":"Pong not received in time","messagePattern":"Pong not received in time","errorType":"exception","errorClass":"TungsteniteError","httpStatus":null,"severity":"error","filePath":"src/sinks/websocket/sink.rs","lineNumber":70,"sourceCode":"            ping_timeout: config.common.ping_timeout,\n        })\n    }\n\n    async fn create_sink_and_stream(\n        &self,\n    ) -> (\n        impl Sink<Message, Error = TungsteniteError> + use<>,\n        impl Stream<Item = Result<Message, TungsteniteError>> + use<>,\n    ) {\n        let ws_stream = self.connector.connect_backoff().await;\n        ws_stream.split()\n    }\n\n    fn check_received_pong_time(&self, last_pong: Instant) -> Result<(), TungsteniteError> {\n        if let Some(ping_timeout) = self.ping_timeout\n            && last_pong.elapsed() > Duration::from_secs(ping_timeout.into())\n        {\n            return Err(TungsteniteError::Io(io::Error::new(\n                io::ErrorKind::TimedOut,\n                \"Pong not received in time\",\n            )));\n        }\n\n        Ok(())\n    }\n\n    async fn handle_events<I, WS, O>(\n        &mut self,\n        input: &mut I,\n        ws_stream: &mut WS,\n        ws_sink: &mut O,\n    ) -> Result<(), ()>\n    where\n        I: Stream<Item = Event> + Unpin,\n        WS: Stream<Item = Result<Message, TungsteniteError>> + Unpin,\n        O: Sink<Message, Error = TungsteniteError> + Unpin,","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/vectordotdev/vector/blob/bdb87aeaa4c4ff27c0ba643c1c77b21bf2ef4013/src/sinks/websocket/sink.rs#L52-L88","documentation":"The WebSocket sink optionally requires periodic Pong frames from the server when ping_timeout is configured. check_received_pong_time compares the elapsed time since the last received pong against ping_timeout; if exceeded, it returns a TungsteniteError wrapping an io::Error with ErrorKind::TimedOut and message 'Pong not received in time'. This indicates the server is unresponsive to keep-alive pings and the connection is treated as dead.","triggerScenarios":"ping_timeout is set on the websocket sink, no pong frame has been received for longer than ping_timeout seconds, and the sink's health loop calls check_received_pong_time.","commonSituations":"Server does not answer ping frames; intermediary proxies/load balancers drop idle WebSocket connections; ping_timeout configured too aggressively for the server's response latency; network partitions.","solutions":["Increase ping_timeout in the sink configuration to accommodate server/network latency.","Verify the server actually responds to WebSocket ping frames (many services only answer protocol-level pings irregularly).","Ensure proxies/load balancers are configured with idle timeouts longer than ping_timeout.","Rely on Vector's retry behavior; the sink reconnects after this error by design."],"exampleFix":"// before\n[sinks.my_ws]\n  type = \"websocket\"\n  ping_timeout = 5\n// after\n[sinks.my_ws]\n  type = \"websocket\"\n  ping_timeout = 60","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// sink reconnects automatically; capture in logs\nerror!(message = \"websocket pong timeout\", error = ?err); // rely on Vector retry/backoff","preventionTips":["Set ping_timeout well above server/proxy idle timeouts.","Confirm the server replies to ping frames before enabling ping_timeout.","Keep TCP keepalives and LB idle timeouts consistent with ping_timeout."],"tags":["websocket","timeout","keepalive","sink"],"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"}