-
Notifications
You must be signed in to change notification settings - Fork 7.3k
ECONNREFUSED in the debugger #9216
Comments
Can you provide additional details, like code that reproduces it, or specific commands that were run? |
Sure, here's a snippet from my debugging session.
(Of course, the file I'm trying to break on doesn't exist.) I'm on Windows, which I guess probably matters. Let me know if there's anything I can do to help further debug this. |
I'm having this same issue as the OP. Node 12, on Windows. I'll have to see if I can create some sample code from what I have, but I wanted to second the issue. |
The same issue for me on node@0.12.0 |
I tried the code below on BOTH Windows 7 and Mac Snow Leopard and I received the same error with Node.js 0.12.0 Response from Node.js command prompt
Code
|
got the same issue on node@0.12.0 |
same symptom in my unit test; line 220. Happens on both windows and linux. node@0.12.2 etc var server = httpServer.createServer({
root: root,
mimeType: 'fixtures/root/mime.types'
});
server.listen(8083, '127.0.0.1', this.callback);
// this.callback ->
function () {
// give http-server an extra second before requesting
// to not get ECONNREFUSED
var cb = this.callback.bind(this);
setTimeout(function () {
request('http://127.0.0.1:8083/mime.test', cb);
}, 1000);
} source: https://github.com/dotnetCarpenter/http-server/blob/ecstatic/test/http-server-test.js#L156 Note, that starting the server with above options and then do the request outside the vows tests works just fine. |
Same for node@0.12.3 |
I'm on 0.12.4 on OSX, seeing a similar error when running an example from RabbitMQ library. ECONNREFUSED when attempting to start a listener on port 8080. There are no listeners present on that port when I run edit: ok I was being dumb -- the example was trying to connect to a rabbitmq server on localhost and just throwing up a very cryptic error message. The example won't work without a rabbitmq server running, duh. |
ECONNREFUSED is an error kitchen sink. Perhaps a better error message could be provided? |
same issue. /Users/ajinkya.bo/projects/nodeauth/node_modules/mongoose/node_modules/mongodb/lib/server.js:228 at TCPConnectWrap.afterConnect as oncompleteEDIT: I forgot to run |
@steelx I'm betting that Mongo isn't listening on the port/server combination that you specified. Can you isolate by testing it with RoboMongo or something? |
@jcollum omg sorry. Yes, i forgot to run mongod service. on mac |
Maybe it might be helpful if it gave a actual line number corresponding to the function that throws the error. I do not like the express generator because it messes up any line number or errors. I don't know where server.js is or what 200 line means, the error was thrown in app.js.... sorry for the vent but I too forgot to run mongod too -_-..... |
In my case problem occures when remote service isn't online, can't response or whatever else. But problem is that timeout doesn't works correctly at this point and whole app crashes. I got ECONNREFUSED and ETIMEDOUT, same like guy here: my code:
result when api.mojang doesn't responding:
when I put there req.setTimeout with req.abort() before req.end(), error changes in to:
In both cases App crashes. |
I feel like Ben Nidal (I can't remember the name of the guy, but that's close and he has a great blog) or someone needs to write a big ol' blog post about tracking down the source for ECONNREFUSED errors. |
omg, whole problem was in port @#! few days ago it works correctly with 443, now it works only sometimes. When I removed port from options it works correctly everytime. |
@udaiveerS Unfortunately, line numbers in the Error class has not been standardized and V8 does not natively support line numbers when errors are thrown. But |
One point is error handling and reporting, but other point is the fact that one wrong used port in request can crash whole node app. :( |
@mwkaicz I don't know what to answer to that... It's a fundamental thing about networking. Any app would crash if you're using the wrong port. How would that even work if an app was allowed to use a port that another app is using. Sounds like that would be a huge security hole. |
@dotnetCarpenter: Sorry, but I think that some error report that port is used, doesn't responding or what ever else is better than crash whole app. I don't remember if I have ever seen some browser crash when server on requested port doesn't responds. |
Hi, this problem occur when the server stopped, you have to run node server in a terminal, and open another terminal and launch the other file. |
The text was updated successfully, but these errors were encountered: