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

Log the server response when an HTTP error is raised #52

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

ryanc
Copy link
Contributor

@ryanc ryanc commented Feb 19, 2025

Hello,

Occasionally, our OctoDNS pipeline will fail with UltraDNS due to a server-side error. A message like the following is logged.

requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://restapi.ultradns.com/v2/zones/example.com./rrsets/TXT/example.com.

If I am in a hurry, I will hack in some print statements to determine what the Ultra REST API error is, so I thought that it would be handy to contribute a patch upstream to provide more details about the sync failure. The merge request will cause OctoDNS to log errors like this during an HTTP error.

2025-02-19T17:05:30  [281473443368992] ERROR UltraProvider[ultra] _request: method=PUT, url=https://restapi.ultradns.com/v2/zones/example.com./rrsets/A/www.example.com., response=<Response [400]>,  reason=Bad Request, body=[{"errorCode":2136,"errorMessage":"The TTL you have defined for this record type does not meet the Global Minimum TTL. Please enter a TTL greater than the Global Minimum TTL setting. Global Minimum TTL value 300 and  Global Maximum TTL value 86400"}]

Thanks!

@ryanc ryanc force-pushed the log-context-for-http-error branch from 8a9c7b1 to 57da9b5 Compare February 19, 2025 19:09
Copy link
Contributor

@ross ross left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable.

@ross ross merged commit 80e0208 into octodns:main Feb 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants