Search code examples
node.jskubernetesdns

getaddrinfo ENOENT error in node pod inside kubernetes cluster


I have found an issue in our project with different microservices written in Nodejs inside a K8s cluster sometimes the http calls come to an error due to a name resolution error.

For example here's an exception when a service tries to call another service called crud-service inside the same namespace:

Error: getaddrinfo ENOENT crud-service
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
    at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)

Up to now we can say that:

  • it happens sporadically, without a clear reason.
  • if we try to resolve the host crud-service from the pod with the command nslookup crud-service works just fine.
  • this problems occurs on many pods, also when we try to reach an host external to the cluster
  • we don't think this problem it's related to the DNS server, in this case we should have a EAI_AGAIN error, and if we call an invalid host we should have a ENOTFOUND error

Do you have any idea to debug this problem? Do you know how to know the reason of the ENOENT error?

Thank you


Solution

  • We have found a solution by disabling Dynatrace on the cluster. We are moving forward with further investigation.