Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Rocket.Chat Screen Share and Jidesha Chrome extensions returning "Permission Denied"

Open james-mcgoodwin opened this issue 10 years ago • 32 comments

Hooo kay, think I'll dive in here too with some of my findings as well.

Apologies in advance for the deep verbosity, but I've exhausted most of the avenues of investigation that I can figure to check. I hope this is not too much information in one go, but please forgive me if it is.

My base problem is that while RocketChat starts video conferences, I cannot launch a desktop screen share from one client to another. This includes both in Chrome and the RC client (have not tested firefox). The error message received back reads:

Permission Denied Failed to install desktop sharing extension

TL;DR : I'm likely doing something wrong in my configs, or in my assumptions. Any advice would be appreciated.

The following currently open tickets seem to have the same issue: #3560 #3797

A quick rundown of what I'm trying to do:

Objectives

  • Rocketchat for text based group comms
  • Jitsi Video Bridge / Jisi Meet / Prosoity for group video conferencing
  • Rocketchat to perform AD Authentication for company employees to the text and VC rooms

Pretty standard requirement list.

Assumptions

  • If the server setup works with these Ubuntu test clients, the same will be true for Windows/MacOS setup with the same browser/extensions
  • No microphone or camera is needed by a client to start screen sharing
  • The Jidesha Chrome extension should be used instead of the RocketChat Chrome extension since Jidesha can/must be configured for the domains Jitsi is built on. (The RC Chrome Extension cannot be customized)

Machines I've got two servers and two client computers, all Ubuntu 16.04:

  • rocket_chat_rc01 : The rocket chat server with the following packages:
    • npm: 3.5.2-0ubuntu4
    • nodejs: 0.10.46
    • mongodb-org (meta package): 3.0.12
    • Rocket Chat: 0.36.0
    • nginx: 1.10.0-0ubuntu0.16.04.2
  • rocket_chat_jitsi01 : The jitsi server with the following packages:
    • jitsi-videobridge: 757-1
    • jitsi-meet: 1.0.1108-1
    • jitsi-meet-prosody: 1.0.1108-1
    • prosody: 0.9.10-1
    • jicofo: 1.0-273-1
    • nginx: 1.10.0-0ubuntu0.16.04.2
    • openjdk-8-jre-headless: 8u91-b14-3ubuntu1~16.04.1
  • rocket_chat_client01 and _client02 : Test clients with the following packages:
    • xfce4 (meta package): 4.12.2
    • rocketchat: 1.3.1
    • chromium-browser: 51.0.2704.79-0ubuntu0.16.04.1.1242
    • Chrome Extension - Jidesha: 0.1.5
    • Chrome Extension - Rocket.Chat Screen Share: 0.1.0
    • No other Chrome Extensions are installed
    • NOTE: Only one extension was installed at a time. Trial1 conducted with Jidesha, then it is removed and for Trial2 Rocket.Chat Screen Share is installed.

Network All servers are on the following network:

  • 10.99.212.208/28
    • No packet filtering is occurring on the network infrastructure
    • All Ubuntu instances have iptables disabled.
    • I wont bother listing the IP assignments here unless asked. Doesn't seem relevant ATM.

Hostnames (A records / CNAMES) have been setup for:

  • jitsi.maas --> rocket_chat_jitsi01
  • rocketchat.maas --> rocket_chat_rc01

PKI I've built a self signed root CA and applied it to all servers/services with the following alternative subject names:

  • jitsi.maas
  • jitsi-videobridge.jitsi.maas
  • auth.jitsi.maas
  • focus.jitsi.maas
  • conference.jitsi.maas
  • meet.jitsi.maas
  • rocketchat.maas

That cert is used by Nginx on both servers as well as prosody in the Jitsi server. The cert has been added to the trusted root cert store in both Ubuntu clients

Jidesha I've compiled the Jidesha plugin with the following manifest:

$  cat ~/git/jidesha/chrome/manifest.json
{
  "manifest_version": 2,
  "name": "Jitsi Desktop Streamer",
  "description": "A simple extension that allows you to stream your desktop into meetings with Jitsi Meet and Jitsi Videobridge.",
  "version": "0.1.5",
  "minimum_chrome_version": "34",
  "icons": {
    "16": "jitsi-logo-16x16.png",
    "48": "jitsi-logo-48x48.png",
    "128": "jitsi-logo-128x128.png"
  },
  "background": {
        "scripts": [ "background.js" ],
        "persistent": true
  },
  "permissions": [
      "desktopCapture"
  ],
  "externally_connectable": {
      "matches": [
          "*://jitsi.maas/*",
          "*://*.jitsi.maas/*",
          "*://rocketchat.maas/*",
          "*://*.rocketchat.maas/*"
      ]
  }
}

This produces an extension with the following ID:

pimkghiofgpblmpodaepplbgokkkpche

I have configured Jitsi-meet with the following for the Jidesha extension details (file trimmed for brevity):

$  cat /etc/jitsi/meet/jitsi.maas-config.js
/* jshint -W101 */
var config = {
    hosts: {
        domain: 'jitsi.maas',
       muc: 'conference.jitsi.maas', // FIXME: use XEP-0030
    },
    bosh: '//jitsi.maas/http-bind', // FIXME: use xep-0156 for that
    clientNode: 'http://jitsi.maas/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
    desktopSharingChromeMethod: 'ext',
    desktopSharingChromeExtId: 'pimkghiofgpblmpodaepplbgokkkpche', //Custom Jitsi Chrome Extension
    desktopSharingChromeSources: [ 'screen', 'window'],
    desktopSharingChromeMinExtVersion: '0.1',
    webrtcIceUdpDisable: false,
    webrtcIceTcpDisable: false,
  };

I then ensure that RocketChat has the same ID and the correct address for the Jitsi server rocket_chat_vc_config

Results Trial 1 - Jidesha Chrome Extension Using Chromium in either client01 or client02 I can hit https://jitsi.maas and start a desktop screen share using the Jidesha plugin. Jitsi Meet works just fine when my clients connect to it directly.

When I use Rocketchat however, I get the error message quoted at the top: rocket_chat_vc_failure_2

rocket_chat_vc_failure_1

Looking at Chrome's dev tools, I see the following error message in the Console that I suspect is pertinent: rocket_chat_vc_failure_3

failed to create local tracks ["desktop"]

Results Trial 2 - Using Rocket.Chat Screen Share extension I repeated the above with the ID for Rocket.Chat Screen Sharing: nocfbnnmjnndkbipkabodnheejiegccf

And again got the same result:

rocket_chat_vc_failure_4

Hoping that someone might be able to tell me if I have something wrong in my configs or in my assumptions.

Thanks.

james-mcgoodwin avatar Aug 04 '16 17:08 james-mcgoodwin

The following is sections of log from client01, using the Rocket.Chat Screen Sharing extension, when it fails to start a screen sharing session.

It seems this is an interesting part of the log (full log below):

[/modules/RTC/ScreenObtainer.js] <Object.init>:  Using Chrome extension for desktop sharing
[/modules/RTC/RTCUtils.js] <Object.getUserMediaWithConstraints>:  Get media constraints Object {audio: Object, video: Object}
Obsolete constraint named googLeakyBucket is ignored. Please stop using it.
[/modules/xmpp/xmpp.js] <XMPP.connectionHandler>:  (TIME) Strophe CONNECTING:    1577.7400000000002
[/modules/RTC/ScreenObtainer.js] <>:  Extension not installed?:  Object {message: "Could not establish connection. Receiving end does not exist."}
[/modules/RTC/ScreenObtainer.js] <>:  Chrome extension installed: false updateRequired: false
[/modules/RTC/RTCUtils.js] <>:  Failed to get access to local media. Error  NavigatorUserMediaError {name: "DevicesNotFoundError", message: "", constraintName: ""} Object {audio: Object, video: Object}
failed to create local tracks ["audio", "video"] JitsiTrackError {gum: Object, name: "gum.general", message: "Generic getUserMedia error", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…si.maas/libs/lib-jitsi-meet.min.js?v=1108:7:22296"}

My take away from this is that the RC screen sharing extension is not able to get video from the clients screen.

This client is a virtual machine, running Ubuntu 16.04, and has no camera or microphone.

I get an identical log output when I navigate directly to https://jitsi.maas and use Jitsi-meet directly.

---- Full Log ---

Jitsi Room ID: RocketChat7d07efa2d0421588174904eac0816d61 If from direct message or private group don't share.  Or you will be letting the invitee join any future conversation.
Uncaught TypeError: Cannot read property 'type' of undefined
(TIME) index.html loaded:    152.50000000000003
[/modules/RTC/RTCBrowserType.js] <Array.detectChrome>:  This appears to be Chrome, ver: 51
Failed to parse URL argument SyntaxError: Unexpected token o in JSON at position 1(…)
Failed to parse URL argument SyntaxError: Unexpected token o in JSON at position 1(…)
(TIME) document ready:   1315.1650000000002
[/modules/RTC/ScreenObtainer.js] <Object.init>:  Using Chrome extension for desktop sharing
[/modules/RTC/RTCUtils.js] <Object.getUserMediaWithConstraints>:  Get media constraints Object {audio: Object, video: Object}
Obsolete constraint named googLeakyBucket is ignored. Please stop using it.
[/modules/xmpp/xmpp.js] <XMPP.connectionHandler>:  (TIME) Strophe CONNECTING:    1577.7400000000002
[/modules/RTC/ScreenObtainer.js] <>:  Extension not installed?:  Object {message: "Could not establish connection. Receiving end does not exist."}
[/modules/RTC/ScreenObtainer.js] <>:  Chrome extension installed: false updateRequired: false
[/modules/RTC/RTCUtils.js] <>:  Failed to get access to local media. Error  NavigatorUserMediaError {name: "DevicesNotFoundError", message: "", constraintName: ""} Object {audio: Object, video: Object}
failed to create local tracks ["audio", "video"] JitsiTrackError {gum: Object, name: "gum.general", message: "Generic getUserMedia error", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…si.maas/libs/lib-jitsi-meet.min.js?v=1108:7:22296"}
[/modules/RTC/RTCUtils.js] <Object.getUserMediaWithConstraints>:  Get media constraints Object {audio: Object, video: false}
[/modules/RTC/RTCUtils.js] <>:  Failed to get access to local media. Error  NavigatorUserMediaError {name: "DevicesNotFoundError", message: "", constraintName: ""} Object {audio: Object, video: false}
failed to create local tracks ["audio"] JitsiTrackError {gum: Object, name: "gum.general", message: "Generic getUserMedia error", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…si.maas/libs/lib-jitsi-meet.min.js?v=1108:7:22296"}
[/modules/xmpp/xmpp.js] <XMPP.connectionHandler>:  (TIME) Strophe CONNECTED:     2170.8500000000004
[/modules/xmpp/xmpp.js] <XMPP.connectionHandler>:  My Jabber ID: [email protected]/ae96b0c3-7725-48ae-afc3-b4af52c5ba84
initialized with 0 local tracks
[/modules/xmpp/ChatRoom.js] <new ChatRoom>:  Joined MUC as [email protected]/d76320c9
[/modules/xmpp/moderator.js] <Moderator.setFocusUserJid>:  Focus jid set to:  undefined
[/modules/xmpp/moderator.js] <Moderator.createConferenceIq>:  Session ID: null machine UID: 6b1f2d6f08c5b09ca189dc025b7fbf82
[/modules/xmpp/strophe.ping.js] <Object.startInterval>:  XMPP pings will be sent every 10000 ms
[/modules/xmpp/moderator.js] <Moderator.setFocusUserJid>:  Focus jid set to:  [email protected]
[/modules/xmpp/moderator.js] <Moderator.parseConfigOptions>:  Authentication enabled: false
[/modules/xmpp/moderator.js] <Moderator.parseConfigOptions>:  External authentication enabled: false
[/modules/xmpp/moderator.js] <Moderator.parseConfigOptions>:  Sip gateway enabled:  false
[/modules/xmpp/ChatRoom.js] <ChatRoom.onPresence>:  entered [email protected]/focus Object {show: "", status: "", affiliation: "owner", role: "moderator", jid: "[email protected]/focus10210363939"…}
[/modules/xmpp/ChatRoom.js] <ChatRoom._initFocus>:  Ignore focus: [email protected]/focus, real JID: [email protected]/focus10210363939
[/modules/version/ComponentsVersions.js] <ComponentsVersions.<anonymous>>:  Got xmpp version: Prosody(0.9.10,Linux)
[/modules/version/ComponentsVersions.js] <ComponentsVersions.<anonymous>>:  Got focus version: JiCoFo(1.0.1.0-273,Linux)
My role changed, new role: none
[/modules/xmpp/ChatRoom.js] <ChatRoom.onPresence>:  (TIME) MUC joined:   2342.36
hover in d76320c9
No avatar stored yet for d76320c9 - using ID as avatar ID
No avatar stored yet for d76320c9 - using ID as avatar ID
No avatar stored yet for d76320c9 - using ID as avatar ID
My role changed, new role: moderator
[/modules/RTC/ScreenObtainer.js] <handleExtensionInstallationError>:  Failed to install the extension from https://chrome.google.com/webstore/detail/nocfbnnmjnndkbipkabodnheejiegccf Chrome Web Store installations can only be started by the top frame.
failed to create local tracks ["desktop"] JitsiTrackError {name: "gum.chrome_extension_installation_error", message: "Failed to install the extension from https://chrom…/webstore/detail/nocfbnnmjnndkbipkabodnheejiegccf", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…jitsi.maas/libs/app.bundle.min.js?v=1108:29:6125)"}
[/modules/RTC/RTCUtils.js] <Object.getUserMediaWithConstraints>:  Get media constraints Object {audio: false, video: Object}
Obsolete constraint named googLeakyBucket is ignored. Please stop using it.
failed to share local desktop JitsiTrackError {name: "gum.chrome_extension_installation_error", message: "Failed to install the extension from https://chrom…/webstore/detail/nocfbnnmjnndkbipkabodnheejiegccf", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…jitsi.maas/libs/app.bundle.min.js?v=1108:29:6125)"}
[/modules/RTC/RTCUtils.js] <>:  Failed to get access to local media. Error  NavigatorUserMediaError {name: "DevicesNotFoundError", message: "", constraintName: ""} Object {audio: false, video: Object}
failed to create local tracks ["video"] JitsiTrackError {gum: Object, name: "gum.general", message: "Generic getUserMedia error", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…si.maas/libs/lib-jitsi-meet.min.js?v=1108:7:22296"}
failed to share local video JitsiTrackError {gum: Object, name: "gum.general", message: "Generic getUserMedia error", stack: "Error↵    at new JitsiTrackError (https://jitsi.ma…si.maas/libs/lib-jitsi-meet.min.js?v=1108:7:22296"}

james-mcgoodwin avatar Aug 04 '16 20:08 james-mcgoodwin

Me too on this

tastle73 avatar Aug 11 '16 14:08 tastle73

I get this annoying permission denied error in the native app. The app should come with all the permissions needed.

rockneverdies55 avatar Aug 11 '16 18:08 rockneverdies55

@rockneverdies55 Here's my interpretation of the above:

I have setup my own Jitsi backend along with my own RocketChat back end.

Neither one are simple deployments, and each has dependency on a number of other third party projects.

I don't believe what I'm encountering is a permissions problem. I believe my issue is a miss-alignment of some kind between how the Rocketchat daemon over on the RC server communicates with my clients, and/or, how it handles the webrtc streams for Jitsi.

This could be more a configuration or source-code sort of issue, not actually a permissions issue in the strict sense of file modes or chrome browser restrictions.

That said, I'm in the dark here. I've spent the last week refactoring and making the Jitsi Videobridge rig something I can access directly from the internet. And satisfying a requirement that 100% of all Jitsi traffic go over 443/TCP (No UDP, no 4443 high-ports required).

So who's to say, it could be something very simple and I missed it on my first run though of setting all this up.

I haven't gotten a chance to dig back into the integration between RocketChat and Jitsi. That's next. After finishing a 443/TCP exclusive Jitsi setup.

I had hoped the above technical assessment would pique a RC support agent to tell me if my fundamental assumptions were true or not. But it's possible they are still digesting the diagnostic I provided.

In other words I'm not sure this is something directly overlooked on the RocketChat team's part. It doesn't feel as simple as a blatant permissions oversight in the strict sense I stated above.

I feel like the issue I'm hitting with my architecture/deployment is either rather esoteric and related to source code, OR it's something idiotic that //I// have missed which is very very likely given the complex interrelations between all the moving parts in RocketChat and Jitsi.

And well, the third option is that the Jitsi platform has shifted beneath their feet! If something changed in some place inside jitsi-videobridge project, and the RocketChat guys weren't aware or are currently regression-testing a patch for the jitsi change, well that would explain why we're having this trouble. This is all bleeding edge software we're working with.

All of that is to say it's complicated, and I'm hoping my question helps RC identify for all of us how to fix the roadblock in my situation. ((*Note that my environment may not be how you set yours up;) Your mileage may vary here!))

james-mcgoodwin avatar Aug 11 '16 20:08 james-mcgoodwin

As you guys can see from the behavior here. We're passing the chrome extension id stuff to it, and it gets as far as letting you select a source. Something on the jitsi side is failing when the extension passes the desktop stream.

The error it throws is a bit misleading... as the extension is for sure installed, otherwise you wouldn't have been prompted to select what you wanted to share.

I'm still digging... I know its failing here: https://github.com/jitsi/jitsi-meet/blob/master/conference.js#L926 Digging into the code executing there to see what I can find.

geekgonecrazy avatar Aug 17 '16 18:08 geekgonecrazy

any update on the desktop top sharing with voice enabled????

IQ2022 avatar Sep 01 '16 22:09 IQ2022

bump... would love this killer feature to work! Have intermittent 'permission denied' errors on chrome / firefox / safari (OSX 10.11.6) trying to share desktop. When it works, it works really well 👍

phrag avatar Sep 06 '16 14:09 phrag

@geekgonecrazy - it might make sense to take jitsi guys's opinion on this.

rockneverdies55 avatar Sep 06 '16 17:09 rockneverdies55

@isymchych can you provide any context to https://github.com/RocketChat/Rocket.Chat/issues/3919#issuecomment-240501898?

kevincolten avatar Sep 06 '16 19:09 kevincolten

@geekgonecrazy - do you think creating an issue in jitsi-meet project and asking the project collaborators for their help and opinions would be useful?

rockneverdies55 avatar Oct 04 '16 16:10 rockneverdies55

@rockneverdies55 yeah sorry I had some emails out and was communicating with them directly. But yes we for sure needed their expertise.

@james-mcgoodwin I didn't say earlier.. but thanks a ton for the detailed breakdown! We usually don't get near that level of detail. You pretty much summarized every piece of the puzzle perfectly! Off-Topic question, are you using Ubuntu MaaS or is that a tld choice of your own?

A quick update for everyone: I just heard back from the Jitsi Meet team. They have found the problem and are working on a solution. Stay tuned 👍

geekgonecrazy avatar Oct 05 '16 02:10 geekgonecrazy

That's great news @geekgonecrazy, I'm glad the Jitsi Meet team was able to find something based off the information in my ticket. And with regard to the detail, you're very welcome. I understand the pain of tracking down a needle in a haystack with too little information. I'm happy it was useful...and it was kinda fun to write. Just the writing helped me explore other (ultimately unsuccessful) avenues that I only thought to try as I was drafting the ticket. I truly hate asking for help with these things when it's something that just a little more elbow-grease on my part could have fixed.

In this case it does sound like the issue was source-code related, and I really sincerely appreciate the help of yourself and the Jitsi team here!

Off-topic, yes! Our lab environment is an Ubuntu MaaS setup that we've deployed OpenStack to. So you're definitely right about the tld of the hostnames;)

Thanks again!

james-mcgoodwin avatar Oct 05 '16 15:10 james-mcgoodwin

Exactly, great news... Thank you @geekgonecrazy! Is there any issue or something where we can watch the progress on the jitsi side?

rockneverdies55 avatar Oct 05 '16 15:10 rockneverdies55

@james-mcgoodwin

Off-topic, yes! Our lab environment is an Ubuntu MaaS setup that we've deployed OpenStack to. So you're definitely right about the tld of the hostnames;)

Really cool! I've been looking into MaaS paired with Juju. Looks like a really good solution.

@rockneverdies55 I'm not aware of one. I'll for sure follow up here as soon as I get word of the fix being released.

geekgonecrazy avatar Oct 05 '16 15:10 geekgonecrazy

Alright guys this is now resolved! Much thanks to the Jitsi guys!

geekgonecrazy avatar Oct 07 '16 16:10 geekgonecrazy

Great. But how to get the fix? I still get the same popup at the moment...

rockneverdies55 avatar Oct 07 '16 16:10 rockneverdies55

@geekgonecrazy I see it, too. And to clarify I do not see "Screen Chooser" popup, neither. Are there any steps to activate the fix on our side?

kevincolten avatar Oct 07 '16 16:10 kevincolten

If you are running your own version of jitsi meet you will need to update that installation. If you are using meet.jit.si the fix requires no action.

If it doesn't prompt you to install the extension: Chrome - https://chrome.google.com/webstore/detail/jitsi-desktop-streamer/diibjkoicjeejcmhdnailmkgecihlobk Firefox - https://addons.mozilla.org/en-us/firefox/addon/jitsi-desktop-streamer/

geekgonecrazy avatar Oct 07 '16 16:10 geekgonecrazy

Oh yeah! Now Installed the plugin manually and it started to work. Beautiful!.. :-)

Though it didn't prompt for the plugin installation earlier...

rockneverdies55 avatar Oct 07 '16 16:10 rockneverdies55

They re-did some stuff and apparently removed the prompt... So it looks like we may have to add something in on our side to help get people hooked up.

geekgonecrazy avatar Oct 07 '16 16:10 geekgonecrazy