LibraryOfCongress / api.congress.gov

congress.gov API
605 stars 38 forks source link

Recent `ENOTFOUND` errors #163

Closed ryparker closed 4 months ago

ryparker commented 8 months ago

Update: see DNS configuration issues found on api.congress.gov: https://github.com/LibraryOfCongress/api.congress.gov/issues/163#issuecomment-1788128819


I've recently been experiencing ENOTFOUND errors when requesting different APIs. It's not consistent but it seems to randomly occur on any API. I've noticed the error come up once every 10-20 minutes when chaining requests. It seemed to start happening about a week ago. Has anyone else noticed this?

In the most recent instance I was requesting: https://api.congress.gov/v3/committee-report/118/hrpt/97/text?api_key=<API_KEY>&format=json&limit=250&offset=0

Request error:

cause: Error: getaddrinfo ENOTFOUND api.congress.gov
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:108:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'api.congress.gov'
  }

I'm within the rate limit as you can see from my last request which had the following response headers:

 "x-ratelimit-limit": "1000",
  "x-ratelimit-remaining": "621",

Here's a list of other URLs where i've experienced this issue:

https://api.congress.gov/v3/nomination/118?api_key=<API_KEY>&format=json&limit=250&offset=1000
https://api.congress.gov/v3/committee-meeting/118?api_key=<API_KEY>&format=json
https://api.congress.gov/v3/committee-report/118/hrpt?api_key=<API_KEY>&format=json
https://api.congress.gov/v3/member?api_key=<API_KEY>&format=json
rbram commented 8 months ago

Hello. Thanks for your feedback. We have not been able to replicate this issue, but we will keep an eye on it.

ryparker commented 8 months ago

Thanks. I'll keep testing to see if its on my end.

ryparker commented 8 months ago

I keep running into this issue randomly across any of api.congress.gov endpoints. Seems like it might be related to api.congress.gov having invalid DNS configuration. See this report I generated from: https://mxtoolbox.com/emailhealth/api.congress.gov/

CleanShot 2023-10-31 at 17 38 14

Based on the report these failures stand out:

DNS Bad Glue Detected

We detected bad glue being issued by your name servers. Either required glue was missing or the glue returned contained incorrect IP Addresses. Glue refers to additional DNS A records that are returned to assist in locating name servers.

DNS Local Parent Mismatch

The DNS check requests the NS records for the requested domain starting from the Root servers and continues following referrals as long as the Answer returned is not marked as Authoritative. Once we have gotten an Authoritative response, we compare the list of NS records in that answer which we are calling Local to the list of referrals given to us by the immediately previous response, which we are calling the Parent.

A discrepancy between these lists signifies that either the NS records on your authoritative name servers are incorrect or that your have failed to update your parent records. Parent records for second-level domains are usually controlled at the domain's registrar.

Missing NS records can cause delays for clients when resolving your records, as they attempt to contact a name server that is either non-existant or non-authoritative. Extraneous NS records can cause havoc if they point to name servers that are not being kept current, or worse, if they are no longer under your control.

At least one name server failed to respond in a timely manner

Under normal circumstances, a single name server being temporarily unresponsive should not cause significant impact. The resolver will automatically attempt to contact another server to reply to it's query and the result will be cached according to the TTL configured for the record.

The fewer name servers you have serving your DNS records the more weight we recommend giving this warning.

Serial numbers do not match

You will sometimes see your serial numbers become out of sync whenever you update records within your zone and the changes are transferred from your master name server to the slaves. If your serials do not align after a short while then there might be a problem with the transfer. If you see your serial numbers changing when you have not made any changes to your zone, then you should also investigate matters.

mnewatloc commented 6 months ago

We're investigating this issue and have opened a bug ticket.

mnewatloc commented 4 months ago

Is this still occurring?

ryparker commented 4 months ago

I've not noticed this issue since January. I believe this can be closed. Thanks for the fix!