Reaparr: Plex Account Save Fails After Token Validation
Having trouble saving your Plex account in Reaparr after successful token validation? You're not alone! This article dives into a common bug where Reaparr shows a successful validation when using an auth token, but throws an API error upon saving. We'll break down the issue, analyze the logs, and hopefully point you toward a solution.
Understanding the Issue
The core problem is that while Reaparr seems to validate your Plex authentication token correctly, an error pops up when you actually try to save the Plex account settings. This usually manifests as a 400 error in the browser console, indicating a bad request. Let's dig deeper into the specifics.
Key Symptoms
- Successful Validation: You enter your Plex authentication token, and Reaparr confirms it's valid.
- API Error on Save: When you hit the save button, a 400 error appears, preventing the account from being saved.
- Browser Console: The error is visible in your browser's developer console.
Technical Details
The error logs point to a "Bad request" at the /api/PlexAccount endpoint. Specifically, the metadata reveals a StatusCode - 400 and password - System.String[]. This suggests there might be an issue with how the password or authentication token is being handled during the save process, even though the initial validation succeeds.
Detailed Analysis
To truly grasp the issue, let's dissect the provided logs and steps. We'll focus on the key events leading up to the error, pinpointing potential causes and offering insights.
Reproduction Steps
- Navigate to Setup: Open Reaparr and head to the setup section.
- Access Plex Accounts: Find and click on the Plex accounts settings.
- Input Authentication Token: Enter your Plex authentication token in the designated field.
- Validate Token: Click the validate button to check the token.
- Observe Successful Validation: Reaparr should confirm that the token is valid.
- Save Account (with Console Open): With your browser's developer console open, click the save button.
- See 400 Error: Observe the 400 error in the console, indicating a problem with the request.
Log Examination
Let's break down the relevant log snippets:
-
13:23:00 [Information] [ValidatePlexTokenEndpointRequest.cs:111.HandleAsync()] => Successfully validated the PlexAccount Authentication Token for user ***MASKED*** from the PlexApiThis confirms the initial successful validation. Reaparr can communicate with the Plex API using the provided token.
-
`13:23:04 [Error] [Startup.Application.cs:73.ConfigureApplication()] => Bad request: http://
:7000/api/PlexAccount - Metadata: -- StatusCode - 400 -- password - System.String[]`
This is the critical error message. It indicates that the API endpoint
/api/PlexAccountis rejecting the request with a 400 status code. Thepassword - System.String[]metadata hints that the password field might be expecting a different format or is not being handled correctly. -
13:25:42 [Debug] [ValidatePlexTokenEndpointRequest.cs:75.HandleAsync()] => POST: /api/PlexAccount/validate/token with ValidatePlexTokenEndpointRequest { DisplayName = Aareon, ManualAuthenticationToken = <clear text token redacted> }This log shows the request being sent to validate the token. It includes the user's display name and the token itself.
-
`13:25:45 [Error] [Startup.Application.cs:73.ConfigureApplication()] => Bad request: http://
:7000/api/PlexAccount - Metadata: -- StatusCode - 400 -- password - System.String[]`
This error repeats, confirming the consistent failure when saving the account.
Possible Causes
Based on the symptoms and logs, here are several potential causes:
- Data Format Mismatch: The
/api/PlexAccountendpoint might be expecting the authentication token in a different format than what's being sent. Thepassword - System.String[]metadata suggests a problem with how the token is interpreted as a password. - Missing or Incorrect Parameters: There could be other required parameters for the
/api/PlexAccountendpoint that are missing or incorrect, causing the 400 error. The validation process might not check for all the necessary parameters needed for saving. - Token Encoding Issues: The authentication token might be getting corrupted or incorrectly encoded during the save process. This could lead to the API rejecting the token.
- Reaparr Bug: There might be a bug in Reaparr's code that specifically affects how Plex account settings are saved after token validation. This could be related to how the data is packaged and sent to the API.
- Unraid Specific Issue: While less likely, there could be an interaction between Reaparr and the Unraid platform causing the error. This is worth considering if other users on different platforms aren't experiencing the same issue.
Troubleshooting Steps
Now that we've identified potential causes, let's explore some troubleshooting steps to resolve the issue:
- Verify Token Accuracy: Double-check that the authentication token you're entering is correct. Even a small typo can cause validation to fail.
- Restart Reaparr: Sometimes, simply restarting Reaparr can resolve temporary glitches or issues.
- Update Reaparr: Ensure you're running the latest version of Reaparr. Developers often release updates to fix bugs and improve stability. You mentioned you are using the