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

Report bugs to Netlify API #3088

Open
draevin opened this issue Aug 5, 2020 · 1 comment
Open

Report bugs to Netlify API #3088

draevin opened this issue Aug 5, 2020 · 1 comment
Assignees
Labels
3rd party api report bugs to dns api, deploy hooks and notification hooks

Comments

@draevin
Copy link
Contributor

draevin commented Aug 5, 2020

Please report any bugs related to the Netlify API here!

@acmesh-official acmesh-official deleted a comment from auto-comment bot Aug 5, 2020
@Neilpang Neilpang added the 3rd party api report bugs to dns api, deploy hooks and notification hooks label Aug 5, 2020
@thekevinbrown
Copy link
Contributor

thekevinbrown commented Apr 5, 2022

I'm having some trouble with the Netlify API via pfSense. I'm trying to use it but I keep getting this type of log:

(Note: I've replaced references to my actual domain with mydomain.com and the challenge value with [challenge value].

[Tue Apr  5 20:46:04 AEST 2022] Checking domain: _acme-challenge.firewall.mydomain.com
[Tue Apr  5 20:46:04 AEST 2022] Checking domain: firewall.mydomain.com
[Tue Apr  5 20:46:04 AEST 2022] Checking domain: mydomain.com
[Tue Apr  5 20:46:04 AEST 2022] _domain_id='609dddf4b9337b4899666f24
609dd9c1410efd3c571ecfa2'
[Tue Apr  5 20:46:04 AEST 2022] _sub_domain='_acme-challenge.firewall'
[Tue Apr  5 20:46:04 AEST 2022] _domain='mydomain.com'
[Tue Apr  5 20:46:04 AEST 2022] dns_zones/609dddf4b9337b4899666f24
609dd9c1410efd3c571ecfa2/dns_records
[Tue Apr  5 20:46:04 AEST 2022] data='{"type":"TXT", "hostname":"_acme-challenge.firewall", "value":"[challenge value]", "ttl":"10"}'
[Tue Apr  5 20:46:04 AEST 2022] POST
[Tue Apr  5 20:46:04 AEST 2022] _post_url='https://api.netlify.com/api/v1/dns_zones/609dddf4b9337b4899666f24
609dd9c1410efd3c571ecfa2/dns_records'
[Tue Apr  5 20:46:04 AEST 2022] body='{"type":"TXT", "hostname":"_acme-challenge.firewall", "value":"[challenge value]", "ttl":"10"}'
[Tue Apr  5 20:46:04 AEST 2022] _postContentType
[Tue Apr  5 20:46:04 AEST 2022] Http already initialized.
[Tue Apr  5 20:46:04 AEST 2022] _CURL='curl --silent --dump-header /tmp/acme/firewall.mydomain.com//http.header  -L '
[Tue Apr  5 20:46:04 AEST 2022] Please refer to https://curl.haxx.se/libcurl/c/libcurl-errors.html for error code: 3
[Tue Apr  5 20:46:04 AEST 2022] _ret='3'
[Tue Apr  5 20:46:04 AEST 2022] error dns_zones/609dddf4b9337b4899666f24
609dd9c1410efd3c571ecfa2/dns_records
[Tue Apr  5 20:46:04 AEST 2022] error adding validation value ()
[Tue Apr  5 20:46:04 AEST 2022] Error add txt for domain:_acme-challenge.firewall.mydomain.com
[Tue Apr  5 20:46:04 AEST 2022] _on_issue_err
[Tue Apr  5 20:46:04 AEST 2022] Please check log file for more details: /tmp/acme/firewall.mydomain.com/acme_issuecert.log

...proceeds to fail because it couldn't set the DNS record

What I found interesting about this is it's seemingly taking two domain IDs and trying to use both joined by a newline in the POST. I had a look at the source and I noticed this line. I looked at the response from the original GET, and here are the domains by ID:

  • 609dddf4b9337b4899666f24: mydomain.com.au
  • 609dd9c1410efd3c571ecfa2: mydomain.com

So it looks like having both the .com.au as well as the .com set up in Netlify currently breaks the regex that's trying to parse the JSON there, resulting in both ID's getting jammed into the POST URL, obviously resulting in an error from Netlify's API because that's not valid at all. We need to constrain the trim to contain just the ID from exactly the domain we need.

Edit: PR opened here: #4013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party api report bugs to dns api, deploy hooks and notification hooks
Projects
None yet
Development

No branches or pull requests

3 participants