Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save form in Authentication Required modal if invalid settings are present in config #5979

Closed
1 task done
mynameisbogdan opened this issue Aug 29, 2023 · 1 comment · Fixed by #6189
Closed
1 task done
Labels

Comments

@mynameisbogdan
Copy link
Contributor

mynameisbogdan commented Aug 29, 2023

Is there an existing issue for this?

  • I have searched the existing open and closed issues

Current Behavior

If you have invalid settings in your config.xml doesn't let you save in Authentication Required modal.

Expected Behavior

To be able to save.

Steps To Reproduce

  1. Have these 3 settings in your config.xml:
<Config>
  <EnableSsl>True</EnableSsl>
  <SslCertPath></SslCertPath>
  <AuthenticationMethod>None</AuthenticationMethod>
</Config>
  1. Open http://localhost:8989/
  2. Click on save in Authentication Required Modal

Environment

- Sonarr: develop branch

What branch are you running?

Develop

Trace Logs?

2023-08-29 20:44:18.5|Trace|Http|Req: 110 [PUT] /api/v3/config/host (from 127.0.0.1 ...)
2023-08-29 20:44:18.5|Trace|SonarrErrorPipeline|Handling Exception
2023-08-29 20:44:18.5|Warn|SonarrErrorPipeline|Invalid request Validation failed: 
 -- SslCertPath: 'Ssl Cert Path' must not be empty.
2023-08-29 20:44:18.5|Trace|Http|Res: 110 [PUT] /api/v3/config/host: 400.BadRequest (7 ms)
2023-08-29 20:44:18.5|Debug|Api|[PUT] /api/v3/config/host: 400.BadRequest (7 ms)
[
  {
    "propertyName": "SslCertPath",
    "errorMessage": "\u0027Ssl Cert Path\u0027 must not be empty.",
    "attemptedValue": "",
    "severity": "error",
    "errorCode": "NotEmptyValidator",
    "formattedMessageArguments": [],
    "formattedMessagePlaceholderValues": {
      "propertyName": "Ssl Cert Path",
      "propertyValue": ""
    }
  }
]

Anything else?

No response

@markus101
Copy link
Member

We have at least a few options here:

  • Add the ability to force the save via another property/param in the request that ignores the errors
  • Send only the values we care about and ensure validation doesn't apply (I think everything would need to become nullable) to null values
  • Add another endpoint to handle auth specifically

markus101 added a commit that referenced this issue Nov 19, 2023
markus101 added a commit that referenced this issue Nov 19, 2023
bruno-garcia pushed a commit to bruno-garcia/Sonarr that referenced this issue Feb 7, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants