bigbluebutton / greenlight

A really simple end-user interface for your BigBlueButton server.
GNU Lesser General Public License v3.0
796 stars 3.79k forks source link

SOLVED: Waiting user is not pushed to conference when conference room is opened in scalelite environment #2922

Closed Uffi64 closed 2 years ago

Uffi64 commented 3 years ago

My Installation

Versions

Portalserver Docker-Container

Here you can find a grafical overview: pictured overview

The whole installation works well and is in use. Balancing by scalelite, BBB-Sessions, screensharing, turnserver, breakout-rooms, chats - works everything as a charm.

The situation If an invited user clicks his link when conference hasn't started he finds himself in the waiting room.

Expected behaviour When the conference room is opened the user should be pushed automatically into the confernece.

Problem The waiting user waits eternally to be forwarded. The only way for him to join the conference is to click the invitation link once again.

As far as I know the following configuration of scalelite-nginx is responsible here:

location ~ ^/(b$|b/) {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_http_version  1.1;
}

location /bigbluebutton/api {
  proxy_pass          http://scalelite-api:3000;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_http_version  1.1;
}

location /b/cable {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_set_header    Upgrade           $http_upgrade;
  proxy_set_header    Connection        "Upgrade";
  proxy_http_version  1.1;
  proxy_read_timeout  6h;
  proxy_send_timeout  6h;
  client_body_timeout 6h;
  send_timeout        6h;
}

I tried the following variants already but without any success. [1] X-Forwarded-Proto removed

location /b/cable {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    Upgrade           $http_upgrade;
  proxy_set_header    Connection        "Upgrade";
  proxy_http_version  1.1;
  proxy_read_timeout  6h;
  proxy_send_timeout  6h;
  client_body_timeout 6h;
  send_timeout        6h;
}

[2] location modified

location ~ ^/b/cable$ {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_set_header    Upgrade           $http_upgrade;
  proxy_set_header    Connection        "Upgrade";
  proxy_set_header    X-Forwarded-Ssl on;
  proxy_http_version  1.1;
  proxy_read_timeout  6h;
  proxy_send_timeout  6h;
  client_body_timeout 6h;
  send_timeout        6h;
}

[3] X-Forwardes-Ssl added

location /b/cable {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_set_header    Upgrade           $http_upgrade;
  proxy_set_header    Connection        "Upgrade";
  proxy_set_header    X-Forwarded-Ssl on;
  proxy_http_version  1.1;
  proxy_read_timeout  6h;
  proxy_send_timeout  6h;
  client_body_timeout 6h;
  send_timeout        6h;
}

My greenlight .env - file

SECRET_KEY_BASE=<--- my secret key base --->
BIGBLUEBUTTON_ENDPOINT=https://my.domain.de/bigbluebutton/api/
BIGBLUEBUTTON_SECRET=<--- my scalelite bigbluebutton secret --->
SAFE_HOSTS=my.domain.de
ALLOW_GREENLIGHT_ACCOUNTS=true
SMTP_SERVER=my.mailserver.de
SMTP_PORT=587
SMTP_DOMAIN=domain.de
SMTP_USERNAME=smtpuser@domain.de
SMTP_PASSWORD=smtpuserpassword
SMTP_AUTH=plain
SMTP_STARTTLS_AUTO=true
SMTP_SENDER=me@domain.de
SMTP_TEST_RECIPIENT=test@domain.de
RELATIVE_URL_ROOT=/b
ROOM_FEATURES=mute-on-join,require-moderator-approval,anyone-can-start,all-join-moderator,recording
PAGINATION_NUMBER=25
NUMBER_OF_ROWS=25
MAINTENANCE_MODE=false
HELP_URL=https://docs.bigbluebutton.org/greenlight/gl-overview.html
ENABLE_SSL=true
DB_ADAPTER=postgresql
DB_HOST=db
DB_PORT=5432
DB_NAME=greenlight_production
DB_USERNAME=postgres
DB_PASSWORD=secret-db-password
CABLE_ADAPTER=postgresql
DEFAULT_REGISTRATION=open
WEB_CONCURRENCY=3

my greenlight docker-compose.yaml

version: '3'
networks:
  mygreenlight:
    ipam:
      config:
        - subnet: 172.23.0.0/16
services:
  app:
    entrypoint: [bin/start]
    image: custom-greenlight
    container_name: greenlight-v2
    env_file: .env
    restart: unless-stopped
    ports:
      - 127.0.0.1:5000:80
    networks:
      mygreenlight:
        ipv4_address: 172.23.0.3
    volumes:
      - ./log:/usr/src/app/log
      - ./storage:/usr/src/app/storage
    links:
      - db
  db:
    image: postgres:9.5
    restart: unless-stopped
    ports:
      - 127.0.0.1:5432:5432
    networks:
      mygreenlight:
        ipv4_address: 172.23.0.4
    volumes:
      - ./db/production:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=postgres
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=secret-db-password

On 2 other installations without scalelite where greenlight is on the same server as bbb things are working well.

Any hint to resolve this issue would be highly appreciated. Thanks to all.

farhatahmad commented 3 years ago

Do you have any errors in your browser console for the waiting user after the meeting has started?

Uffi64 commented 3 years ago

@farhatahmad No, not at all. The wating room page stays as if still waiting.

mk-hs commented 3 years ago

Perhaps you can check again, I'm pretty sure the wss cable connection is failing at the beginning, so the client doesn't get the info to join the session once it's started. This error should show up in the console upon opening the page. I've run into this error myself as well, the only thing that did help was fiddling with around with the nginx config until the cable connection finally worked. Unfortunately, I'm not sure what exactly did help, perhaps it's a formatting error.

Uffi64 commented 3 years ago

@mk-hs Thank you for your interest in my problem. You write This error should show up in the console upon opening the page Can you explain to mes what you mean by that? On which console and at what point of time? best regards

mk-hs commented 3 years ago

It should show up in your browser's console (press f12) as an error after entering your name and joining a (not yet started) session. If the cable connection is working, "connected" should show up, otherwise there should be a wss error.

Uffi64 commented 3 years ago

@mk-hs Thanks for the answer. In fact I get an error here:

GETwss://my.domain.de/b/cable
[HTTP/1.1 404 Not Found 239ms]

GET
    wss://my.domain.de/b/cable
Status
404
Not Found
VersionHTTP/1.1
Übertragen318 B (0 B Größe)

    HTTP/1.1 404 Not Found
    Server: nginx
    Date: Tue, 19 Oct 2021 09:44:23 GMT
    Content-Type: text/plain
    Transfer-Encoding: chunked
    Connection: keep-alive
    Cache-Control: no-cache
    X-Request-Id: 327a0d0c-cf79-40d0-be0f-b16d1ffe33b9
    X-Runtime: 0.000559
    Strict-Transport-Security: max-age=31536000; includeSubDomains      
    GET /b/cable HTTP/1.1
    Host: my.domain.de
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:92.0) Gecko/20100101 Firefox/92.0
    Accept: */*
    Accept-Language: de,en-US;q=0.7,en;q=0.3
    Accept-Encoding: gzip, deflate, br
    Sec-WebSocket-Version: 13
    Origin: https://my.domain.de
    Sec-WebSocket-Protocol: actioncable-v1-json, actioncable-unsupported
    Sec-WebSocket-Extensions: permessage-deflate
    Sec-WebSocket-Key: PdzQLiwk/NiCv1RFeG9cQw==
    Connection: keep-alive, Upgrade

    Cookie: _greenlight-2_3_session=wNNbqI0RswZEJh6yJsHNTyK9yrzkSMlbKoCvJZhRETEY4oJhImkNNeDKb8xEpVpCeXNqWmha8T0LzGNpgV0C7oTZZfastrBBdxDlpRjBLysQ0Et6vAuFlhszfF6VrrFer%2FbNTiAs%3D--%2BnCVFPDGAxWx2LjE--SgwQsVH5u%2FbuoFbq%2F3Q%3D%3D; greenlight_name=TTBsSE%2By--gfXtMjmYA5JjKd%2Bi--2VResPrJVKKC%2FyxOlxw%3D%3D; cookie_consented=true
    Sec-Fetch-Dest: websocket
    Sec-Fetch-Mode: websocket
    Sec-Fetch-Site: same-origin
    Pragma: no-cache
    Cache-Control: no-cache
    Upgrade: websocket

The Nginx config looks like this.

location ~ ^/b/cable$ {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_set_header    Upgrade           $http_upgrade;
  proxy_set_header    Connection        "Upgrade";
  proxy_set_header    X-Forwarded-Ssl on;
  proxy_http_version  1.1;
  proxy_read_timeout  6h;
  proxy_send_timeout  6h;
  client_body_timeout 6h;
  send_timeout        6h;
}

Right now I have no idea where the problem is... :-(

mk-hs commented 3 years ago

location ~ ^/b/cable$ { is producing the same error for me, but location = ^/b/cable$ { is working fine, perhaps this is the case for you as well.

Uffi64 commented 3 years ago

@mk-hs Finally I got it!! Seems, that

location ~ ^/(b$|b/) {
  proxy_pass          http://172.23.0.3:80;
  proxy_set_header    Host              $host;
  proxy_set_header    X-Forwarded-For   $proxy_add_x_forwarded_for;
  proxy_set_header    X-Forwarded-Proto $scheme;
  proxy_http_version  1.1;
}

also matches the /b/cable

So I transferred the /b/cable configuration in front of the ^/(b$|b/) configuratation for it is more specific.

Now it looks like this:

location ~ ^/b/cable$ {
  proxy_pass          http://172.23.0.3:80;
  proxy_s...
}
location ~ ^/(b$|b/) {
  proxy_pass          http://172.23.0.3:80;
  proxy_s...
}

And with this order the /b/cable works as expected.

Thank you very much for your help. You pushed me to look again and again.

dannyplace commented 2 years ago

Hi, where is the configuration located that I should edit. I am facing the same problem.

Uffi64 commented 2 years ago

At my installation the config file is here:

/etc/bigbluebutton/nginx/greenlight.nginx

dannyplace commented 2 years ago

Thnx, I see my problem could be the fact I am using Traefik as Reverse Proxy so I have to figure out how to fix this.