Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Connect fails with EADDRNOTAVAIL #125

Open
goloroden opened this Issue · 1 comment

1 participant

@goloroden

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:
events.js:66
        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.

Environment:

  • 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.
@goloroden

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
Something went wrong with that request. Please try again.