InvalidStateError: Failed to set remote answer sdp: Called in wrong state: kStable
See original GitHub issuehey there,
I have implemented simple-peer.js and I have the error when I send the answer : InvalidStateError: Failed to set remote answer sdp: Called in wrong state: kStable
Here is my config :
let p = new Peer({
initiator: initiator,
stream: stream,
config:
{
'iceServers': [
{
'urls': 'stun:eu-xxxxx.com'
},
{
'urls': 'turn:eu-xxxxx=udp',
'credential': 'xxxxxxxx',
'username': 'xxxxxx'
},
]
},
trickle:false
})
Have you an idea to fix this error ?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
Failed to set remote answer sdp: Called in wrong state: stable
The reason why you are getting this error message is because when a third user joins, it sends an offer to the 2...
Read more >RTCPeerConnection setting offer sdp does not match the ...
Failed to create session description: InvalidStateError: Failed to execute ... Failed to set remote answer sdp: Called in wrong state: kStable.
Read more >RE: InvalidStateError: Failed to set remote answer sdp: Called in ...
openmeetings.apache.org> Objet : RE: InvalidStateError: Failed to set remote answer sdp: Called in wrong state: kStable I have just tried with chrome in ......
Read more >3410 - Failed to set remote offer sdp: Called in wrong state
Hi Braveyao, Thanks for the response, This was the offer SDP problem, instead of answer SDP, offer SDP is sent.
Read more >Failed to set remote answer sdp: Called in wrong state: kStable
Why is this error happening and when is the signalling state of peer = “stable”
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have tracked down the issue by pure luck. Since most of us are probably started off the same tutorials… the issue only happens with more than 2 connections (peers). And the issue is this:
The peerClient and msg.from are arbitrary Identifier of your peer between your javascript and the signaling server.
Basically what happens is you are trying to set an answer or ice-candidate on the wrong peer and they don’t like it 😃
Hope this helps.
my error was because i was accidentally creating peer with the current user’s connectionId instead of the connectionId of the user im trying to connect to…