stale-psychiatrist-58431
07/28/2025, 11:41 AMtall-airline-16756
07/28/2025, 11:41 AMtall-airline-16756
07/28/2025, 11:43 AMdropping candidate with ufrag because it doesn't match the current ufrags occurs during ICE (Interactive Connectivity Establishment) candidate validation. It indicates a mismatch between the username fragment (ufrag) in an incoming ICE candidate and the expected ufrag for the current ICE session.
What is ufrag?
The ufrag (username fragment) is part of ICE authentication credentials used in WebRTC connections. It ensures that candidates belong to the correct ICE session.
Why This Error Occurs
This error typically happens in the following scenarios:
• ICE Restart: New credentials are generated, but old candidates with the previous ufrag are still being received.
• Timing Issues: Candidates arrive after ICE credentials have been updated.
• Multiple ICE Sessions: Candidates from different ICE sessions are being mixed.
• Network Issues: Delayed or out-of-order candidate delivery.
Connection Implications
When this error occurs, the specific ICE candidate with the mismatched ufrag is dropped. The connection may still succeed if other valid candidates are available. However, if all candidates have mismatched ufrags, the connection will fail.
Troubleshooting Steps
1. Ensure your application properly handles ICE restarts and updates credentials accordingly.
2. Check for race conditions between credential updates and candidate processing.
3. Review server logs for detailed information about the ufrag mismatch, including the expected vs. received values.
4. Validate that SDP fragments and offers/answers are processed in the correct order.
This error is part of LiveKit's robust ICE validation system, designed to ensure connection security and prevent credential confusion between different ICE sessions.
Sources: sdp/sdp_test.go | release/adapter_no_edge_no_global.js | pkg/rtc/transport.go