Fallback code corrupts the output

Bug #859545 reported by Julian Edwards
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-oops-twisted
Fix Released
High
Robert Collins

Bug Description

2011-09-26 11:36:06+0100 [Uninitialized] L o g g e d O O P S i d O O P S - 2 0 9 5 L O N G P O L L 2 : C o n n e c t i o n R e f u s e d E r r o r : C o n n e c t i o n w a s r e f u s e d b y o t h e r s i d e : 1 1 1 : C o n n e c t i o n r e f u s e d .

There's extra spaces in there.

Related branches

Changed in python-oops-twisted:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Robert Collins (lifeless) wrote :

Thats bizarre - we have a test (test_failure_fallback) that checks that there are not.

> /home/robertc/source/launchpad/oops-twisted/working/oops_twisted/tests/test_log.py(126)test_failure_fallback()
-> expected_event = {
(Pdb) print expected_message
Logged OOPS id 33: ValueError: exception message
(Pdb) print type(expected_message), repr(expected_message)
<type 'unicode'> u'Logged OOPS id 33: ValueError: exception message'
(Pdb)

Are you able to reproduce at will ? If so, can you put a breakpoint in log.py where it creates event['message'] and have a poke at what is happening?

I'm inclined to suspect something ffffunky in twisted's failure object.

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Yep - grab the txlongpoll egg, build it, and then run it without rabbit running like this:
bin/twistd amqp-longpoll -l mylog -u guest -a guest -f 9999 -r .

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Or, you can use an incorrect password:
bin/twistd -n amqp-longpoll -l mylog -u guest -a guest1 -f 9999 -r .

Revision history for this message
Robert Collins (lifeless) wrote :

memo to self - release is at https://launchpad.net/txlongpoll

Revision history for this message
Robert Collins (lifeless) wrote :

Ok, I'm setup,
running:
bin/txlongpoll -n amqp-longpoll -l mylog -u guest -a guest -f 9999 -r .

results in oopses:
ls 2011-09-28/29385.LONGPOLL9
2011-09-28/29385.LONGPOLL9
robertc@lifeless-64:~/source/launchpad/txlongpoll/working$ cat 2011-09-28/29385.LONGPOLL9
Oops-Id: OOPS-2097LONGPOLL9
Exception-Type: ConnectionRefusedError
Exception-Value: Connection was refused by other side: 111: Connection refused.
Date: 2011-09-28T08:09:45.316516+00:00

Connection failed
Traceback (most recent call last):
Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

and the log shows:
2011-09-28 21:09:45+1300 [-] Starting factory <txlongpoll.client.AMQFactory instance at 0x22a9d40>
2011-09-28 21:09:45+1300 [Uninitialized] <twisted.internet.tcp.Connector instance at 0x22b1248> will retry in 16 seconds
2011-09-28 21:09:45+1300 [Uninitialized] Connection failed
        Traceback (most recent call last):
        Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

2011-09-28 21:09:45+1300 [Uninitialized] Stopping factory <txlongpoll.client.AMQFactory instance at 0x22a9d40>
^C2011-09-28 21:09:47+1300 [-] Received SIGINT, shutting down.
2011-09-28 21:09:47+1300 [-] (TCP Port 9999 Closed)
2011-09-28 21:09:47+1300 [-] Stopping factory <twisted.web.server.Site instance at 0x22a9e18>
2011-09-28 21:09:47+1300 [-] Main loop terminated.
2011-09-28 21:09:47+1300 [-] Server Shut Down.

which isn't logging the oops, so I think bug 860490 is preventing analysis of this one.

Revision history for this message
Robert Collins (lifeless) wrote :

nope, its getting formatted just fine.

ah, but textFromEventDict() is producing:
 'L o g g e d O O P S i d O O P S - 2 0 9 7 L O N G P O L L 1 0 : C o n n e c t i o n R e f u s e d E r r o r : C o n n e c t i o n w a s r e f u s e d b y o t h e r s i d e : 1 1 1 : C o n n e c t i o n r e f u s e d .'

so this at least gives us a handle on it.

Revision history for this message
Robert Collins (lifeless) wrote :

and this is the cause:
text = ' '.join(map(reflect.safe_str, edm))

in the twisted code: the message needs to be a sequence of messages, even though that is deprecated.

Revision history for this message
Robert Collins (lifeless) wrote :

yup, trivial fix sorts it.

Changed in python-oops-twisted:
assignee: nobody → Robert Collins (lifeless)
Changed in python-oops-twisted:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.