NREL / developer.nrel.gov

An issue tracker for NREL's APIs available at https://developer.nrel.gov
43 stars 39 forks source link

Could not resolve host: developer.nrel.gov #208

Closed jacksontong closed 3 years ago

jacksontong commented 3 years ago

We are getting this error while making request to NREL. The url is https://developer.nrel.gov/api/pvwatts/v5.json?&api_key={api_key}&system_capacity=1&azimuth=21&tilt=20&lat=-37.8198366&lon=145.1766079&array_type=1&module_type=0&losses=14&dataset=intl&timeframe=hourly&gcr=&inv_eff=96&radius=500

It seems only happen on my server. The link works fine on my browser and I can access https://developer.nrel.gov/. However it always throws same error on my server

curl https://developer.nrel.gov/
curl: (6) Could not resolve host: developer.nrel.gov
ping developer.nrel.gov
ping: developer.nrel.gov: Name or service not known

ping google.vn
PING google.vn (142.250.67.3) 56(84) bytes of data.
64 bytes from syd15s16-in-f3.1e100.net (142.250.67.3): icmp_seq=1 ttl=122 time=1.66 ms
aayushofdesk commented 3 years ago

I can confirm that I'm also experiencing the same issue.

GUI commented 3 years ago

@jacksontong, @aayushofdesk: Can you provide any other debug details, like what DNS servers you're using and the output of dig developer.nrel.gov? All of the external DNS checks I've performed come back successful, so I'm not sure what is going on here. Thanks!

jacksontong commented 3 years ago

@GUI

dig developer.nrel.gov

; <<>> DiG 9.10.3-P4-Debian <<>> developer.nrel.gov
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13786
;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;developer.nrel.gov.        IN  A

;; ANSWER SECTION:
developer.nrel.gov. 813 IN  CNAME   developer-nrel-gov.domains.api.data.gov.
developer-nrel-gov.domains.api.data.gov. 56 IN CNAME nrel._loadbalancers.api.data.gov.
nrel._loadbalancers.api.data.gov. 56 IN A   54.81.58.73
nrel._loadbalancers.api.data.gov. 56 IN A   52.2.60.74

;; Query time: 0 msec
;; SERVER: 169.254.169.254#53(169.254.169.254)
;; WHEN: Thu Apr 15 13:47:57 AEST 2021
;; MSG SIZE  rcvd: 163

===================================================================

cat /etc/resolv.conf 

domain c.pvsell-1078.internal
search c.pvsell-1078.internal. google.internal.
nameserver 169.254.169.254

===================================================================

curl https://developer.nrel.gov/
curl: (6) Could not resolve host: developer.nrel.gov
GUI commented 3 years ago

@jacksontong: Strange that dig resolves the address, but curl does not. I'm sort of taking wild stabs in the dark, but I tried changing one thing with DNS, so could you try with curl again? Thanks for helping to debug!

jacksontong commented 3 years ago

@GUI Thanks for your help, it's working on my server.

aayushofdesk commented 3 years ago

Sorry I wasn't much help as it was too late. But thank you for the quick fix, it works now!