The connection was reset using RabbitMQ

924 views
Skip to first unread message

Mariana M

unread,
Aug 4, 2016, 9:36:57 AM8/4/16
to rabbitmq-users

Helo,

I am really new at rabbitmq. I was trying to establish a rabbitmq router and send him a HelloWorld in python using pika.

In terminal i do sudo rabbitmq-server start. I can enter localhost:15672. But when i try to connect to localhost:5672 appears "AMQP" for one second and then "The connection was reset".

When doing sudo rabbitmqctl list_connections, my connection doesn't appear. When doing netstat -tapnl | grep 5672 it appears this:


tcp
0 0 0.0.0.0:15672 0.0.0.0:* LISTEN -
tcp
0 0 127.0.0.1:5672 0.0.0.0:* LISTEN -
tcp
0 0 0.0.0.0:25672 0.0.0.0:* LISTEN -


My python is giving the error ProbableAccessDeniedError, but I have configured all right i think. Here is a snipet:


import pika
from pika.exceptions import ProbableAccessDeniedError
from pika.exceptions import ProbableAuthenticationError


if __name__ == '__main__':

 credentials
= pika.PlainCredentials('name', 'pass')
 
# change the ip in here!
 parameters
= pika.ConnectionParameters(
 host
='localhost', port=5672, vhost='test', credentials=credentials)
 
try:
 connection
= pika.BlockingConnection(parameters)

 channel
= connection.channel()

 channel
.basic_publish(exchange='',
 routing_key
='hello',
 body
='Hello World!')
 
print(" [x] Sent 'Hello World!'")

 
except ProbableAuthenticationError:
 
print("Authetication Error")
 
except ProbableAccessDeniedError:
 
print("Authetication Denied")
 
finally:
 
if channel:
 channel
.close()
 
if connection:
 connection
.close()


And here is my rabbitmq.co

% /etc/rabbitmq/rabbitmq.config
[
 
{rabbit, [
     
% Network Connectivity
     
% ====================
   
{tcp_listeners,[{"127.0.0.1",5672}]},
   
{num_tcp_acceptors, 5},
   
{handshake_timeout, 10000},
   
% Default User / VHost
   
% ====================
   
{default_vhost,       <<"test">>},
   
{default_user,        <<"name">>},
   
{default_pass,        <<"pass">>},
   
{default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
   
{loopback_users, []}
 
]}
].




So I guess the problem is because of the localhost:5672. Any idea?

171

Michael Klishin

unread,
Aug 4, 2016, 9:44:04 AM8/4/16
to rabbitm...@googlegroups.com
We cannot suggest anything with the amount of information provided, see server logs.

Are you sure you want to override default_vhost, default_user, default_pass
and default_permissions? What's the idea with that?

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To post to this group, send email to rabbitm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Mariana M

unread,
Aug 4, 2016, 10:10:10 AM8/4/16
to rabbitmq-users
This is what the log shows:

=INFO REPORT==== 4-Aug-2016::14:54:01 ===
accepting AMQP connection
<0.10771.1> (127.0.0.1:59246 -> 127.0.0.1:5672)

=ERROR REPORT==== 4-Aug-2016::14:54:01 ===
closing AMQP connection
<0.10771.1> (127.0.0.1:59246 -> 127.0.0.1:5672):
{bad_header,<<"GET / HT">>}

About the permissions i was just trying different ones from guest to see if it would work.
Thanks
238

Michael Klishin

unread,
Aug 4, 2016, 10:17:15 AM8/4/16
to rabbitm...@googlegroups.com, Mariana M
You attempt to use an HTTP client on port 5672, which is supposed
to be used by AMQP 0-9-1 and AMQP 1.0 clients.

HTTP API port is 15672 by default.

On 4 August 2016 at 07:10:19, Mariana M (mrrv...@gmail.com) wrote:
> This is what the log shows:
>
> =INFO REPORT==== 4-Aug-2016::14:54:01 ===
> accepting AMQP connection <0.10771.1> (127.0.0.1:59246 -> 127.0.0.1:5672)
>
> =ERROR REPORT==== 4-Aug-2016::14:54:01 ===
> closing AMQP connection <0.10771.1> (127.0.0.1:59246 -> 127.0.0.1:5672):
> {bad_header,<<"GET / HT">>}
>
> About the permissions i was just trying different ones from guest to see if
> it would work.
> Thanks
>
> On Thursday, 4 August 2016 13:44:04 UTC, Michael Klishin wrote:
> >
> > We cannot suggest anything with the amount of information provided, see
> > server logs.
> >
> > Are you sure you want to override default_vhost, default_user, default_pass
> > and default_permissions? What's the idea with that?
> >
> > On Thu, Aug 4, 2016 at 6:36 AM, Mariana M
> To post to this group, send an email to rabbitm...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages