Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConnectionClosed.__repr__ raised IndexError #432

Closed
vitaly-krugl opened this issue Jan 17, 2014 · 1 comment
Closed

ConnectionClosed.__repr__ raised IndexError #432

vitaly-krugl opened this issue Jan 17, 2014 · 1 comment

Comments

@vitaly-krugl
Copy link
Member

Using pika master @ 24c3f1d

class ConnectionClosed(AMQPConnectionError):
    def __repr__(self):
        return 'The AMQP connection was closed (%s) %s' % (self.args[0],
                                                           self.args[1])

Raised:

2014-01-16 01:36:13 [1751] [CRITICAL] Attempted to send frame when closed
2014-01-16 01:36:13 [1751] [CRITICAL] Attempted to send frame when closed
Traceback (most recent call last):
  File "/opt/numenta/anaconda/lib/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/opt/numenta/anaconda/lib/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/opt/numenta/anaconda/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/opt/numenta/anaconda/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
  File "/opt/numenta/nta/eng/lib/python2.7/site-packages/pika/exceptions.py", line 56, in __repr__
    return 'The AMQP connection was closed (%s) %s' % (self.args[0],
IndexError: tuple index out of range
gmr added a commit that referenced this issue Feb 17, 2014
Conditionally include the close reason if it's included
@gmr gmr closed this as completed Feb 17, 2014
@corford
Copy link

corford commented Mar 13, 2014

Re-opening as I'm getting the same IndexError if I purposefully use invalid credentials to connect to the server (this is with a BlockingConnection, haven't tried it with anything else).

The ConnectionClosed exception is triggered but this is what's raised:

No handlers could be found for logger "pika.adapters.base_connection"
Traceback (most recent call last):
  File "/srv/python/2.7.6/lib/python2.7/logging/__init__.py", line 851, in emit
    msg = self.format(record)
  File "/srv/python/2.7.6/lib/python2.7/logging/__init__.py", line 724, in format
    return fmt.format(record)
  File "/srv/python/2.7.6/lib/python2.7/logging/__init__.py", line 464, in format
    record.message = record.getMessage()
  File "/srv/python/2.7.6/lib/python2.7/logging/__init__.py", line 328, in getMessage
    msg = msg % self.args
  File "/home/corford/venvs/lchargent/lchargent_ci_worker/lib/python2.7/site-packages/pika/exceptions.py", line 53, in __repr__
    return 'The AMQP connection was closed (%s) %s' % (self.args[0],
IndexError: tuple index out of range

I'm using sys.exc_info() to pull the exception info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants