Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RabbitMQ 3.5.6 Could not establish TCP connection to any of the configured hosts (Bunny::TCPConnectionFailedForAllHosts)

I'm trying to connect to RabbitMQ server but always got these errors:

W, [2015-12-08T15:38:01.993251 #37405]  WARN -- #<Bunny::Session:0x7fe07b894f78 guest@localhost:5672, vhost=/dev_prod, addresses=[localhost:5672]>: An empty frame was received while opening the connection. In RabbitMQ <= 3.1 this could mean an authentication issue.

And

.../.rvm/gems/ruby-2.1.2/gems/bunny-2.2.0/lib/bunny/session.rb:315:in `rescue in start': Could not establish TCP connection to any of the configured hosts (Bunny::TCPConnectionFailedForAllHosts)

I'm using Ruby 2.1.2, RabbitMQ 3.5.6 on MAC OS. Sorry I'm the newbie in RabbitMQ, just trying to use it but cant handle the issue. Please give me some advises.

like image 365
BBaoBao Avatar asked Nov 20 '22 21:11

BBaoBao


1 Answers

this is probably becuase you either did not pass username and password or passed wrong ones.

The defaults are guest and guest both for username and password.

Try to initialize the connection like this:

 conn = Bunny.new(host:  'localhost',
                  port:  '5672',
                  vhost: '/',
                  user:  'guest',
                  pass:  'guest')
 conn.start

and see what happens

like image 72
beniutek Avatar answered Nov 27 '22 02:11

beniutek