summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Rosen <aaronorosen@gmail.com>2014-06-02 14:37:30 -0700
committerMark McLoughlin <markmc@redhat.com>2014-07-18 07:19:20 +0100
commitfaf2b699b340634b904cdd8590b271b4b1862bf1 (patch)
tree3c6b714d14b399d3e72301fa1621a0f8bb61a64a
parentc21a2c22b355e79170d26abc9505ebe0e60aec35 (diff)
downloadoslo-messaging-faf2b699b340634b904cdd8590b271b4b1862bf1.tar.gz
Add check credentials to log message if rabbmitmq closes socket
If one has the credentials misconfigured for rabbitmq currently the following error message is shown: "AMQP server on 10.0.0.23:5672 is unreachable: Socket closed. Trying again in 1 seconds. " This is confusing because the problem is the login creditentials are wrong but the server can be reached. Since the rabbmitmq server allowed the initial connection and closed the socket it's likely an authenication issue. This patch now logs: "AMQP server 10.0.0.23:5672 closed the connection. Check login credentials: Socket closed" to hint the user that it could be a credential issue. Change-Id: Iadff35d88a9cf704c1edd2d5036a113966db3ea3 Closes-bug: 1325750 (cherry picked from commit bf281aace507dec7547e40f68d8cd7bb290dc903)
-rw-r--r--oslo/messaging/_drivers/impl_rabbit.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/oslo/messaging/_drivers/impl_rabbit.py b/oslo/messaging/_drivers/impl_rabbit.py
index 5b6cf03..fa2b767 100644
--- a/oslo/messaging/_drivers/impl_rabbit.py
+++ b/oslo/messaging/_drivers/impl_rabbit.py
@@ -611,9 +611,14 @@ class Connection(object):
sleep_time = min(sleep_time, self.interval_max)
log_info['sleep_time'] = sleep_time
- LOG.error(_('AMQP server on %(hostname)s:%(port)d is '
- 'unreachable: %(err_str)s. Trying again in '
- '%(sleep_time)d seconds.') % log_info)
+ if 'Socket closed' in six.text_type(e):
+ LOG.error(_('AMQP server %(hostname)s:%(port)d closed'
+ ' the connection. Check login credentials:'
+ ' %(err_str)s') % log_info)
+ else:
+ LOG.error(_('AMQP server on %(hostname)s:%(port)d is '
+ 'unreachable: %(err_str)s. Trying again in '
+ '%(sleep_time)d seconds.') % log_info)
time.sleep(sleep_time)
def ensure(self, error_callback, method, *args, **kwargs):