question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DOMException: "Failed to parse SDP: SDP Parse Error on line 6: No webrtc-datachannel token in m= media line, parse failed.

See original GitHub issue

Seeing this error in firefox when calling peer.signal(offer). This is logged from from peer.on('error', (err) => {})

offer looks like:

{
  "type": "answer",
  "sdp": "v=0\no=- 2361903802410725008 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=msid-semantic: WMS\r\nm=application 0 UDP/DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\na=mid:0\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"
}

It looks like m=application 0 UDP/DTLS/SCTP 5000. The \r\n carriage returns are concerning. I tried replacing them offer.sdp = offer.sdp.replace('\r\n', '\n'); with no luck.

This same handshake setup works in Chrome the crome answer looks like:

{
"type":"answer",
"sdp":"v=0\r\no=- 6148643454612116579 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE data\r\na=msid-semantic: WMS\r\nm=application 9 DTLS/SCTP 5000\r\nc=IN IP4 0.0.0.0\r\nb=AS:30\r\na=ice-ufrag:FC2g\r\na=ice-pwd:FAYzNn2P/NKl3nPazdVjK5Vj\r\na=fingerprint:sha-256 C6:33:30:F2:11:1D:FE:31:4D:F5:70:F3:6A:84:1B:98:36:EB:A3:D0:C1:DB:88:EC:24:52:EF:D1:1D:A0:F2:A7\r\na=setup:active\r\na=mid:data\r\na=sctpmap:5000 webrtc-datachannel 1024\r\n"
}

m here looks like m=application 9 DTLS/SCTP 5000

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kevzettlercommented, Jan 31, 2019

You’re connecting Firefox-to-Firefox correct? What do your peer options look like?

No. Firefox-to-Node.js

checkout https://stackoverflow.com/questions/54466865/firefox-webrtc-signaling-domexception-failed-to-parse-sdp

sounds like there is a breaking change between Firefox SDP parsing and the node.js wrtc module output. Going to close because don’t think its directly related to simple-peer.

1reaction
t-mullencommented, Jan 29, 2019

Your offer is an not an offer but SDP answer (it says in the type field). It’s definitely not complete (missing a fingerprint for one). Can you double check that there isn’t a problem with your signalling setup?

You shouldn’t remove carriage returns, they’re correct.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firefox WebRTC signaling DOMException Failed to parse SDP
DOMException : "Failed to parse SDP: SDP Parse Error on line 6: No webrtc-datachannel token in m= media line, parse failed.
Read more >
Firefox Webrtc Signaling Domexception Failed To ... - ADocLib
DOMException : Failed to parse SDP: SDP Parse Error on line 6: No webrtcdatachannel token in m media line parse failed. DOMException: Failed...
Read more >
SDP Parsing Error: End of line beyond end of buffer.
After some search I found the function sdp_parse where this fails, and it seems that the SDP does not fit in the created...
Read more >
WebRTC publish problem - Wowza Community
DOMException : Failed to parse SessionDescription. ... "Failed to parse SDP: SDP Parse Error on line 17: Warning: Invalid token ordering ...
Read more >
WebRTC 1.0: Real-Time Communication Between Browsers
If the parsing based on the syntax defined in [ RFC3986 ] fails, ... is the offerer tagged m= section without having to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found