[discuss-webrtc] setLocalDescription fail.

565 views
Skip to first unread message

lx

unread,
May 28, 2018, 5:29:16 AM5/28/18
to discuss...@googlegroups.com
Hi all:
        I learn webrtc by https://codelabs.developers.google.com/codelabs/webrtc-web/#8 .
Chrome version:  66.0.3359.181 
OS : windows 7

When the peer call setLocalDesription, it fail.

##################################################
if (isInitiator) {
  console.log('Creating Data Channel');
  dataChannel = peerConn.createDataChannel('photos');
  onDataChannelCreated(dataChannel);

  console.log('Creating an offer');
  peerConn.createOffer(onLocalSessionCreated, logError);
} else {
  peerConn.ondatachannel = function(event) {
    console.log('ondatachannel:', event.channel);
    dataChannel = event.channel;
    onDataChannelCreated(dataChannel);
  };
}
}

function onLocalSessionCreated(desc) {
  console.log('local session created:', desc);
  peerConn.setLocalDescription(desc, function() {
    console.log('sending local desc:', peerConn.localDescription);
    sendMessage(peerConn.localDescription);
  }, logError);
  
  
  /*
  peerConn.setLocalDescription(desc);
  console.log('sending local desc:', peerConn.localDescription);
  sendMessage(peerConn.localDescription);
  */
}
##################################################

The log is:
##################################################
Creating Data Channel
main.js:247 onDataChannelCreated: RTCDataChannel {send: ƒ, label: "photos", ordered: true, maxRetransmitTime: 65535, maxRetransmits: 65535, …}
main.js:220 Creating an offer
main.js:232 local session created: RTCSessionDescription {type: "offer", sdp: "v=0
↵o=- 7092203944903238858 2 IN IP4 127.0.0.1
↵s…id:data
↵a=sctpmap:5000 webrtc-datachannel 1024
↵"}sdp: "v=0
↵o=- 7092203944903238858 2 IN IP4 127.0.0.1
↵s=-
↵t=0 0
↵a=group:BUNDLE data
↵a=msid-semantic: WMS
↵m=application 9 DTLS/SCTP 5000
↵c=IN IP4 0.0.0.0
↵a=ice-ufrag:uX0b
↵a=ice-pwd:AVmsmzfP7hilo9+k5aA0j73T
↵a=ice-options:trickle
↵a=fingerprint:sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3
↵a=setup:actpass
↵a=mid:data
↵a=sctpmap:5000 webrtc-datachannel 1024
↵"type: "offer"__proto__: RTCSessionDescription
main.js:232 local session created: RTCSessionDescription {type: "offer", sdp: "v=0
↵o=- 3324282072586107475 2 IN IP4 127.0.0.1
↵s…id:data
↵a=sctpmap:5000 webrtc-datachannel 1024
↵"}sdp: "v=0
↵o=- 3324282072586107475 2 IN IP4 127.0.0.1
↵s=-
↵t=0 0
↵a=group:BUNDLE data
↵a=msid-semantic: WMS
↵m=application 9 DTLS/SCTP 5000
↵c=IN IP4 0.0.0.0
↵a=ice-ufrag:LsOc
↵a=ice-pwd:KrFJCKdeA5XppQtilOVGuto3
↵a=ice-options:trickle
↵a=fingerprint:sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE
↵a=setup:actpass
↵a=mid:data
↵a=sctpmap:5000 webrtc-datachannel 1024
↵"type: "offer"__proto__: RTCSessionDescriptionsdp: (...)toJSON: ƒ toJSON()type: (...)constructor: ƒ RTCSessionDescription()Symbol(Symbol.toStringTag): "RTCSessionDescription"get sdp: ƒ ()set sdp: ƒ ()get type: ƒ ()set type: ƒ ()__proto__: Object
main.js:414 OperationError: Failed to set local offer sdp: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3 DOMException: Failed to set local offer sdp: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3
logError @ main.js:414
main.js:414 OperationError: Session error code: ERROR_CONTENT. Session error description: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3. DOMException: Session error code: ERROR_CONTENT. Session error description: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3.
logError @ main.js:414
##################################################


How to debug it? This is bug about Chrome?
Thank you.






Harald Alvestrand

unread,
May 28, 2018, 5:36:42 AM5/28/18
to WebRTC-discuss
Look at these two lines:

↵a=fingerprint:sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3

main.js:414 OperationError: Failed to set local offer sdp: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3 DOMException: Failed to set local offer sdp: Failed to push down transport description for data: Local fingerprint does not match identity. Expected: sha-256 CB:4E:B5:25:34:E5:3B:22:71:15:0B:53:43:BF:22:A8:67:51:79:A0:B4:DD:5F:F8:46:1B:9C:95:46:54:E2:EE Got: sha-256 26:36:B2:06:96:84:97:6B:EA:58:72:C6:70:7B:B9:D1:29:07:C3:BD:04:E3:8C:0C:21:3B:A1:4E:43:92:96:B3

What it says is that the description you log (26:36:B2) is not the description produced by the last CreateOffer you called on that PeerConnection (CB:4E:B5).

It's likely that through some code path not in your example, you called CreateOffer again between the first CreateOffer and the SetLocalDescription.


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CA%2B5jrfnRYHBypOuTH5gntbGjwGwKkUq%3DGaiB7ZJm6ZS-UpHcJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

lx

unread,
May 28, 2018, 6:28:55 AM5/28/18
to discuss...@googlegroups.com
Thank you.  I fix it by:

#######################################################
  socket.on('create or join', function(room) {
    log('Received request to create or join room ' + room);

    var clientsInRoom = io.sockets.adapter.rooms[room];
    var numClients = clientsInRoom ? Object.keys(clientsInRoom.sockets).length : 0;
    log('Room ' + room + ' now has ' + numClients + ' client(s)');

    if (numClients === 0) {
      socket.join(room);
      log('Client ID ' + socket.id + ' created room ' + room);
      socket.emit('created', room, socket.id);
    } else if (numClients === 1) {
      log('Client ID ' + socket.id + ' joined room ' + room);
      // io.sockets.in(room).emit('join', room);
      socket.join(room);
      socket.emit('joined', room, socket.id);
      io.sockets.in(room).emit('ready', room);
      //socket.broadcast.emit('ready', room);
    } else { // max two clients
      socket.emit('full', room);
    }
  });
######################################################




Reply all
Reply to author
Forward
0 new messages