Plex Media Server Manager Plugin - Beta

Posted on
Fri Sep 18, 2015 7:37 pm
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager-2.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkPlugin.py

You seem to have two versions of the plugin, or did at some point... this won't work -- you can only have one version and it must be named Plex Media Server Manager (in your example above you have a -2 in the name).

Adam

Posted on
Fri Dec 11, 2015 1:09 pm
marketability offline
User avatar
Posts: 198
Joined: Dec 08, 2015
Location: UK

Re: Plex Media Server Manager Plugin - Beta

I'm running plex server in a separate house and I can't seem to get the plugin to accept a dynamic, xxx.dyn-o-saur.com address - is the plugin designed to work only with Plex and Indigo on the same network?
Thanks for any help

Posted on
Tue Dec 15, 2015 8:34 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

I'm running plex server in a separate house and I can't seem to get the plugin to accept a dynamic, xxx.dyn-o-saur.com address - is the plugin designed to work only with Plex and Indigo on the same network?
Thanks for any help

Hmm, as long as the ports are open, the Plex machine authenticated (signed in to Plex), and the proper ports open then I don't see why it wouldn't work. You would need authentication turned on for the server and the username/password entered, of course, being not on the same subnet.

Might try turning on debugging and restarting the plugin and we can see where the issue is occurring...

Posted on
Wed Dec 16, 2015 1:06 am
marketability offline
User avatar
Posts: 198
Joined: Dec 08, 2015
Location: UK

Re: Plex Media Server Manager Plugin - Beta

Hi - I turned on debugging but it didn't seem to capture any log entries for the attempt to use the dynamic dns form of address (xxx.dyn-o-saur.com). If I use the IP equivalent the server device is created successfully but doesn't retrieve any clients or connect.
Having said that I can't use the flex web client using the IP address either so maybe i have a network issue - will do some digging

Posted on
Wed Dec 16, 2015 9:31 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

Hi - I turned on debugging but it didn't seem to capture any log entries for the attempt to use the dynamic dns form of address (xxx.dyn-o-saur.com). If I use the IP equivalent the server device is created successfully but doesn't retrieve any clients or connect.
Having said that I can't use the flex web client using the IP address either so maybe i have a network issue - will do some digging

You may have to turn up the debug level to High to fully capture the events and failures - can do that and reset the plugin to have it check for an updated status from the server. Can you connect to the web client at all from the Indigo server machine (you mentioned cannot from IP, but be sure to check on the Indigo machine since there is where the connection will originate).

Posted on
Sat Apr 02, 2016 5:29 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Plex Media Server Manager Plugin - Beta

Hey Adam - wanted to alert you to an experience I woke up to this morning. My Plex Server was offline (ostensibly because I rebooted my Drobo last night...need to figure that out) but I wasn't aware until this morning when I woke up to this every 20 seconds (for 8 hours of log; not sure why the message always pops twice):
Code: Select all
  Plex Media Server Manager Error An error occurred executing the GET/PUT request (Device: 512050850): ('Connection aborted.', error(61, 'Connection refused'))
  Plex Media Server Manager Error Turn on debugging to get additional error details.
  Plex Media Server Manager Error An error occurred executing the GET/PUT request (Device: 512050850): ('Connection aborted.', error(61, 'Connection refused'))
  Plex Media Server Manager Error Turn on debugging to get additional error details.

As a part of trying to figure out what was going on, I turned on debug and got this:
Code: Select all
  Plex Media Server Manager Debug Command queue has 1 command(s) waiting
  Plex Media Server Manager Debug Processing GET operation: https|*|/status/sessions|*|basic|*|USERNAME|*|PASSWORD
  Plex Media Server Manager Debug Added authentication token to request
  Plex Media Server Manager Debug Using login credentials... Username=> USERNAME; Password=>10 characters long
  Plex Media Server Manager Error An error occurred executing the GET/PUT request (Device: 512050850): ('Connection aborted.', error(61, 'Connection refused'))
  Plex Media Server Manager Error Error in plugin execution:

Traceback (most recent call last):
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/RPFrameworkRESTfulDevice.py", line 236, in concurrentCommandProcessingThread
    responseObj = requests.get(fullGetUrl, auth=authenticationParam, headers=customHeaders, verify=False)
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/requests/api.py", line 69, in get
    return request('get', url, params=params, **kwargs)
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/requests/api.py", line 50, in request
    response = session.request(method=method, url=url, **kwargs)
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/requests/sessions.py", line 469, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/requests/sessions.py", line 577, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Application Support/Perceptive Automation/Indigo 6/Plugins/Plex Media Server Manager.indigoPlugin/Contents/Server Plugin/RPFramework/requests/adapters.py", line 413, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(61, 'Connection refused'))

So two recommendations:
1) Add a trap for "ConnectionError", and
2) Have the "connection refused" message display at a frequency lower than the server poll rate. I'd even prefer an email once option--"Hey, your server's offline."

Thanks as always for the plugin!
Dave

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 02, 2016 9:30 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

So two recommendations:
1) Add a trap for "ConnectionError", and
2) Have the "connection refused" message display at a frequency lower than the server poll rate. I'd even prefer an email once option--"Hey, your server's offline."

Well, the error is trapped which is why you only see the details when debug is on, but I think you do raise a valid point with there being no need to notify of every attempt... I'll think about how to do that, though, since you WOULD want it to report on failures outside of the status poll (since it would likely indicate a command failed). I like the idea of an event or notification or something for when it thinks the server is unavailable. Maybe a "Server Offline" event that is fired after it can't reach for XY number of tries/minutes or something? Then as an Indigo user you could take whatever action you wanted - email, push notification, etc.

My plugins that have a persistent connection (i.e. network sockets or serial connection) use a scheme where they back off the reconnection attempt, so they already won't throw errors every 20s for 8 hours... so I like the idea for the http API devices. Thanks for the suggestion!

(<durosity_voice>BTW, I'll expect a patch from you to solve this by tomorrow morning. thanks.</durosity_voice>)

Posted on
Sat Apr 02, 2016 10:30 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Plex Media Server Manager Plugin - Beta

RogueProeliator wrote:
(<durosity_voice>BTW, I'll expect a patch from you to solve this by tomorrow morning. thanks.</durosity_voice>)

I would, but

<durosity_voice>Been down to the pub, and would probably cock it up.</durosity_voice>

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sat Apr 02, 2016 11:32 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Plex Media Server Manager Plugin - Beta

Hey, my voice is trademarked and copyrighted! Royalties are charged at £100 per word. Also I don't drink much, so quit with the excuses and fix it!

Computer says no.

Posted on
Thu Apr 21, 2016 11:26 pm
srkinard offline
Posts: 320
Joined: Apr 10, 2016
Location: Austin, Texas

Re: Plex Media Server Manager Plugin - Beta

Just updated Indigo to 6.1.8 and now the log is filling up with these:
Code: Select all
Starting plugin "Plex Media Server Manager 1.0.17" (pid 40961)
  Started plugin "Plex Media Server Manager 1.0.17"
  Plex Media Server Manager       Your plugin version, v1.0.17, is current.
  Plex Media Server Manager       Starting new HTTPS connection (1): plex.tv
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10
  Plex Media Server Manager       Starting new HTTPS connection (1): 192.168.100.10


I reloaded the plugin and copied the log entries from that startup point...what you see was less than 10 seconds time.

Posted on
Fri Apr 22, 2016 8:22 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

There are reports of that logging occurring over nearly every plugin creating HTTP connections, so I suspect this is an Indigo buglet. Once we hear word from Matt/Jay then the plugin authors can adjust if it is something we need to do differently on the new version. But since we were not informed of any major pending changes, I imagine this was a mistake on their part.

Adam

Posted on
Fri Apr 22, 2016 8:45 am
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plex Media Server Manager Plugin - Beta

Adam, are you using a python logger (via logging.getLogger)?

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Apr 22, 2016 8:50 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

Adam, are you using a python logger (via logging.getLogger)?

Negative, the only logging that I am doing is via the standard Indigo logging... HOWEVER, those HTTP connections are being made via calls into the 'requests' library if that is a clue.

EDIT: A quick search of the 'requests' source shows some references to the logging.getLogger call that you referenced; so I guess in a roundabout way the plugin is using that.

Adam

Posted on
Fri Apr 22, 2016 9:41 am
jay (support) offline
Site Admin
User avatar
Posts: 18219
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plex Media Server Manager Plugin - Beta

Yes, that's the problem. I'm trying to figure out a way around urllib3's (included in the requests library) extremely bad log implementation. I'll post a separate post and link all related topics to it once I've figured out how to work around the issue.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Fri Apr 22, 2016 9:53 am
RogueProeliator offline
User avatar
Posts: 2501
Joined: Nov 13, 2012
Location: Baton Rouge, LA

Re: Plex Media Server Manager Plugin - Beta

Yes, that's the problem. I'm trying to figure out a way around urllib3's (included in the requests library) extremely bad log implementation. I'll post a separate post and link all related topics to it once I've figured out how to work around the issue.

Cool, thanks for the help, Jay... I suspect several of the other plugins that people have reported seeing this issue with are also using that library based on the developers and their other posts.

Who is online

Users browsing this forum: No registered users and 1 guest