(Migrated) AMQP Issues

(This message has been automatically imported from the retired mailing list)

Hello,

On zato 1.1, I had running a couple of services using amqp, 2 producers =
and 1 consumer, they were working fine, until Today when I was changing =
the queue names, I=92ve been struggling for hours with this, and it =
doesn=92t work anymore, I=92ve created an empty queue and it is not =
working, here the settings I=92m using to define a connection:

 	Name	Host	Port	Virtual host	Username	=

Max frame size Heartbeat interval =20
localhost localhost 5672 / ivan =
131072 0 Change password Edit Delete
and this is the channel

 	Name	Active	Definition	Queue	Consumer tag =

prefix Service =20
localhost Yes localhost zato_test =
zato.test zato.ping Edit Delete
now after I finish entering the channel the following is thrown in the =
logs:

2014-09-17 20:50:33,884 - ERROR - 923:Thread-4 - ConsumingConnection:22 =

  • No connection for localhost:5672/ (zato_test), e:[Traceback (most =
    recent call last):
    File =
    "/opt/zato/1.1/zato-server/src/zato/server/connection/init.py", line =
    115, in start
    self._start()
    File =
    "/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
    line 56, in _start
    self.conn.ioloop.start()
    File =
    "/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
    py", line 102, in start
    self.poller.start()
    File =
    "/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
    py", line 390, in start
    self.poll()
    File =
    "/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
    py", line 445, in poll
    self._handler(fileno, event, write_only=3Dwrite_only)
    File =
    "/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
    ", line 294, in _handle_events
    self._handle_read()
    File =
    "/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
    ", line 318, in _handle_read
    self._on_data_available(data)
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
    line 1148, in _on_data_available
    self._process_frame(frame_value)
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
    line 1214, in _process_frame
    if self._process_callbacks(frame_value):
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
    line 1183, in _process_callbacks
    frame_value) # Args
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, line =
    61, in wrapper
    return function(*tuple(args), **kwargs)
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, line =
    92, in wrapper
    return function(*args, **kwargs)
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, line =
    232, in process
    callback(*args, **keywords)
    File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/channel.py”, line =
    957, in _on_openok
    self._on_openok_callback(self)
    File =
    "/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
    line 43, in _on_channel_open
    self.consume()
    File =
    "/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
    line 58, in consume
    _consumer_tag_prefix, gethostbyname(gethostname()), getfqdn(),
    gaierror: [Errno -2] Name or service not known
    ]

if I change the put a badd password I receive this:

2014-09-17 21:16:45,734 - ERROR - 14040:Thread-3 - zato.server.base:22 - =
Could not handle broker msg:[Bunch(action=3Du’10503’, id=3D18L, =
msg_type=3Du’0005’, name=3Du’localhost’, password=3Du’badpassword’, =
password1=3Du’badpassword’, password2=3Du’badpassword’, salt=3DNone)], =
e:[Traceback (most recent call last):
File “/opt/zato/1.1/zato-server/src/zato/server/base/init.py”, =
line 48, in on_broker_msg
getattr(self, handler)(msg)
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 160, in on_broker_msg_DEFINITION_AMQP_CHANGE_PASSWORD
self._recreate()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 166, in _recreate
getattr(self, recreate_func)()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 134, in _recreate_consumer
self._stop_amqp_connection()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 165, in _stop_amqp_connection
self.channel_amqp.consumer.close()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/init.py", line =
87, in close
self._close()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 63, in _close
self.conn.close()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 86, in close
super(BaseConnection, self).close(reply_code, reply_text)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 600, in close
self._on_close_ready()
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1038, in _on_close_ready
self._send_connection_close(self.closing[0], self.closing[1])
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1311, in _send_connection_close
self._on_connection_closed, [spec.Connection.CloseOk])
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1301, in _rpc
self._send_method(channel_number, method_frame)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1366, in _send_method
self._send_frame(frame.Method(channel_number, method_frame))
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1353, in _send_frame
self._flush_outbound()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
py", line 41, in _flush_outbound
self.ioloop.poller._manage_event_state()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 358, in _manage_event_state
self.ioloop.update_handler(self.socket.fileno(),
AttributeError: ‘NoneType’ object has no attribute ‘fileno’
]

I=92ve tested my local connection with the following test script:

#!/usr/bin/env python
import pika

credentials =3D pika.PlainCredentials(
‘ivan’,
=91123’)

connection =3D pika.BlockingConnection(pika.ConnectionParameters(
host=3D’localhost’,
credentials=3Dcredentials))

channel =3D connection.channel()

channel.queue_declare(queue=3D’zato_test’)

print ’ [*] Waiting for messages. To exit press CTRL+C’

def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)

channel.basic_consume(callback,
queue=3D’zato_test’,
no_ack=3DTrue)

channel.start_consuming()

I=92ve also tried restarting zato, restarting the server where zato is =
running but nothing is working, as I said the weirdest thing is that I =
have this already working for almost 2 weeks without a problem and now I =
donnt know what else to try.=

I was able to overcome this issue, by adding the hostname to /etc/hosts, =
I don=92t know why, in my tests the only domain I=92ve used is =
localhost, all the external connections were made using ip, and I don=92t =
understand why the hosts has anything to do with this issue, but I=92ve =
added the hostname ip to /etc/hosts, and it started to work again, the =
odd thing is that it was working fine for 2 weeks.

On Sep 17, 2014, at 9:21 PM, Ivan Villareal ivaano@gmail.com wrote:

Hello,
=20
On zato 1.1, I had running a couple of services using amqp, 2 =
producers and 1 consumer, they were working fine, until Today when I was =
changing the queue names, I=92ve been struggling for hours with this, =
and it doesn=92t work anymore, I=92ve created an empty queue and it is =
not working, here the settings I=92m using to define a connection:
=20
=20
=20
Name Host Port Virtual host Username =
Max frame size Heartbeat interval =20
localhost localhost 5672 / ivan =
131072 0 Change password Edit Delete
and this is the channel
=20
Name Active Definition Queue Consumer tag =
prefix Service =20
localhost Yes localhost zato_test =
zato.test zato.ping Edit Delete
now after I finish entering the channel the following is thrown in the =
logs:
=20
=20
2014-09-17 20:50:33,884 - ERROR - 923:Thread-4 - =
ConsumingConnection:22 - No connection for localhost:5672/ (zato_test), =
e:[Traceback (most recent call last):
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/init.py", line =
115, in start
self._start()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 56, in _start
self.conn.ioloop.start()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
py", line 102, in start
self.poller.start()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
py", line 390, in start
self.poll()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
py", line 445, in poll
self._handler(fileno, event, write_only=3Dwrite_only)
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 294, in _handle_events
self._handle_read()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 318, in _handle_read
self._on_data_available(data)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1148, in _on_data_available
self._process_frame(frame_value)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1214, in _process_frame
if self._process_callbacks(frame_value):
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1183, in _process_callbacks
frame_value) # Args
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, =
line 61, in wrapper
return function(*tuple(args), **kwargs)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, =
line 92, in wrapper
return function(*args, **kwargs)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/callback.py”, =
line 232, in process
callback(*args, **keywords)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/channel.py”, =
line 957, in _on_openok
self._on_openok_callback(self)
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 43, in _on_channel_open
self.consume()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 58, in consume
_consumer_tag_prefix, gethostbyname(gethostname()), getfqdn(),
gaierror: [Errno -2] Name or service not known
]
=20
if I change the put a badd password I receive this:
=20
2014-09-17 21:16:45,734 - ERROR - 14040:Thread-3 - zato.server.base:22 =

  • Could not handle broker msg:[Bunch(action=3Du’10503’, id=3D18L, =
    msg_type=3Du’0005’, name=3Du’localhost’, password=3Du’badpassword’, =
    password1=3Du’badpassword’, password2=3Du’badpassword’, salt=3DNone)], =
    e:[Traceback (most recent call last):

File “/opt/zato/1.1/zato-server/src/zato/server/base/init.py”, =
line 48, in on_broker_msg
getattr(self, handler)(msg)
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 160, in on_broker_msg_DEFINITION_AMQP_CHANGE_PASSWORD
self._recreate()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 166, in _recreate
getattr(self, recreate_func)()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 134, in _recreate_consumer
self._stop_amqp_connection()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/channel.py", =
line 165, in _stop_amqp_connection
self.channel_amqp.consumer.close()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/init.py", line =
87, in close
self._close()
File =
"/opt/zato/1.1/zato-server/src/zato/server/connection/amqp/init.py", =
line 63, in _close
self.conn.close()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 86, in close
super(BaseConnection, self).close(reply_code, reply_text)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 600, in close
self._on_close_ready()
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1038, in _on_close_ready
self._send_connection_close(self.closing[0], self.closing[1])
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1311, in _send_connection_close
self._on_connection_closed, [spec.Connection.CloseOk])
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1301, in _rpc
self._send_method(channel_number, method_frame)
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1366, in _send_method
self._send_frame(frame.Method(channel_number, method_frame))
File “/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/connection.py”, =
line 1353, in _send_frame
self._flush_outbound()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/select_connection.=
py", line 41, in _flush_outbound
self.ioloop.poller._manage_event_state()
File =
"/opt/zato/1.1/eggs/pika-0.9.12-py2.7.egg/pika/adapters/base_connection.py=
", line 358, in _manage_event_state
self.ioloop.update_handler(self.socket.fileno(),
AttributeError: ‘NoneType’ object has no attribute ‘fileno’
]
=20
I=92ve tested my local connection with the following test script:
=20
#!/usr/bin/env python
import pika
=20
credentials =3D pika.PlainCredentials(
‘ivan’,
=91123’)
=20
connection =3D pika.BlockingConnection(pika.ConnectionParameters(
host=3D’localhost’,
credentials=3Dcredentials))
=20
channel =3D connection.channel()
=20
channel.queue_declare(queue=3D’zato_test’)
=20
print ’ [*] Waiting for messages. To exit press CTRL+C’
=20
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
=20
channel.basic_consume(callback,
queue=3D’zato_test’,
no_ack=3DTrue)
=20
channel.start_consuming()
=20
=20
I=92ve also tried restarting zato, restarting the server where zato is =
running but nothing is working, as I said the weirdest thing is that I =
have this already working for almost 2 weeks without a problem and now I =
donnt know what else to try.