Hellowlol / HTPC-Manager

A fully responsive interface to manage all your favorite software on your Htpc.
MIT License
344 stars 48 forks source link

Unable to contact Plex - No JSON object could be decoded #561

Open InsolentBastard opened 7 years ago

InsolentBastard commented 7 years ago

Reporting Issues:

2017-08-15 12_09_03-htpc manager Use proper markdown syntax to structure your post (i.e. code/log in code blocks).

Make sure you provide the following information below:

Close your issue when it's solved! If you found the solution yourself please comment so that others benefit from it.

Link to log: https://pastebin.com/npAqXjNr

JasonGhent commented 7 years ago

The username and password fields aren't being carried into the modules/plex.py file through cherrypy to htpc.settings, so when the ping method gets called it never triggers the initial plex signin to get an auth token for all other requests.

I was able to rig a 'solution' for this (which I do not recommend anyone to use, unless you know what you're doing) that involves putting an auth token ripped out of a plex web player XHR's query parameters.

Then you shoehorn it into the application logic as a hard-coded value.

The hack can be condensed to: sed -i "897s/.*/ authtoken='YOUR_TOKEN'/" modules/plex.py (12 spaces before authtoken, despite my inability to properly format) [edit: until the token expires, at which point you can grab a new one and rerun this]

Hellowlol commented 7 years ago

This issue comes of from time to time but i cant seem to reproduce it. Ill take alook and see if cant make this more robust.

Hellowlol commented 7 years ago

can you try to signin manually using http://ip_to_htpc_manager:port/plex/myPlexSignin?username=your_username&passord=your_passwird

InsolentBastard commented 7 years ago

Sorry for the delayed response, and thank you for your help on this. I just reinstalled HTPC Manager and it is working fine now for some reason. Thank you for the help.

JasonGhent commented 6 years ago

In my case, with near certainty this was because I had the manager setup to point to Plex by local subnet IP instead of by loopback address. The local subnet was exposed via a reverse proxy with basic auth enabled (which was cached for the browser, making it not obvious).

Changing the IP should fix it, but I haven't verified.

(Edit: I confirmed this was the case)

timbiotic commented 6 years ago

I have the same issue and don’t understand the fixes

morpheus2n2 commented 6 years ago

I have just started using this and have the same problem, is there a fix coming for this?

morpheus2n2 commented 6 years ago

Found the fix, I set up the rest of HTPC and then obviously restarted this seemed to then allow plex to work just fine :)