jitsi / jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
https://jitsi.org/meet
Apache License 2.0
22.95k stars 6.69k forks source link

Screen sharing error #9988

Closed plantiword closed 2 years ago

plantiword commented 3 years ago

When I try to share my screen, sometimes it fails to do so and it brings up a empty error box (see attached image). If I hang up and rejoin I can share my screen with no problem on the same call. It happens to different users of the same installation.

The browser console shows the following error:

[modules/RTC/TraceablePeerConnection.js] <P.addTrack>: TPC[id=1,type=P2P] Adding track=LocalTrack[2,video] failed: Failed to execute 'addTransceiver' on 'RTCPeerConnection': Failed to read the 'streams' property from 'RTCRtpTransceiverInit': Failed to convert value to 'MediaStream'.

right after that error, it shows the following one:

[modules/xmpp/JingleSessionPC.js] : JingleSessionPC[session=P2P,initiator=true,sid=aae9acba2fde] invite error TypeError: Failed to execute 'addTransceiver' on 'RTCPeerConnection': Failed to read the 'streams' property from 'RTCRtpTransceiverInit': Failed to convert value to 'MediaStream'. at h.addTrack (TPCUtils.js:248) at P.addTrack (TraceablePeerConnection.js:1716) at JingleSessionPC.js:976 at a._processQueueTasks (AsyncQueue.js:32) at process (async.js:809) at setImmediate.js:40 at m (setImmediate.js:69) at a (setImmediate.js:109)

A bit down on the console log I see other errors:

[modules/xmpp/JingleSessionPC.js] : JingleSessionPC[session=P2P,initiator=true,sid=aae9acba2fde] Replace track error: Error: replace track failed at h.replaceTrack (TPCUtils.js:345) at P.replaceTrack (TraceablePeerConnection.js:1997) at n (JingleSessionPC.js:2095) at a._processQueueTasks (AsyncQueue.js:32) at process (async.js:809) at setImmediate.js:40 at m (setImmediate.js:69) at a (setImmediate.js:109)

[conference.js] useVideoStream failed: Error: Error: replace track failed [conference.js] : failed to share local desktop Error: Error: replace track failed at JitsiConference.js:1177 at async actions.js:294 at async conference.js:1878 at async Object.toggleScreenSharing (conference.js:1633)

[conference.js] : Failed to switch to screensharing Error: Error: replace track failed at JitsiConference.js:1177 at async actions.js:294 at async conference.js:1878 at async Object.toggleScreenSharing (conference.js:1633)

The entire console log is attached below (console_dump.log).

I'm running Jitsi on Ubuntu 18.04 with the following component versions:

ii jitsi-meet 2.0.6293-1 all WebRTC JavaScript video conferences ii jitsi-meet-prosody 1.0.5307-1 all Prosody configuration for Jitsi Meet ii jitsi-meet-tokens 1.0.5307-1 all Prosody token authentication plugin for Jitsi Meet ii jitsi-meet-turnserver 1.0.5307-1 all Configures coturn to be used with Jitsi Meet ii jitsi-meet-web 1.0.5307-1 all WebRTC JavaScript video conferences ii jitsi-meet-web-config 1.0.5307-1 all Configuration for web serving of Jitsi Meet ii jitsi-videobridge2 2.1-551-g2ad6eb0b-1 all WebRTC compatible Selective Forwarding Unit (SFU)

The browser I use is Chrome 93.0.4577.63 on Windows 10.

Thanks in advance for looking into this.

screensharing_error console_dump.log

saghul commented 3 years ago

@jallamsetty1 can this be because we use unified plan in Chrome without setting the flag?

jallamsetty1 commented 3 years ago

@jallamsetty1 can this be because we use unified plan in Chrome without setting the flag?

I don't think it is has to do with the flag not being set. It looks like a timing related issue where the track is being replaced at the same time as when the peerconnection is created, i.e. when the peer joins the room. The JitsiLocalTrack that is being added to the peerconnection doesn't have a MediaStream attached which is weird. This commit might have fixed this issue.

@plantiword Will you be able to check if this is fixed in the latest unstable build ?

plantiword commented 3 years ago

Hi @saghul and @jallamsetty1 . Thanks for looking at it promptly. I will give it a try using the unstable build and post my results here. Anything in particular I should be looking at (other than screensharing not failing)?

As I mentioned on my original post, this does not happen always and I'm not sure what events trigger the problem.

I will be running tests with the following version:

ii jitsi-meet 2.0.6368-1 all WebRTC JavaScript video conferences ii jitsi-meet-prosody 1.0.5366-1 all Prosody configuration for Jitsi Meet ii jitsi-meet-tokens 1.0.5366-1 all Prosody token authentication plugin for Jitsi Meet ii jitsi-meet-turnserver 1.0.5366-1 all Configures coturn to be used with Jitsi Meet ii jitsi-meet-web 1.0.5366-1 all WebRTC JavaScript video conferences ii jitsi-meet-web-config 1.0.5366-1 all Configuration for web serving of Jitsi Meet ii jitsi-videobridge2 2.1-564-ga688b266-1 all WebRTC compatible Selective Forwarding Unit (SFU)

plantiword commented 3 years ago

@jallamsetty1 @saghul, while testing the unstable version 2.0.6368, the error triggered again. I'm enclosing a console dump with information.

console_dump-unstable-20210924.log .

mishadaut commented 2 years ago

Hi Same problem here.

Tested on following platforms: OSX, Chrome 94.0.4606.61 Windows, Chrome 94.0.4606.71

Jitsi-meetme - 2.0.6293-1 on Ubuntu 20.04

mishadaut commented 2 years ago

Setting the correct values for org.ice4j.ice.harvest.NAT_HARVESTER_LOCAL_ADDRESS and org.ice4j.ice.harvest.NAT_HARVESTER_PUBLIC_ADDRESS settings, has fixed the issue for me.

plantiword commented 2 years ago

Hi @mishadaut , thanks for the info. I configured the those values in /etc/jitsi/videobridge/sip-communicator.properties but still failed (it is a random failure in my case, so it worked fine at the beginning but after a few days we started to get the same error).

What I found to be consistent is that, when it fails, the person sharing always has the camera muted. I haven't looked into jitsi code but the error stack I get says "Replace track error: Error: replace track failed". I wonder if having the camera muted is triggering a condition that leads to the failure. Perhaps this is useful for @jallamsetty1 or @saghul .

Still running the same version I posted in this thread.

saghul commented 2 years ago

Lots of screen sharing fixes have gone into the latest release, any chance you can test that? Can you reproduce it on meet.jit.si

jallamsetty1 commented 2 years ago

Hi @mishadaut , thanks for the info. I configured the those values in /etc/jitsi/videobridge/sip-communicator.properties but still failed (it is a random failure in my case, so it worked fine at the beginning but after a few days we started to get the same error).

What I found to be consistent is that, when it fails, the person sharing always has the camera muted. I haven't looked into jitsi code but the error stack I get says "Replace track error: Error: replace track failed". I wonder if having the camera muted is triggering a condition that leads to the failure. Perhaps this is useful for @jallamsetty1 or @saghul .

Still running the same version I posted in this thread.

@plantiword Can you share you config.js ? Do you have the pre-join page enabled ? Track addition for the first time is failing, for the same reason as I mentioned above, the JitsiLocalTrack doesn't have a media stream attached and therefore all subsequent source changes are failing. Are you able to reproduce it on meet.jit.si ?

plantiword commented 2 years ago

Hi @jallamsetty1 , I'm enclosing the config.js (named config.txt so it can be attached) (removed the commented settings and masked our domain with my.jitsi.com)

We do not have pre-join page enabled (we use token based authentication since Jitsi is embedded in our telehealth platform).

@saghul, I updated the server to the latest unstable version and the problem still happens (these are the components version currently installed: ii jitsi-meet 2.0.6433-1
ii jitsi-meet-prosody 1.0.5415-1
ii jitsi-meet-tokens 1.0.5415-1
ii jitsi-meet-turnserver 1.0.5415-1
ii jitsi-meet-web 1.0.5415-1
ii jitsi-meet-web-config 1.0.5415-1
ii jitsi-videobridge2 2.1-570-gb802be83-1 )

We haven't tried on meet.jit.si so I cannot tell if the problem could be happening there (let me reiterate that the bug does not always trigger, so it be be a couple of days or meetings until it happens; personally, I can say that it seems to happen when I try sharing with the camera off).

Thanks for looking at this.

config.txt

jallamsetty1 commented 2 years ago

Thanks for the logs @plantiword, I have been able to identify the issue. I am working on a fix right now.

plantiword commented 2 years ago

@jallamsetty1, glad to know it was helpful :). Looking forward testing your changes.

AtifShahzed commented 2 years ago

Hi, This is issue is not yet resolved I am faxing this problem in latest release which I hosted on my own server behavior is intermittent, but if I refresh the page and rejoin the meeting so sharing starts working. This issue happens with mac and windows in chrome browsers. Can somebody guide me is there any solution out there.

Thanks