hassio-addons/addon-plex

Anyway to Change Plex Claim Code Once Entered?

krkeegan opened this issue · 5 comments

Problem/Motivation

Plex had a recent data breach, and in the process, my server was un-associated with my account. I requested a new claim code and entered it on the configuration page, but it didn't work.

Pretty sure based on my review of /etc/cont-init.d/plex.sh that a new claim code will only be authenticated on the first run.

Expected behavior

I would have expected the Plex addon to recognize that the claim code had changed and request new authentication.

Actual behavior

Nothing.

Steps to reproduce

Remove the server from your account then try to add it back with a new claim code.

Proposed changes

Add some checking to plex.sh to see if the claim code has changed.

If this happens to anyone else. You can make a backup of the Plex addon and then open up the archive and delete the preferences.xml file. Upload and restore this modified backup and you will be able to set a new claim code.

Thanks for the hack @krkeegan.

Unfortunately I couldn't get my modified backup to be uploaded back into HA, so another way of doing this is:

  1. Stop Plex Media Server add-on
  2. SSH into the HA server and rename/delete the file: /usr/share/hassio/addons/data/a0d7b954_plex/Plex Media Server/Preferences.xml
  3. Get a new code from https://plex.tv/claim and update add-on configuration
  4. Restart the add-on

If everything worked, the message below should appear in the Plex add-on logs and the Web UI should display the server onboarding flow again.

[14:55:48] INFO: First run! Initializing configuration files..

I'm having a similar issue but I'm unable to access that location from ssh to delete the file

Yeah, you won't have access if you installed using the Home Assistant OS installation method. At best in that case, you will need to do the backup and restore option.

Interesting issue with Plex. I guess the only solution is to store the claim code and detect if it changes. 🤔