Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Node 4 #15

Closed
julien-f opened this issue Oct 15, 2015 · 3 comments
Closed

Issue with Node 4 #15

julien-f opened this issue Oct 15, 2015 · 3 comments

Comments

@julien-f
Copy link

It works correctly with process.nextTick(), setImmediate(), setTimeout(), even errors originating from fs.readFile() but not with http.request().

require('trace')

var request = require('http').request

function main () {
  request({ hostname: '0.0.0.1' }, response => {
    response.pipe(process.stdout)
  })
}

main()
> node index.js
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: connect EINVAL 0.0.0.1:80 - Local (0.0.0.0:0)
    at Object.exports._errnoException (util.js:837:11)
    at exports._exceptionWithHostPort (util.js:860:20)
    at connect (net.js:838:14)
    at net.js:934:9
    at doNTCallback0 (node.js:407:9)
    at process._tickCallback (node.js:336:13)
    at Function.Module.runMain (module.js:477:11)
    at startup (node.js:117:18)
    at node.js:951:3
    at fireErrorCallbacks (net.js:444:15)

As you can see, the stack trace does not reference my code :/

@AndreasMadsen
Copy link
Owner

Most likely it is caused by nodejs/node#3241 - I will verify it later.

@AndreasMadsen
Copy link
Owner

It is your stack trace limit there is too short.

This is the full stack trace:


Error: connect EHOSTUNREACH 0.0.0.1:80 - Local (10.0.1.5:53093)
    at Object.exports._errnoException (util.js:874:11)
    at exports._exceptionWithHostPort (util.js:897:20)
    at connect (net.js:838:14)
    at net.js:934:9
    at doNTCallback0 (node.js:417:9)
    at process._tickCallback (node.js:346:13)
    at Function.Module.runMain (module.js:459:11)
    at startup (node.js:134:18)
    at node.js:961:3
    at fireErrorCallbacks (net.js:444:15)
    at Socket._destroy (net.js:480:3)
    at connect (net.js:839:10)
    at net.js:934:9
    at doNTCallback0 (node.js:417:9)
    at process._tickCallback (node.js:346:13)
    at Function.Module.runMain (module.js:459:11)
    at startup (node.js:134:18)
    at node.js:961:3
    at lookupAndConnect (net.js:932:13)
    at Socket.connect (net.js:901:5)
    at Agent.exports.connect.exports.createConnection (net.js:63:35)
    at Agent.createSocket (_http_agent.js:174:16)
    at Agent.addRequest (_http_agent.js:143:23)
    at new ClientRequest (_http_client.js:136:16)
    at exports.request (http.js:31:10)
    at main (/scripts/regression-http-bad-connect.js:6:3)
    at Object.<anonymous> (/scripts/regression-http-bad-connect.js:11:1) <-- here is your stuff
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:134:18)
    at node.js:961:3

@julien-f
Copy link
Author

Yes, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants