Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STUN message send failed / STUN local ufrag check failed. #223

Closed
mhoeben opened this issue Oct 9, 2023 · 4 comments
Closed

STUN message send failed / STUN local ufrag check failed. #223

mhoeben opened this issue Oct 9, 2023 · 4 comments

Comments

@mhoeben
Copy link

mhoeben commented Oct 9, 2023

I use libjuice as part of libdatachannel and regularly see sequences of messages like this:

rtc::impl::IceTransport::LogCallback@362: juice: Send failed, errno=101
rtc::impl::IceTransport::LogCallback@362: juice: STUN message send failed
rtc::impl::IceTransport::LogCallback@362: juice: STUN local ufrag check failed, expected="Sb+z", actual="lwFV"
rtc::impl::IceTransport::LogCallback@362: juice: STUN message verification failed
rtc::impl::IceTransport::LogCallback@362: juice: STUN local ufrag check failed, expected="Sb+z", actual="lwFV"
etc...

Most of the times I setup a session I don't see the messages, however, in approximately 10% of the sessions the pattern repeats multiple times until it seems to settle. Any idea whether this is an error on my behalf, occasionally to be expected or a bug in the library?

@paullouisageneau
Copy link
Owner

The Send failed, errno=101 is no big deal, it could just mean that IPv6 connectivity is not working.

The ufrag check failed may indicate a signaling or compatibility issue. Is the remote agent aiortc by any chance? This could by the symptom of paullouisageneau/libdatachannel#982, which is fixed but not part of a release for now.

@mhoeben
Copy link
Author

mhoeben commented Oct 12, 2023

Understood about the errno=101.

The STUN server is stun.l.google.com:19302. The WebRTC peer is a Chrome browser and the server that uses libdatachannel runs in AWS. Not sure which data point is the one you are asking for.

Note that this happens before the Chrome browser connects. It is during the ICE establishment phase of setting up a peer connection. I use ICE/STUN to determine the server's public IP address and reachable port to be able to provide an offer as soon as a client connects over the signalling web socket.

@paullouisageneau
Copy link
Owner

It could be caused by a earlier peer connection on the same port as the new one closed on server side but not timed out on another client. Do you add tracks only and no datachannels? Have you changed libdatachannel's port range to something custom?

I use ICE/STUN to determine the server's public IP address and reachable port to be able to provide an offer as soon as a client connects over the signalling web socket.

Note that you should not keep the peer connection waiting with an unsent generated offer, instead you should create it only when the websocket is connected.

@mhoeben
Copy link
Author

mhoeben commented Oct 12, 2023

I add an audio and video track, as well as a data channel. And yes, I have limited the port range so I don't have to open too many ports on my EC2 instance. You could very well be right that it is responses from an older session. I will check that.

Note that you should not keep the peer connection waiting with an unsent generated offer, instead you should create it only when the websocket is connected.

Ok. I did it in the interest of quickly starting the session, but I see that it may cause problems.

Thanks for your help. I consider the issues satisfactorily addressed until I can provide more information.

@mhoeben mhoeben closed this as completed Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants