blindsidenetworks / scalelite

Scalable load balancer for BigBlueButton.
GNU Affero General Public License v3.0
469 stars 247 forks source link

undefined local variable or method `fetch_secrets' for RecordingReadyNotifierService:Class #971

Closed Tecumtha closed 1 year ago

Tecumtha commented 1 year ago

Setup:

Nginx Loadbalancer <--> Scalelite 1.5.1 <--> BBB 2.6.9 Greenlight 3.0.2

Loadbalancer:

Nginx Configuration for Greenlight:

location /cable {
    proxy_pass http://xxxxx:xxxxx;
    proxy_redirect off;
    proxy_http_version 1.1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header Connection "upgrade";
    proxy_set_header Upgrade $http_upgrade;
}

  location / {
    root   /var/www/bigbluebutton-default/assets;
    try_files $uri @bbb-fe;
  }

location @bbb-fe {
    proxy_pass http://xxxxx:xxxxx;
    proxy_redirect off;
    proxy_http_version 1.1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Connection "";
}
location ~ '/api/v1/rooms/\w{3}-\w{3}-\w{3}-\w{3}.json$' {
    proxy_pass http://xxxxx:xxxxx;
    proxy_redirect off;
    proxy_http_version 1.1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Connection "";

    client_max_body_size 31m;
}
location ~ '/api/v1/users/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}.json$' {
    proxy_pass http://xxxxx:xxxxx;
    proxy_redirect off;
    proxy_http_version 1.1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Connection "";

    client_max_body_size 4m;
}

location ~ /api/v1/admin/site_settings/BrandingImage.json$ {
    proxy_pass http://xxxxx:xxxxx;
    proxy_redirect off;
    proxy_http_version 1.1;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Connection "";

    client_max_body_size 4m;
}

Nginx Configuration for Scalelite:

 location /bigbluebutton/api/ {
        proxy_pass  http://xxxxxxx:xxxxx;

        proxy_read_timeout 60s;
        proxy_redirect off;

        proxy_set_header  Host $http_host;

        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header  X-Forwarded-Proto $scheme;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

location / {
        proxy_pass  http://xxxxx:xxxxx;

        proxy_read_timeout 60s;
        proxy_redirect off;

        proxy_set_header  Host $http_host;

        proxy_set_header  X-Real-IP $remote_addr;
        proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;

        proxy_set_header  X-Forwarded-Proto $scheme;

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

location /static-resource {
  alias /xxxxxxxxxxxxxxxxxxxxxxx/published;
  index index.html index.htm;
  internal;
}

scalelite .env:

URL_HOST=xxxxxx.xx.de
SECRET_KEY_BASE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
LOADBALANCER_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
DEFAULT_LOCALE=de
TZ=Europe/Berlin
RECORDING_DISABLED=false
RAILS_LOG_TO_STDOUT=true
RAILS_LOG_LEVEL=debug
SERVER_ID_IS_HOSTNAME=true
DATABASE_URL=postgres://xxxxx:xxxxx@xxxx:5434/xxxxx
REDIS_URL=redis://redis:@xxxxx:xx
MULTITENANCY_ENABLED=true

Tenants Configuration:

bash-5.1$ bin/rake tenants

id: ff2f56b0-2dca-4b5a-a51f-cde92597094c
        name: john
        secrets: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
id: 846ae720-2ef8-41ff-be91-cfb08d99da4c
        name: jane
        secrets: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
id: ba8f7f1f-1b6d-49a5-aacc-3e6062148d12
        name: doe
        secrets: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Total number of tenants: 3

Deployment:

Scalelite and Greenlight over docker-compose BBB over bbb-install-2.6.sh

Versions: blindsidenetwks/scalelite:v1.5.1-poller blindsidenetwks/scalelite:v1.5.1-recording-importer blindsidenetwks/scalelite:v1.5.1-api BBB: 2.6.9


I use MULTITENANCY and have two Problem.

I don't know if they belong together...

so , first Problem:

I got a Error Message in scalelite-recording-importer:

I, [2023-06-26T16:56:32.992827 #6] INFO -- : Recording Ready Notify for [pojgadv22vrnncc6x8qpyyfftezxszdfntvkrdn2] starts I, [2023-06-26T16:56:32.993154 #6] INFO -- : Making callback for recording ready notification I, [2023-06-26T16:56:32.993465 #6] INFO -- : Rescued I, [2023-06-26T16:56:32.996568 #6] INFO -- : undefined local variable or method `fetch_secrets' for RecordingReadyNotifierService:Class secret = fetch_secrets[0] ^^^^^^^^^^^^^

I think he can´t find the secret of a the tenant...

i Found some Code in app/controllers/concerns/api_helper.rb and app/services/recording_ready_notifier_service.rb

but I'm not sure what exactly is happening in the code

The Second Problem:

I don't know if the first problem is the cause of the second or something completely unrelated.

If I start a recording, everything works as expected, then at some point the error message from the first problem comes up and Greenlight is showing permanently "Processing recording, this may take several minutes..."

I found some info about it here, like "bin/rake server_recordings_sync"

But that only partially solves it, because then the recording can be seen, but the first line still says "Processing recording, this may take several minutes...".

farhatahmad commented 1 year ago

Yep can confirm the RecordingReadyNotifierService fails when multi-tenancy is enabled. Will work on a patch