ampproject / ampproject/amp-toolbox
EHOSTUNREACH and EAI_AGAIN errors
- Dominant language
- HTML
- Stars
- 459
- Forks
- 242
- PR merge metrics
- No merged PRs in 30d
Description
We have been getting the following errors recently:
1.) request to https://cdn.ampproject.org/rtv/metadata failed, reason: getaddrinfo EAI_AGAIN cdn.ampproject.org
2.) request to https://cdn.ampproject.org/version.txt failed, reason: connect EHOSTUNREACH
Both of the errors seems to be originating from:
/node_modules/@ampproject/toolbox-core/node_modules/node-fetch/lib/index.js:1461:11
The issue is intermittent and when it occurs, our nodeJS app is unable to recover without restarting. Is it possible to implement a retry to work around the EAI_AGAIN and EHOSTUNREACH errors? or at least invalidate any output that may have been cached by node-fetch?
Contributor guide
Research direction
Start with the reported failure location at node_modules/@ampproject/toolbox-core/node_modules/node-fetch/lib/index.js:1461:11 and reproduce requests to the two cdn.ampproject.org URLs. Investigate how EAI_AGAIN and EHOSTUNREACH leave the Node.js app unable to recover, then define tests for the retry or cache-invalidation behavior. Done means intermittent failures no longer require an application restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100