rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.39k stars 600 forks source link

Notifying Plex is broken with Plex server release 1.1.2 #2723

Open mauirixxx opened 8 years ago

mauirixxx commented 8 years ago

Here's the log I get after Headphones fires off the Plex update command: http://pastebin.com/xksJ5GUE

I'm guessing Plex did something that Headphones doesn't like?

seanvree commented 8 years ago

Yeah, this has been happening to me for a while now.

rembo10 commented 8 years ago

Hm, I'll take a look

i814u2 commented 8 years ago

Same for me. I checked a little and even manually attempting to hit http://server:32400/library/sections returns 401 error. Even if I manually add my plex token in the url.

A bit more info, in case it helps: I have Plex Home enabled, with pin code for my user and a guest user setup as well (Guest has access to music library). If I remove the pin, even though I'm authenticated within the same browser, I still get the 401 error. I attempted to undo the Home setup and either I failed, or something is odd with Plex. It looks like it put me right back in. My headphones config has http://:32400 for the "Plex Server Host:Port" setting, and the proper token in the token field. None of the other fields are populated, and this was previously tested and working for me. Plex Server version: 1.1.3.2700 headphones version: 0.5.16 (commit 5a2082e)

i814u2 commented 8 years ago

Quick update: either messing with the Home setup (leaving the home, and then re-adding my users), or the upgrade of Plex Server changed my token. The obvious answer would be that messing with the Home setup is what did that. However, if someone could check their existing setup so see if their token changed, that would be helpful. If nothing else, adding the new token fixed headphones for me. So, if Plex upgrade didn't change your token, you can redo your Home users in order to get a new one and then update headphones.

If that's the case, this would be a Plex issue and the work-around is fairly lame. I can't remember if I used that token in other scripts/configs, so I'll need to re-check them now.

mauirixxx commented 8 years ago

ahh I should've looked into this more - 401 means unauthorized in web server land :D

In version 1.1.0 of Plex they made changes to the network security, which you can read about HERE.

The gist of it, if you're running a Plex server that's signed in to Plex (for remote streaming access) then ALL programs must be "signed in" to Plex as well.

However, for older apps (or apps that have no reason to "sign in" to Plex) there's a work around (that I've confirmed on my end that works). Go to Settings -> Network -> Show Advanced -> List of IP addresses and networks that are allowed without auth

You can put a specific IP address in there, or a whole subnet - so for example 192.168.25.20 will allow a single device with that IP to access the Plex server without signing in. Or you can do your entire home network, like so: 192.168.25.0/24

It's comma separated, so you can put 192.168.12.0/24,192.168.18.0/24,192.168.25.0/24 for example, if you have multiple local networks that access your server.

I downloaded 2 albums after making this change, and Headphones is now sending update commands without Plex telling it to piss off.

2016-09-07 09:16:19 INFO    Pushalot notifications sent.
2016-09-07 09:16:18 INFO    Pushalot request
2016-09-07 09:16:18 INFO    Sending library update command to Plex Media Server@ http://192.168.14.20:32400
2016-09-07 09:16:18 INFO    Post-processing for Eminem - The Eminem Show complete
2016-09-07 09:16:18 INFO    Library scan complete

I'd say this issue is closed as it's a Plex issue, and the work around is fairly trvial - we just need to make this bit of information known.

i814u2 commented 8 years ago

Any reason it worked for me after adjusting my token? Obviously it's possible that my token changed for some other reason, but when I updated to the proper token, it worked again. I didn't have to add the IP to the exclusion list. Granted, it's on the same server, so maybe it's fine due to that aspect and the incorrect token was all for me (since I'm part of a Plex Home).

Either way, Plex issue. But might be nice to have login options for folks instead of skipping the auth portion. That way I don't end up with a subnet (to handle dhcp changes) allowed without authorization.

mauirixxx commented 8 years ago

Plex is supposed to allow programs on the localhost to work without auth - I don't think Headphones ever requested the Plex auth token, did it? I don't recall ever messing with Plex or an auth token just to make Headphones work and update.

In Headphones I have under notifications the actual IP of my Plex server in there, instead of localhost despite both services running on the same VM. Removing the netmask and telling changing the Plex server address in Headphones to localhost puts me back to square one :(

Nothing else is filled in, and I've never needed to have anything else filled in. I don't have Plex Home enabled - maybe that has something to do with your auth token changing? https://support.plex.tv/hc/en-us/articles/203948786 the relevant Plex support page that talks about it.

mauirixxx commented 8 years ago

Grabbing my Plex token and entering it into Headphones allowed me to remove the allowed network entry in Plex.

It seems the changes to Plex have affected my Sonarr installs as well - for the same issue :/