causefx / Organizr

HTPC/Homelab Services Organizer - Written in PHP
GNU General Public License v3.0
5.1k stars 289 forks source link

Multiple Tautulli Instances SSO Issue #1226

Closed vcantrell closed 5 years ago

vcantrell commented 5 years ago
Organizr Version: 2.0.270
Branch: Master
WebServer: Nginx for Reverse Proxy, Apache for Web
Operating System: Ubuntu

Problem Description:

Running 3 Tautulli instances causes OAuth login to fail to Organizr. Logs show "Tautulli Token Function - Error: [http://127.0.0.1:8381/t3]cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received [Execution Time: 20.69s | 20695.9ms]"

Confirmed Tautulli SSO works reliably with only 1 Tautulli instance, tested with all 3 instances separately one by one, but when all 3 are enabled, usually a random one of them (sometimes two) show the token fail log entry in Organizr settings. Tautulli logs show they return the token successfully for all 3 instances every time. If only two of the three are enabled for SSO, Organizr OAuth login will work roughly 50% of the time, the other 50%, Plex OAuth login to Organizr fails with an API Connection Error. With all 3 enabled, Plex OAuth login to Organizr fails every time.

Tested setting up 3 new Tautulli instances on the same Ubuntu host as Organizr from scratch and enabling them for SSO and the same issue occurs.

Noted as well that even with 1 enabled login time is increased significantly. It seems like whenever Tautulli is enabled it holds the Plex OAuth login process until it successfully gets tokens from Tautulli, which does seem to take longer than it should. It might be that Tautulli is slow to respond because each of my instances has to search through 80 users, but Tautulli logs always show that it successfully returns the token.


Reproduction Steps:
  1. Setup 3 tautulli instances.
  2. Enable all 3 instances for Plex OAuth and guest access.
  3. Enter 3 Tautulli URLs in Organizr SSO Tautulli section.
  4. Attempt Plex OAuth login to Organizr.

Errors on screen? If so paste here:

Organizr Login Screen Error: "API Connection Error"

From Organizr Logs: "Tautulli Token Function - Error: [http://127.0.0.1:8381/t3]cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received [Execution Time: 20.69s | 20695.9ms]"
angrycuban13 commented 5 years ago

How are you running Tautulli that you need 3 instances because it is too slow? Curious that's all.

Roxedus commented 5 years ago

Does each Tautulli instance have its own Plex admin?

causefx commented 5 years ago

You can manually trying upping the timeout on functions.js from 20000, to something higher than the 20 seconds. i will eventually move it to 60 seconds.

Sent from my iPhone

On Aug 4, 2019, at 11:31 AM, vcantrell notifications@github.com wrote:

Organizr Version: 2.0.270

Branch: Master

WebServer: Nginx for Reverse Proxy, Apache for Web

Operating System: Ubuntu

Problem Description:

Running 3 Tautulli instances causes OAuth login to fail to Organizr. Logs show "Tautulli Token Function - Error: [http://127.0.0.1:8381/t3]cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received [Execution Time: 20.69s | 20695.9ms]"

Confirmed Tautulli SSO works reliably with only 1 Tautulli instance, tested with all 3 instances separately one by one, but when all 3 are enabled, usually a random one of them (sometimes two) show the token fail log entry in Organizr settings. Tautulli logs show they return the token successfully for all 3 instances every time. If only two of the three are enabled for SSO, Organizr OAuth login will work roughly 50% of the time, the other 50%, Plex OAuth login to Organizr fails with an API Connection Error. With all 3 enabled, Plex OAuth login to Organizr fails every time.

Tested setting up 3 new Tautulli instances on the same Ubuntu host as Organizr from scratch and enabling them for SSO and the same issue occurs.

Noted as well that even with 1 enabled login time is increased significantly. It seems like whenever Tautulli is enabled it holds the Plex OAuth login process until it successfully gets tokens from Tautulli, which does seem to take longer than it should. It might be that Tautulli is slow to respond because each of my instances has to search through 80 users, but Tautulli logs always show that it successfully returns the token.

Reproduction Steps:

Setup 3 tautulli instances. Enable all 3 instances for Plex OAuth and guest access. Enter 3 Tautulli URLs in Organizr SSO Tautulli section. Attempt Plex OAuth login to Organizr. Errors on screen? If so paste here:

Organizr Login Screen Error: "API Connection Error"

From Organizr Logs: "Tautulli Token Function - Error: [http://127.0.0.1:8381/t3]cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received [Execution Time: 20.69s | 20695.9ms]" — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

causefx commented 5 years ago

fixed on 3b32e71