Plex (401) unathorized – I've tried EVERYTHING but can't make it work

Hello guys!

I’ve been having this problem since forever, I was decided to find a solution but so far I’m not able to. I will let you know all the things I’ve tried after searching through the freaking whole internet :D. My setup of HA and Plex server is under dockers running on unRaid (I know @balloob is also using unRaid so it shouldn’t be the problem?)

On Plex

  • Checked there was no PIN added to my account as suggested in here
  • White-listed my plex server IP (which is the same as Home Assistant) but you know, just in case.
  • I set Plex Settings > Server > Network > Secure Connections to “Disabled” (also tried with Preferred)
  • If I go to my plex web admin http://10.0.1.10:32400/clients I get same error as in HA (401 Unauthorized) but not sure if it’s related to something because if I go to http://10.0.1.10:32400 I just get redirected to http://10.0.1.10:32400/web/index.html and into the Plex web admin (so I’m correctly logged in)

On HA & Docker

I tried by using simple configuration like

media_player:
  - platform: plex

to more complete config like this

media_player:
  - platform: plex
    host: 10.0.1.10
    port: 32400
    username: redacted
    password: redacted
    server: unPlex

Tried with and without the Plex.conf file. Also with and without the token (taken from plex.tv, not from the local plex web ui which is different – actually I just tried with both just in case)

Found this code to test on Github

$ pip3 install plexapi==2.0.2 --upgrade
$ python3
from plexapi.myplex import MyPlexAccount
MyPlexAccount.signin("user", "password")

Which I tried and it shows no error

root@unBeast:/usr/src/app# python3
Python 3.6.1 (default, May 11 2017, 22:14:44) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from plexapi.myplex import MyPlexAccount
>>> MyPlexAccount.signin(“MYUSER”, “REDACTED”)
<MyPlexAccount:2605179:b’MYUSER’>

I tried to force re-install plexapi just in case by using

pip3 install --ignore-installed plexapi

AND STILL after trying all this I’m getting on HA logs:

2017-05-26 09:37:18 ERROR (<concurrent.futures.thread.ThreadPoolExecutor object at 0x2ac3ee2a2d68>_0) [plexapi] http://10.0.1.10: (401) unauthorized

I have no more freaking idea what to try! Is anyone willing to help maybe? I would really appreciate it!

Thanks!

The plex logs might show more information… but it does look like you’ve tried everything!

Is you plex hosted in docker too?

hey thanks for your reply! indeed, both Ha and Plex are running on separate dockers on unRaid system!

The logs might show more about why the 404 is being generated. Feel free to send them to me if you want me to take a look for you (see here if you are not sure how to get your logs: https://support.plex.tv/hc/en-us/articles/200250417-Plex-Media-Server-Log-Files). If you would rather send me them via plex then feel free to open a thread on the plex forums (formus.plex.tv) and I’ll reply there (I’m a plex ninja).

Ta

Ross

I think I found out the problem!!! (thanks to you for pointing out to take a look at the Plex logs).

It seems YOU CAN’T put 2 IP addresses in the white-list, even if it says that you can separate it with “,”. So I had this

I was getting an error in the Plex logs about it, but once I only left 1 IP then it suddenly worked (I also removed from HA config the host and port) so now it looks like:

  - platform: plex
    username: REDACTED
    password: REDACTED
    server: unPlex

You definitely can put 2 in, but I think the issue might be the space after the comma :slight_smile:
Glad its working now though!

oh weird! if that’s the problem I would suggest to change the description to alert of this! IMHO it’s normal to put a “,” and then make a space!

Thanks so much!

I’ve raised a bug for it. It might get knocked back but who knows.

1 Like

Hi I’m having the same problem getting this working with unraid (Linuxserver) dockers.

Do you still have the plex.conf file or just the config lines above?

  • what are your plex settings?

Thanks

I’m having the same issue but slightly different:

  • at home I have my Plex server and HA with Music Assistant: this connects easy…
  • a friend of mine who I would like to give access as well to my Plex Server through Music Assistant: this fails, whatever I try. Even trying to connect on my local network with Plex and the external duckdns domain of my friend…

Although, the topic is old, I hope there is someone who could help me.