question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Http request getaddrinfo ENOTFOUND at GetAddrInfoReqWrap.onlookup (dns.js:92:26)

See original GitHub issue

Summary

The request module fail to validate the invalid http or https URL request.

Simplest Example to Reproduce

Example: Using following request this error occures http://aaa…com the

ERROR: error: { Error: getaddrinfo ENOTFOUND te…com te…com:443 at errnoException (dns.js:50:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26) code: ‘ENOTFOUND’, errno: ‘ENOTFOUND’, syscall: ‘getaddrinfo’, hostname: ‘te…com’, host: ‘te…com’, port: 443 } statusCode: undefined

var request = require('request');
  request('http://te...com/../', function (error, response, body) {
  console.log('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
});

Expected Behavior

The request need to validate the URL pattern properly to avoid the error

Current Behavior

Possible Solution

Context

Your Environment

software version
request 2.88.0
node 8.9.3
npm 5.6.0
Operating System Ubuntu 16.04

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

2reactions
zhangxiang958commented, Jan 11, 2019

@jchris @voodootikigod @mikeal @tobowers @simov @nylen Anyone know how to fixed this bug? or know what lead to this bug? i’m also had this bug in my server.

Any help will be appreciated!

0reactions
stale[bot]commented, Jun 4, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node.js getaddrinfo ENOTFOUND - Stack Overflow
Here is my code (practically copied and pasted from a very similar question, except with the host changed): var http = require("http"); var...
Read more >
http.get returns "getaddrinfo ENOTFOUND" error #5436 - GitHub
Hi all, I'm trying to fix following problem since five days. ... I can definitely say it's NOT a DNS or a PROXY...
Read more >
Node.js Error Message “getaddrinfo ENOTFOUND localhost ...
Here's what you need to do to get that server up and running! First enter this command in the terminal. sudo nano /etc/hosts....
Read more >
Getaddrinfo ENOTFOUND: Get a Premium Solution for the Error
The getaddrinfo ENOTFOUND error can be thrown due to invalid values provided to the options of the http.get() function or a missing line...
Read more >
Node applications on App Service Linux and getaddrinfo ...
Sometimes when making requests to external dependencies with Node applications, you may encounter an error showing “getaddrinfo ENOTOUND”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found