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

More graceful warning on unauthorized API request (TransIP or generic?) #2505

Closed
djoris opened this issue Jan 16, 2024 · 1 comment
Closed
Milestone

Comments

@djoris
Copy link

djoris commented Jan 16, 2024

Due to user error, my API calls to TransIP failed. (If you must know: I forgot the toggle at my DNS provider to enable API.)

The warning I got was not descriptive to me, adding to the confusion:

Error creating TXT record: Unexpected character encountered while parsing value: Y. Path '', line 0, position 0.

Verbose logging helped me:

[DBUG] [HTTP] Send POST to https://api.transip.nl/v6/auth
[VERB] [HTTP] Request content: {"nonce":"9░░░░░░░░login":"░░░░","read_only":false,"expiration_time":"30 minutes","label":null,"global_key":true}
[VERB] [HTTP] Request completed with status Unauthorized
[VERB] [HTTP] Empty response

I think it would be more helpful if an error message would be given on the Unauthorized HTTP request, instead of failing on the empty response.

[DBUG] [.░░░░░░░░░.nl] Attempting to create DNS record under _acme-challenge.░░░░░░░░.nl...
[DBUG] [HTTP] Send POST to https://api.transip.nl/v6/auth
[VERB] [HTTP] Request content: {"nonce":"9░░░░░░░░░","login":"░░░░","read_only":false,"expiration_time":"30 minutes","label":null,"global_key":true}
[VERB] [HTTP] Request completed with status Unauthorized
[VERB] [HTTP] Empty response
[WARN] Error creating TXT record: Unexpected character encountered while parsing value: Y. Path '', line 0, position 0.
[DBUG] [
.░░░░░.nl] Failed to create record under _acme-challenge.░░░░░░░░░.nl
[EROR] [.░░░░░.nl] Error preparing for challenge answer
System.Exception: [
.░░░░░░.nl] Unable to prepare for challenge answer
at PKISharp.WACS.Plugins.ValidationPlugins.DnsValidation1.PrepareChallenge(ValidationContext context, Dns01ChallengeValidationDetails challenge) at PKISharp.WACS.Plugins.ValidationPlugins.Validation1.PrepareChallenge(ValidationContext context)
at PKISharp.WACS.RenewalValidator.Prepare(ValidationContext context, RunLevel runLevel)
[VERB] Starting post-validation cleanup
[VERB] Post-validation cleanup was succesful
[INFO] [*.░░░░░░░░░░.nl] Deactivating pending authorization
[DBUG] [HTTP] Send POST to https://acme-v02.api.letsencrypt.org/acme/authz-v3/304861148156

@WouterTinus WouterTinus added this to the 2.2.7 milestone Jan 23, 2024
@WouterTinus
Copy link
Member

I applied some changes in 2.2.7 to address this: general warnings on failed HTTP requests and specifically for TransIP avoiding this JSON parsing bug on an empty response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants