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

Already on GitHub? Sign in to your account

Connect fails with EADDRNOTAVAIL #125

goloroden opened this Issue Sep 3, 2012 · 1 comment


None yet
1 participant

Steps to reproduce:

  • Create a Node.js application
  • Add node-amqp as dependency
  • Create a connection using var connection = amqp.createConnection({ url: MYURL }); where MYURL has been replaced with a valid url (local, remote ... doesn't matter).
  • Call connection.connect();

Expected result:

  • An established connection

Actual result:

  • The Node.js application crashes with the following error message:
        throw arguments[1]; // Unhandled 'error' event
Error: connect EADDRNOTAVAIL
    at errnoException (net.js:782:11)
    at connect (net.js:652:19)
    at Connection.Socket.connect (net.js:688:5)
    at Connection.Socket.connect (net.js:663:37)
    at foo (/Users/golo/foo.js:14:16)

where foo.js:14:16 specifies the line where connection.connect(); is called.


  • Node 0.8.4 / Node 0.8.8
  • node-amqp 0.1.3

Additional findings:

  • The same thing happens when you specify the connection string in parts instead of a combined url.
  • It happens with a locally installed RabbitMQ.
  • It happens with a hosted RabbitMQ instance on Heroku.
  • From that I conclude that it's not the server or the url, but the client (in this case node-amqp) that fails.

I solved it: It works if you do NOT call connect (which, at least from my point of view, makes absolutely no sense).

Why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment