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

godaddy provider fails under v3.3.24 given FDQN #518

Open
eengstrom opened this issue Jun 2, 2020 · 3 comments
Open

godaddy provider fails under v3.3.24 given FDQN #518

eengstrom opened this issue Jun 2, 2020 · 3 comments

Comments

@eengstrom
Copy link

Upon upgrading from 3.3.23 to .24, the godaddy provider fails when given a FQDN including a full stop. e.g. foo.example.com. (note trailing period). E.g.:

odin $ lexicon --version
lexicon 3.3.24

odin $ lexicon godaddy create example.com TXT --name=foo.example.com. --content=bar.example.com
Traceback [elided...]
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://api.godaddy.com/v1/domains/example.com/records/CNAME/foo.example.com.

odin $ pip3 install dns-lexicon==3.3.23
[elided...]
Successfully installed dns-lexicon-3.3.23

odin $ lexicon --version
lexicon 3.3.23

odin $ lexicon godaddy create example.com TXT --name=foo.example.com. --content=bar.example.com
RESULT
------
True

Looks like there have been a lot of changes recently, so I'm figuring this one is easy, but if @adferrand doesn't see the issue right away, LMK and I'll dive in and try to fix.

Seems like it's also related to #362, but until today I would have said that issue was OBE.

@doddo
Copy link
Contributor

doddo commented Jun 13, 2020

The breaking of this one seems to correlate with the addition of workarounds for zones with CAA records (#506) (which the API does not support)

curl -s  -X GET -H "Authorization: sso-key $SSO_KEY" "https://api.godaddy.com/v1/domains/fistofsteel.xyz/records/CAA"  | jq .
{
  "code": "INVALID_VALUE_ENUM",
  "message": "type not any of: A, AAAA, CNAME, MX, NS, SOA, SRV, TXT"
}

The error is here in the provider. name ought to be in the short form but it is not.

    self._put('/domains/{0}/records/{1}/{2}'.format(domain, rtype, name), records)

I stumbled across some other errors too, related to updates throwing 422 expecting a list of records, but getting a single record instead running the test suite after making the above adjustments, which I found a bit confusing as they did not relate to the bits of code which I changed.

Furthermore, the API does now seem to have envolved since the godaddy provider was created, I do believe that it could be simplified somewhat.

Maybe an overhaul of the whole thing could be a good idea?

@adferrand
Copy link
Collaborator

Hello!

Indeed, I think that replacing name with relative_name will fix issues. My bad, I missed this during the review of #506.

I just reactivated my domain on godaddy, hope I will be able to resync the test suite and provide a fix in the next hours.

@adferrand
Copy link
Collaborator

OK. Too much errors. Let's proceed to revert #506.

@adferrand adferrand mentioned this issue Jun 13, 2020
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

No branches or pull requests

3 participants