3

I have a windows electron application that is throwing the following error: RequestError: Error: getaddrinfo ENOTFOUND thedomain.com I'm using the request-promise-native library for my requests.

The only issue is that many other users of the application myself included are not seeing the issue at all. After hours of reading about this, I know that the error is more than likely DNS resolution related. The example I've attached is SSO authentication.

Has anyone before seen this issue where only a few users get the ENOTFOUD error? How did you go about solving for those users? Thanks in advance for any help.

function requestPFToken(options, code, emitter) {
  let data = {
    form: {
      grant_type: 'authorization_code',
      code: code
    },
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': (process.env.NODE_ENV === 'development') ? 'Basic RUNUMTAwMDg1MkNMTjpTRlFKRXpabcdefhNVlYQ3hZZkdCbjVaYnJucTJVTU1FbElNdDFtSGlqNExMNzB3RFVE' : 'Basic RUNUMTAwMDg1MkNMTjp3dlRwN1Nabcdef16S0ZwcmViUERQcjM5MUFzR3pKWnBSYm93T1c3bGRWUEQ1ZHFxeHlDdG1jclp4azhl'
    },
    uri: (process.env.NODE_ENV === 'development') ? 'https://example.net/as/token.oauth2' : 'https://example.net/as/token.oauth2',
    method: 'POST'
  };
  rp(data)
    .then((response) => {
      var token = extractAuthToken(response);
      StaticBanner.hide();
      emitter(postSsoAuth(token));
    })
    .catch(function (err) {
      alert(err);
    });
}
Getek99
  • 479
  • 2
  • 5
  • 18

1 Answers1

0

if you are using docker try to restart it, it should be wroking fine after restarting docker service

systemctl restart docker

source: github.com/nodejs/node/issues/15780#issuecomment-605418938

Amr Ibrahim
  • 2,066
  • 2
  • 23
  • 47