@brucys Your error is different than sonynut’s your’s is a permissions issue.
You need to make sure you have claimed your media server, review this thread:
Hi Again
I have downloaed the logs, how do I get them to you to look at? It is a Zip file 2.3mb in size
It is still not working
Pastebin should be an ok place to upload your logs, just redact your API key or any passwords in the logs.
The log downloaded as multiple files in a zip file. I will go through the logs and then send to Pastebin
cheers
I’m also getting this problem and none of the advice here has worked, sadly.
The claim token has a lifetime of 4 minutes by the time that’s saved into plex.conf and hass.io is rebooted it’s invalid. For me, it wouldn’t have mattered though because checking from the command line using wget said it was invalid from the start. It’s possible that because Plex is running on a remote server, in docker, that this is causing an issue (but of course I can access it fine via TV/browser etc).
In the end I did the old school method of extracting the X-Plex-Token from Chrome, putting that into plex.conf and rebooting hass.io. This works, however I am seeing multiple Plex panels on the homepage for each person using the server. I’m not sure if that’s normal or not…
I’ve had this issue twice when I’ve made major changes to my home assistant or network.
This is whats worked for me to solve the issue.
First things to do is log into your plex via the web: https://app.plex.tv
Head to Account -> Authorised Devices -> If you have a previous/old installation of Home Assistant listed, remove it.
Then head to Settings -> Network -> List of IP addresses and networks that are allowed without auth = add the IP of your Home Assistant.
Restart your Plex Server.
Edit/create your plex.conf file with a fresh token, then restart your Home Assistant & it should all be working as it should.
Crosspost from https://community.home-assistant.io/t/error-when-configuring-plex-server/124400:
I’ve made some changes to the Plex component for the upcoming 0.100 release that will automate most of the setup if your server has been “claimed” by a Plex account. If there’s anyone willing to test the new functionality in the 0.100b that comes out tomorrow (Wednesday, Oct 2), I’d love to get feedback before the official release a week later.
This worked for me. Thank you!
I moved to another HA server. Because of that a new token. Deleted integration, restated, added Plex integration again, Plex web login to get the token, successfull, but then always:
No servers linked to Plex account
There is a server linked. It worked before as well.
Any ideas?
Sounds like you’re using the manual config setup. Have you tried the automatic flow which obtains a new token for you by redirecting you to Plex to login?
No. Unfortunately, above was the automatic flow.
And yes, restarted before, removed HA from former integration/server inside Plex before, … And yes, if I log into plex.tv with this credentials, the server is there.
Can you create a new issue at Issues · home-assistant/core · GitHub and add logs? Bumping up the log levels to debug for homeassistant.components.plex
and plexapi
would be a good start. Make sure you don’t share any tokens.
Thx. Did so.
I am re-posting this as I haven’t got any replies
You don’t have remote access enabled on your Plex server.
So ip based remote access won’t work
If you are serving an SSL via reverse proxy with Nginx Proxy Manager. You don’t need to enable remote access in plex
- port forward 80 and 443 to NPM on your router, 80 so you can rewrite http → https
- create a proxy host for plex.yourdomain.whatever → internal Plex IP, port 32400
- create an internal dns rewrite in Adguard for your domain so you don’t leave your network just to come back in for internal requests
In HA add the integration using your fqdn and https port (you don’t need to add :443 to the end because https is native to 443)
https://plex.yourdomain.whatever
Now you can access Plex internally or externally with the same URL with a reverse proxy, and you don’t have to enable remote access on the Plex server
@Deckoz2302 I am very grateful. Not sure if you have the time to answer the below
-
port forward 80 and 443 to NPM on your router, 80 so you can rewrite http → https
Do I also enable port 80 in NPM – currently it is disabled -
create a proxy host for plex.yourdomain.whatever → internal Plex IP, port 32400
I can create a proxy host – currently using duck DNS which as I understand will accept wild card sub domains. Do I also create a separate reservation on my router – currently my HA is 192.168.88.72 so should it be a reserved IP or the can I continue to use 192.168.88.72
I think I can google the rest and try to figure it out. Will post detailed instructions once I get it to work.
Thanks again
Yes, and then on the proxy host config enable https redirect.
This way you could say just type in plex.yourdomain in a browser and it will automatically forward to https://plex.yourdomain
If you don’t do this you can’t just type plex.yourdomain as that will resolve as http://plex.yourdomain which isn’t serving anything on http port 80
The only NAT ports(port forwarding) reservation on your router you should need is 80 and 443. Which will forward to your NPM host.
Let’s say you have a Plex stack, radarr, sonarr etc. You are only forwarding to NPM 80 and 443 once from your router. NPM handles the FQDN and then forwards to the backend IP and port for the service configured in the proxy config.
Now let’s say you have
- plex.yourdomain
- radarr.yourdomain
- sonar.yourdomain
- tautulli.yourdomain
- jackett.yourdomain
- overseerr.yourdomain
DNS records only hold records, not Ports. So all three of the above sub domains will have the same underlying A record(IP) or CNAME record(pointing to another FQDN) meaning they all resolve to the same host in a residential scenario where you have one ISP. Provider giving you one IP or one NAT
So they all navigate to your NPM proxy via port 80(http://plex.yourdomain when you type plex.yourdomain in a browser. If in NPM you have HTTPs redirect on it redirects to 443 or https://plex.yourdomain
Now on the backend your hosts might be different hosts or the same, and different ports. That’s what the proxy does, it serves a SSL certificate and acts as the front end to the backend server/microservice without actually exposing that service to the Internet, as there is a proxy in front of it.
I quoted this again. To mention IP reservations. While you only need two ports open to NPM only, not the actual service ports like Plex on 32400. You should make IP reservations and static IPs for your servers and micro services, so that your router always and only forwards 80 and 443 to a static IP where NPM resides. And then for each of your micro services, NPM always forwards to a static IP the service resides on. This way your services aren’t on DHCP and the configurations will always resolve to the correct host.
Thank you for the detailed instructions, plus the explanation how things work were amazing and insightful. I followed them in detail. I tried to setup a static IP but one of the requirements is a MAC or Client ID. So I tried and abandoned it. I setup the forwards, filters and the URL re-write. I can now access PLEX outside my network and within my network goes to my local HA IP at port 32400.
The one problem I am faced with is when I access outside my network through my Duck DNS domain then it isn’t secure. My HA instance is still secure how can I leverage to use Lets Encrypt for my plex domain. I have looked around but couldn’t find a solution
The second problem but not a deal breaker is, outside my network when I click on “open Web UI” in the Plex media Server “Add On” it resolves to myha.duckdns.org:3400 not to plexmyha.duckdns.org:3400 hence doesn’t go anywhere.
I have updated my Plex network preferences. Any ideas?
Disable duck DNS proxy relay. As the duckdns add-on only supports one proxy name as far as I know
Then install Nginx Proxy Manager, and make your proxy hosts there.
After a lot of playing around. I gave up. I added Wire Guard VPN. Now when I want to play Plex I VPN in and play. Bonus of closing ports