-
Notifications
You must be signed in to change notification settings - Fork 50
bug: createDnsRecord throws "undefined method `end_with?' for nil:NilClass" #107
Comments
Related: netlify/open-api#240 |
Hi @CanRau, Could you please try to send the same request but directly via HTTP (e.g. with This would allow making sure this is an API bug (which it seems to be) and not a bug in |
Sure 🤝
|
Thanks @CanRau. This means this is not a problem related to the @vbrown608 @kitop @keiko713 Do you know what the problem might be? |
Sounds reasonable 😊👌 |
I'll file a bug on API. I'm curious to see the value of For the one copied from open-api issue, did you set the |
We deployed fix to API now that handles this. You should get a more helpful error message now. @CanRau Can you please try again and let us know? |
Looks great 👏
even though it wasn't directly clear to me that it's related to the content type 😅 With the content type set curl -H 'Authorization: Bearer [API_TOKEN]' -H "Content-Type: application/json" \
--data \
'{"type":"A",
"hostname":"junk.example.net",
"value":"192.168.0.1",
"ttl":3600,
"priority":null,
"weight":null,
"port":null,
"flag":null,
"tag":null}' \
https://api.netlify.com/api/v1/dns_zones/[ZONE_ID]/dns_records/ it works as expected and returns the result correctly {"hostname":"junk.example.net.gaiama.org","type":"A","ttl":3600,"priority":null,"weight":null,"port":null,"flag":null,"tag":null,"id":"[ID]","site_id":null,"dns_zone_id":"[ZONE_ID]","errors":[],"managed":false,"value":"192.168.0.1"} can't get the js client working though, even after updating to client.createDnsRecord({
zone_id: dnsZone[0].id,
type: record.type,
hostname: record.name,
value: record.value,
}); feeding it those values {
"type": "A",
"name": "TEST",
"value": "192.168.0.1"
} resulting in the following error
I logged all values and all are valid strings 🤷♂️ |
- Do you want to request a feature or report a bug?
This is a bug report
- What is the current behavior?
Trying to create DNS records using
throws the following error
It's already been brought up in the community
- If the current behavior is a bug, please provide the steps to reproduce.
Using the code from above using a valid API token and correct site id found in
https://app.netlify.com/sites/SITE_NAME/settings/general -> Site Information: APP ID
- What is the expected behavior?
Creation of DNS records.
- Please mention your node.js, and operating system version.
NodeJS v12.14.1, macOS 10.14.6
The text was updated successfully, but these errors were encountered: