Opened 9 years ago

Closed 9 years ago

#4503 closed defect (fixed)

TorBEL does not catch ErrorReply

Reported by: aagbsn Owned by:
Priority: Medium Milestone:
Component: Core Tor/TorDNSEL Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


Traceback (most recent call last):
  File "/home/torbel/tor/TorCtl/", line 712, in _eventLoop
    self._handleFn(timestamp, reply)
  File "/home/torbel/tor/TorCtl/", line 1337, in _handle1
    self._map1.get(event.event_name, self.unknown_event)(event)
  File "/home/torbel/tor/torbel/", line 852, in stream_status_event
    self.conn.close_stream(event.strm_id, reason = 7)
  File "/home/torbel/tor/TorCtl/", line 1196, in close_stream
    %(streamid, reason, "".join(flags)))
  File "/home/torbel/tor/TorCtl/", line 868, in sendAndRecv
    raise ErrorReply("%s %s"%(tp, msg), status = code, message = msg)
ErrorReply: 552 Unknown stream "2432"

It looks like we just need to catch the ErrorReply.

Child Tickets

Change History (3)

comment:1 Changed 9 years ago by Sebastian

Summary: TorBEL does not catchTorBEL does not catch ErrorReply

comment:2 Changed 9 years ago by aagbsn

Status: newneeds_review

diff --git a/ b/
index fe6dbf7..b94c79e 100644
--- a/
+++ b/
@@ -853,6 +853,12 @@ class Controller(TorCtl.EventHandler):
                 except TorCtl.TorCtlClosed:
                     # Bail if we closed.
+                except TorCtl.ErrorReply, e:
+                    # We can receive "552 Unknown stream" if Tor pukes on the stream
+                    # before we actually receive the event and use it.
+                    log.error("(%s, %d): Error attaching stream!",
+                              router.nickname, event.target_port)  
+                    return
                 if narrow:
                     self.narrow(stream.router, event.target_port)

comment:3 Changed 9 years ago by Sebastian

Resolution: fixed
Status: needs_reviewclosed

merged, thanks!

Note: See TracTickets for help on using tickets.