Opened 9 years ago

Closed 9 years ago

#262 closed defect (fixed)

xfrout fails

Reported by: jelte Owned by: UnAssigned
Priority: high Milestone: 05. 3rd Incremental Release: Serious Secondary
Component: xfrout Version:
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity:
Sub-Project: Feature Depending on Ticket:
Estimated Difficulty: Add Hours to Ticket:
Total Hours: Internal?:

Description

With the recent merge into trunk (logging, ticket #176), xfrout stopped working. When you try to request an AXFR for a zone that's in the data source, you get a number of exceptions:

----------------------------------------
Exception happened during processing of request from b''
Traceback (most recent call last):
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 180, in dns_xfrout_start
    self._log.log_message("info", "transfer of '%s/IN': AXFR started" % zone_name)
AttributeError: 'XfroutSession' object has no attribute '_log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 78, in handle
    self.dns_xfrout_start(sock, msgdata)
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 184, in dns_xfrout_start
    self._log.log_message("error", str(err))
AttributeError: 'XfroutSession' object has no attribute '_log'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.1/socketserver.py", line 558, in process_request_thread
    self.finish_request(request, client_address)
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 293, in finish_request
    self.RequestHandlerClass(request, client_address, self, self._log)
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 61, in __init__
    BaseRequestHandler.__init__(self, request, client_address, server)
  File "/usr/lib/python3.1/socketserver.py", line 614, in __init__
    self.handle()
  File "/home/jelte/repos/bind10/trunk/src/bin/xfrout/b10-xfrout", line 80, in handle
    self._log.log_message("error", str(e))
AttributeError: 'XfroutSession' object has no attribute '_log'
----------------------------------------

Subtickets

Change History (3)

comment:1 Changed 9 years ago by jelte

this fixes it:

Index: src/bin/xfrout/xfrout.py.in
===================================================================
--- src/bin/xfrout/xfrout.py.in	(revision 2343)
+++ src/bin/xfrout/xfrout.py.in	(working copy)
@@ -58,8 +58,8 @@
 
 class XfroutSession(BaseRequestHandler):
     def __init__(self, request, client_address, server, log):
+        self._log = log
         BaseRequestHandler.__init__(self, request, client_address, server)
-        self._log = log
 
     def handle(self):
         fd = recv_fd(self.request.fileno())

It would seem that the initializer for the superclass already results in calls being made that need the _log value to be set, so setting it before calling the superclass fixes it.

comment:2 Changed 9 years ago by jelte

  • Owner set to UnAssigned
  • Status changed from new to reviewing

comment:3 Changed 9 years ago by zhanglikun

  • Resolution set to fixed
  • Status changed from reviewing to closed

The patch for this ticket has been committed in r2349. so close this ticket.

Note: See TracTickets for help on using tickets.