Skip to content

Conversation

sirknightj
Copy link
Contributor

Issue #, if available:

  • Did not create an issue for it. I observed the log in my runs, which indicates that the STUN server is unreachable:
2025-05-06 00:43:43.406 INFO    getIpWithHostName(): ICE SERVER Hostname received: stun.kinesisvideo.us-west-2.amazonaws.com
2025-05-06 00:43:43.456 PROFILE parseIceServer(): ICE Server address for stun.kinesisvideo.us-west-2.amazonaws.com: 35.165.173.98

...

2025-05-06 00:43:43.526 DEBUG   iceUtilsSendStunPacket(): Sending BINDING_REQUEST to ip:35.165.173.98, port:443
2025-05-06 00:43:43.526 ERROR   socketSendDataWithRetry(): sendto() failed with errno No route to host(65)
2025-05-06 00:43:43.526 DEBUG   socketSendDataWithRetry(): Dest Ip: 35.165.173.98:443. family:1
2025-05-06 00:43:43.526 DEBUG   socketSendDataWithRetry(): hostIpAddr Ip: 11.112.x.x:58688. family:1
2025-05-06 00:43:43.526 DEBUG   socketSendDataWithRetry(): Close socket 14
2025-05-06 00:43:43.526 DEBUG   socketSendDataWithRetry(): Failed to send data. Bytes sent 0. Data len 28. Retry count 0
2025-05-06 00:43:43.526 DEBUG   socketSendDataWithRetry(): Warning: Send data failed with 0x5800001a

What was changed?

  • Add additional logs. Specifically, the socket id (file descriptor) for each socket created.

Why was it changed?

  • The socket ID helped me to troubleshoot the issue. By adding the socket id to its creation log, I was able to match the IP with the closing log (above). We can see it says "Close socket 14", but there is no corresponding 'open' log. It turns out that my socket 14 corresponded to:
2025-05-06 02:22:33.739 DEBUG   createSocketConnection(): create socket id: 12, with ip: 192.168.1.112:57914. family:1
2025-05-06 02:22:33.739 DEBUG   createSocketConnection(): create socket id: 13, with ip: 11.112.x.x:56696. family:1
2025-05-06 02:22:33.739 PROFILE iceAgentStartGathering(): [Host candidates setup time] Time taken: 0 ms
2025-05-06 02:22:33.739 DEBUG   createSocketConnection(): create socket id: 14, with ip: 11.112.x.x:57142. family:1
2025-05-06 02:22:33.739 DEBUG   createSocketConnection(): create socket id: 15, with ip: 192.168.1.112:63430. family:1

the utun1000 network interface, which seems to not be working (no route to host). I added the utun* interface to the network interface filter and all the logs got cleaned up on my end.

How was it changed?

  • Print the socket id (file descriptor) when the socket is created and when sendto fails to send the packet.

What testing was done for the changes?

  • Run the changes locally.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@sirknightj sirknightj force-pushed the socket-id-debug-logs branch from 7f108dc to a3a9495 Compare May 7, 2025 22:49
@sirknightj sirknightj changed the base branch from release-v1.12.1 to develop May 7, 2025 22:49
@sirknightj sirknightj merged commit cfa96a9 into develop May 21, 2025
1 check passed
@sirknightj sirknightj deleted the socket-id-debug-logs branch May 21, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants