Signaling Problem - Remote Candidate sometimes missing
Steps to reproduce
The exchange of the remote candidates fail sometimes. It's hard to reproduce. But it happens quite often. Try exit and join the room for several times. I use always the public link and only guest access. It happens with Nextcloud 13.01 and Talk 3.1.0. It dos NOT happen with Nextcloud 12.01 and Vide Chat 2.0.1. The infrastructure around is the same.
Expected behaviour
Candidates should exchange correctly and connection should be successful.
Actual behaviour
Sometimes you don't get the remote candidates (but on the peer the local candidates are fine) and the call fails. Also sometimes the video works but screensharing fails with this problem. Sometimes ICE State is in progress but than he switches to empty remote candidates.
Browser
Firefox ESR 52.7.3 (32Bit) Win 10 but also Chrome
Microphone available: yes Camera available: yes Operating system: Windows 10.. Browser version: Firefox ESR 52.7.3
Browser log
Remote SDP
v=0 o=- 2805359158378496159 4 IN IP4 127.0.0.1 s=- t=0 0 a=sendrecv a=group:BUNDLE sdparta_0 sdparta_1 sdparta_2 a=msid-semantic:WMS m2O1JtzsGVEV9hHUKuk7OMbaLZHs2vpmwNmY m=audio 9 UDP/TLS/RTP/SAVPF 109 9 0 8 101 c=IN IP4 0.0.0.0 a=sendrecv a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level a=fingerprint:sha-256 F6:59:64:0B:F2:EF:D1:51:84:8A:17:8D:8C:66:D4:B8:F2:0D:AB:42:02:34:C6:97:5E:05:8A:7E:64:89:C8:3B a=fmtp:109 maxplaybackrate=0;stereo=0;useinbandfec=1 a=ice-options:trickle a=ice-pwd:g0HygqahABZbvT2nj3454FHA a=ice-ufrag:XG2q a=mid:sdparta_0 a=rtcp:9 IN IP4 0.0.0.0 a=rtcp-mux a=rtpmap:109 opus/48000/2 a=rtpmap:9 G722/8000/1 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:101 telephone-event/8000 a=setup:active a=ssrc:960474103 cname:oa2FGUSyngo9UcoD a=ssrc:960474103 msid:m2O1JtzsGVEV9hHUKuk7OMbaLZHs2vpmwNmY 8fb886fa-fac4-4161-8582-a8e937b35af4 a=ssrc:960474103 mslabel:m2O1JtzsGVEV9hHUKuk7OMbaLZHs2vpmwNmY a=ssrc:960474103 label:8fb886fa-fac4-4161-8582-a8e937b35af4 m=video 9 UDP/TLS/RTP/SAVPF 120 121 126 c=IN IP4 0.0.0.0 a=sendrecv a=fingerprint:sha-256 F6:59:64:0B:F2:EF:D1:51:84:8A:17:8D:8C:66:D4:B8:F2:0D:AB:42:02:34:C6:97:5E:05:8A:7E:64:89:C8:3B a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1 a=ice-options:trickle a=ice-pwd:g0HygqahABZbvT2nj3454FHA a=ice-ufrag:XG2q a=mid:sdparta_1 a=rtcp:9 IN IP4 0.0.0.0 a=rtcp-fb:120 goog-remb a=rtcp-fb:120 ccm fir a=rtcp-fb:120 nack a=rtcp-fb:120 nack pli a=rtcp-fb:121 goog-remb a=rtcp-fb:121 ccm fir a=rtcp-fb:121 nack a=rtcp-fb:121 nack pli a=rtcp-fb:126 goog-remb a=rtcp-fb:126 ccm fir a=rtcp-fb:126 nack a=rtcp-fb:126 nack pli a=rtcp-mux a=rtpmap:120 VP8/90000 a=rtpmap:121 VP9/90000 a=rtpmap:126 H264/90000 a=setup:active a=ssrc:3404319695 cname:oa2FGUSyngo9UcoD a=ssrc:3404319695 msid:m2O1JtzsGVEV9hHUKuk7OMbaLZHs2vpmwNmY 0459503c-0f16-4b65-98a9-6d83d03ed45a a=ssrc:3404319695 mslabel:m2O1JtzsGVEV9hHUKuk7OMbaLZHs2vpmwNmY a=ssrc:3404319695 label:0459503c-0f16-4b65-98a9-6d83d03ed45a m=application 9 DTLS/SCTP 5000 c=IN IP4 0.0.0.0 b=AS:30 a=sendrecv a=fingerprint:sha-256 F6:59:64:0B:F2:EF:D1:51:84:8A:17:8D:8C:66:D4:B8:F2:0D:AB:42:02:34:C6:97:5E:05:8A:7E:64:89:C8:3B a=ice-options:trickle a=ice-pwd:g0HygqahABZbvT2nj3454FHA a=ice-ufrag:XG2q a=mid:sdparta_2 a=sctpmap:5000 webrtc-datachannel 1024 a=setup:active
(registry/INFO) insert 'ice' (registry) succeeded: ice (registry/INFO) insert 'ice.pref' (registry) succeeded: ice.pref (registry/INFO) insert 'ice.pref.type' (registry) succeeded: ice.pref.type (registry/INFO) insert 'ice.pref.type.srv_rflx' (UCHAR) succeeded: 0x64 (registry/INFO) insert 'ice.pref.type.peer_rflx' (UCHAR) succeeded: 0x6e (registry/INFO) insert 'ice.pref.type.host' (UCHAR) succeeded: 0x7e (registry/INFO) insert 'ice.pref.type.relayed' (UCHAR) succeeded: 0x05 (registry/INFO) insert 'ice.pref.type.srv_rflx_tcp' (UCHAR) succeeded: 0x63 (registry/INFO) insert 'ice.pref.type.peer_rflx_tcp' (UCHAR) succeeded: 0x6d (registry/INFO) insert 'ice.pref.type.host_tcp' (UCHAR) succeeded: 0x7d (registry/INFO) insert 'ice.pref.type.relayed_tcp' (UCHAR) succeeded: 0x00 (registry/INFO) insert 'stun' (registry) succeeded: stun (registry/INFO) insert 'stun.client' (registry) succeeded: stun.client (registry/INFO) insert 'stun.client.maximum_transmits' (UINT4) succeeded: 7 (registry/INFO) insert 'ice.trickle_grace_period' (UINT4) succeeded: 5000 (registry/INFO) insert 'ice.tcp' (registry) succeeded: ice.tcp (registry/INFO) insert 'ice.tcp.so_sock_count' (INT4) succeeded: 0 (registry/INFO) insert 'ice.tcp.listen_backlog' (INT4) succeeded: 10 (registry/INFO) insert 'ice.tcp.disable' (char) succeeded: \001 (ice/WARNING) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) has no stream matching stream 0-1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8) aLevel=1 (ice/WARNING) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) has no stream matching stream 0-1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8) aLevel=2 (ice/NOTICE) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) no streams with non-empty check lists (ice/NOTICE) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) no streams with pre-answer requests (ice/NOTICE) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) no checks to start (ice/ERR) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) pairing local trickle ICE candidate host(IP4:192.168.0.117:58060/UDP) (stun/INFO) STUN-CLIENT(relay(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:443/UDP)::TURN): Received response; processing (stun/WARNING) STUN-CLIENT(relay(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:443/UDP)::TURN): Error processing response: Retry may be possible, stun error code 401. (stun/INFO) STUN-CLIENT(relay(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:443/UDP)::TURN): Received response; processing (turn/INFO) TURN(relay(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:443/UDP)): Succesfully allocated addr IP4:129.X.X.X:52355/UDP lifetime=3600 (ice/ERR) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) pairing local trickle ICE candidate srflx(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:443/UDP) (ice/ERR) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) pairing local trickle ICE candidate turn-relay(IP4:192.168.0.117:58060/UDP|IP4:129.X.X.X:52355/UDP) (generic/INFO) Write buffer not empty for IP4:129.X.X.X:443/TCP 44 - already armed (@07DFE6C0), not connected (generic/EMERG) Firing write callback (0) (generic/INFO) Invoking writable_cb on connected (44) (generic/INFO) Writable_cb IP4:129.X.X.X:443/TCP (0 (07DFE6C0) pending) (generic/ERR) UpdateBufferedAmount: (tracking 1): 0, waiting: no (generic/EMERG) Firing read callback (1) (stun/INFO) STUN-CLIENT(relay(IP4:192.168.0.117:0/TCP|IP4:129.X.X.X:443/TCP)::TURN): Received response; processing (stun/WARNING) STUN-CLIENT(relay(IP4:192.168.0.117:0/TCP|IP4:129.X.X.X:443/TCP)::TURN): Error processing response: Retry may be possible, stun error code 401. (generic/ERR) UpdateBufferedAmount: (tracking 2): 0, waiting: no (generic/EMERG) Firing read callback (1) (stun/INFO) STUN-CLIENT(relay(IP4:192.168.0.117:0/TCP|IP4:129.X.X.X:443/TCP)::TURN): Received response; processing (turn/INFO) TURN(relay(IP4:192.168.0.117:0/TCP|IP4:129.X.X.X:443/TCP)): Succesfully allocated addr IP4:129.X.X.X:51698/UDP lifetime=3600 (ice/ERR) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) pairing local trickle ICE candidate turn-relay(IP4:192.168.0.117:0/TCP|IP4:129.X.X.X:51698/UDP) (stun/INFO) Unrecognized attribute: 0x802b (stun/INFO) Unrecognized attribute: 0x802c (stun/INFO) STUN-CLIENT(srflx(IP4:192.168.0.117:58060/UDP|stun.nextcloud.com:443)): Received response; processing (ice/INFO) ICE(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8)): peer (PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default) Trickle grace period is over; marking every component with only failed pairs as failed. (ice/INFO) ICE-PEER(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default)/STREAM(0-1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8) aLevel=0)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed. (ice/INFO) ICE-PEER(PC:1524044744724000 (id=2147483652 url=https://nextcloud.XXX.de/Team/index.php/call/qi8r4kb8):default): all checks completed success=0 fail=1 +++++++ END ++++++++
Spreed app
Spreed app version:: 3.0.1
Custom TURN server configured: yes STUN: stun.nextcloud:443 TURN: Server-IP:443 Secret UDP and TCP
Custom STUN server configured: yes on public IP turnserver-4.5.0.7-CentOS7.4-x86_64
listening-port=443 fingerprint use-auth-secret static-auth-secret=xx realm=turn.xxx.de total-quota=0 cipher-list="DEFAULT" no-stdout-log log-file=/var/tmp/turn.log no-loopback-peers no-multicast-peers pidfile="/var/run/turnserver/turnserver.pid"
Server configuration
Operating system: OpenSuse 42.3 - Nextcloud / Centos 7 Coturn
Web server: Apache 2.4 There ist also a reverse Proxy in front of the Nextcloud.
Could the reverse proxy the problem? Do I need Websockets?
ProxyPass /Team https://nextcloud.intern.de/nextcloud ProxyPassReverse /Team https://nextcloud.intern.de/nextcloud
Database: PostgreSQL
PHP version:: 7
Nextcloud Version: 13.0.1
List of activated apps: Default installation plus LDAP TOTP
I also did configure Nextcloud to a public IP. The problem also appears but I guess not so frequent as behind a reverse proxy.
Here is the Browser log: The video connection works, but screensharing failed. I don't see the remote candidates in about:webrtc for the screensharing session. .
PEER CREATED Object { id: "FpP8LHYWENqx4FiDKao6UJum6ijxO60+3dj…", parent: Object, type: "screen", oneway: false, sharemyscreen: true, browserPrefix: undefined, stream: undefined, enableDataChannels: false, receiveMedia: Object, channels: Object, 6 more… } webrtc.js:618:4 Empty string passed to getElementById(). simplewebrtc.js:18305:10 RTCIceServer.url is deprecated! Use urls instead. simplewebrtc.js:14195 onaddstream is deprecated! Use peerConnection.ontrack instead. simplewebrtc.js:14213 OFFER Object { to: "FpP8LHYWENqx4FiDKao6UJum6ijxO60+3dj…", sid: "1524315737140", broadcaster: "Pkr1uPq8FQDYDv3Kq1lHcStI9Y/YHu2VIe9…", roomType: "screen", type: "offer", payload: Object, prefix: "moz" } signaling.js:357:4 iceFailed event received simplewebrtc.js:18108:4 SimpleWebRTC/< https://XXXX.de/Team/apps/spreed/js/simplewebrtc.js:18108:4 [100]</WildEmitter.mixin/prototype.emit https://it-service.zae-bayern.de/Team/apps/spreed/js/simplewebrtc.js:17524:6 Peer/< https://XXXX.de/Team/apps/spreed/js/simplewebrtc.js:17673:7 [100]</WildEmitter.mixin/prototype.emit https://it-service.zae-bayern.de/Team/apps/spreed/js/simplewebrtc.js:17524:6 TraceablePeerConnection/this.peerconnection.oniceconnectionstatechange https://XXXX.de/Team/apps/spreed/js/simplewebrtc.js:14237:5 had local relay candidate true simplewebrtc.js:18110:4 had remote relay candidate true simplewebrtc.js:18111:4 ICE failed, see about:webrtc for more details (unknown) trace Object { time: Date 2018-04-21T13:04:10.818Z, type: "oniceconnectionstatechange", value: "disconnected" } webrtc.js:392:6 Disconnected. webrtc.js:349:8
When connections for Talk are not working, it's not the Nextcloud which is the problem. Video calls happen peer to peer, the connection does not go through your Nextcloud. So make sure you set up a Turn server and configure that in your admin settings of the talk app.
As I wrote I'm using a turn server. The turn server works fine. I know the connection is peer to peer/turn, but the singnaling is handled by talk/nextcloud. And it's a signaling problem. With Nextcloud 12.01 and Video Chat 2.0.1. everything is working fine. There must be a difference between the versions.
Please, update to the latest version of the app - 3.2.0, and see if you can reproduce it.
I can reproduce the problem and I know where the bug is: I use LDAP with 250 users and postgresql. I switch from postgres to sqllite for testing (same VM) and the singnaling works stable. The the postgresql implementation has the bug. I noticed a huge amount of SQL statements during signaling - it almost never stopped. I don't have the time and knowledge to do a further analysis. So maybe you can have a look.
Do you recommend using mysql?
I see even more bugs in the new version:
The "join call" button did not change to "leave call" and it's not possible to leave a call.
Looks like the connection is established even when the permission for the cam is not permitted yet. Than the there is no video div in the HTML code.
Firefox: 59.0.3 (64Bit) shows only black windows (cam and sharing) but the video div is available.
Well yes, the signaling creates a "huge" amount of database load. It's 3 queries per user and second.
The "join call" button did not change to "leave call" and it's not possible to leave a call.
See #858
Looks like the connection is established even when the permission for the cam is not permitted yet.
See #850
Ok, so the database load is ok.
SQLite und Mysql works fine. Can you reproduce the problem with postgresql?
Not sure if related, but I'm experiencing an issue where the "ICE configuration failed, configure a TURN server" message shows up in the developer console. I understand that a TURN server can be needed if WebRTC cannot pass the firewall, but the strange part is that it sometimes works and sometimes doesn't. Once it's up, it continuous working fine.
In v3.1.0 and v3.2.0, it worked about half of the time (usually needed up to four rejoins for it to work), but since v3.2.1, it now usually doesn't work and works after trying a couple of times (usually up to ten rejoins or higher).
I'm also aware of this Firefox issue, but also not sure if it is related.
In case it matters: I'm on Linux (Firefox) and the other participant is on Windows (Opera).
Also note that Nextcloud Talk is not meant to work for hundreds of users without the Spreed High Performance Backend which, among other things, takes care of signaling... PHP just isn't capable of this.
If you have more than ~100 users and experience performance issues, contact Nextcloud Sales for access to Spreed.