Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2014-09-18 21:10:06,253 [noc.lib.nbsocket.basesocket] [ActivatorSocket 127.0.0.1:19701] Unhandled exception when calling <bound method ActivatorSocket.handle_read of <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>>
- 2014-09-18 21:10:06,262 [noc.lib.debug] UNHANDLED EXCEPTION (2014-09-18 21:10:06.253511)
- Working directory: /opt/noc
- <type 'exceptions.AttributeError'>
- 'TrapCollector' object has no attribute 'logger'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/basesocket.py (Line: 173)
- Function: info
- 166 Emit info-level log message.
- 167
- 168 :param msg: Message
- 169 :type msg: str
- 170 """
- 171 warnings.warn("Using deprecated Socket.info() method",
- 172 DeprecationWarning, stacklevel=2)
- 173 ==> self.logger.info(msg)
- 174
- 175 def error(self, msg):
- 176 """
- 177 Emit error-level log message.
- 178
- 179 :param msg: Message
- Variables:
- msg = 'Initializing at 0.0.0.0:162'
- self = <TrapCollector(0x80a229e10, init)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/trap_collector.py (Line: 35)
- Function: __init__
- 28 "oid": "value"
- 29 ....
- 30 }
- 31 """
- 32 name = "TrapCollector"
- 33
- 34 def __init__(self, activator, address, port, log_traps=False):
- 35 ==> self.info("Initializing at %s:%s" % (address, port))
- 36 self.collector_signature = "%s:%s" % (address, port)
- 37 self.log_traps = log_traps
- 38 ListenUDPSocket.__init__(self, activator.factory, address, port)
- 39 EventCollector.__init__(self, activator)
- 40
- 41 def on_read(self, whole_msg, address, port):
- Variables:
- activator = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- log_traps = True
- port = 162
- self = <TrapCollector(0x80a229e10, init)>
- address = '0.0.0.0'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 291)
- Function: start_trap_collectors
- 284 logging.info("Using pysnmp trap parser")
- 285 from noc.sa.activator.pysnmp_trap_collector import TrapCollector
- 286 log_traps = self.config.getboolean("main", "log_snmp_traps")
- 287 self.trap_collectors = [
- 288 TrapCollector(self, ip, port, log_traps)
- 289 for ip, port
- 290 in self.resolve_addresses(
- 291 ==> self.config.get("activator", "listen_traps"), 162)
- 292 ]
- 293
- 294 def stop_trap_collectors(self):
- 295 """
- 296 Stop SNMP Trap Collectors
- 297 """
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- ip = '0.0.0.0'
- log_traps = True
- port = 162
- TrapCollector = <class 'noc.sa.activator.trap_collector.TrapCollector'>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 263)
- Function: on_ESTABLISHED_enter
- 256 to_refresh_filters = self.to_ping
- 257 self.next_mappings_update = None
- 258 self.scripts_processed = 0
- 259 self.scripts_failed = 0
- 260 # Check does our instance is designated to listen
- 261 if self.to_listen:
- 262 if self.config.get("activator", "listen_traps"):
- 263 ==> self.start_trap_collectors()
- 264 to_refresh_filters = True
- 265 if self.config.get("activator", "listen_syslog"):
- 266 self.start_syslog_collectors()
- 267 to_refresh_filters = True
- 268 if self.config.get("activator", "listen_pm_data"):
- 269 self.start_pm_data_collectors()
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- to_refresh_filters = False
- ------------------------------------------------------------------------
- File: /opt/noc/lib/fsm.py (Line: 78)
- Function: call_state_handler
- 71 return getattr(self, name)
- 72 except:
- 73 return None
- 74
- 75 def call_state_handler(self, state, event, *args):
- 76 h = self.get_state_handler(state, event)
- 77 if h:
- 78 ==> apply(h, args)
- 79
- 80 def get_state(self):
- 81 return self._current_state
- 82
- 83 def set_state(self, state):
- 84 if state == self._current_state:
- Variables:
- h =
- <bound method Activator.on_ESTABLISHED_enter of <noc.sa.activator.activator.Activator object at 0x807e8ee50>>
- state = 'ESTABLISHED'
- args = ()
- event = 'enter'
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/fsm.py (Line: 94)
- Function: set_state
- 87 if state not in self.STATES:
- 88 raise FSMStateError(state)
- 89 if self._current_state:
- 90 self.call_state_handler(self._current_state, "exit")
- 91 self._current_state = state
- 92 self._state_enter_time = time.time()
- 93 self._state_exit_time = None
- 94 ==> self.call_state_handler(state, "enter")
- 95
- 96 def set_timeout(self, timeout):
- 97 self.debug("set_timeout(%s)" % timeout)
- 98 self._state_exit_time = time.time() + timeout
- 99
- 100 ##
- Variables:
- state = 'ESTABLISHED'
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/fsm.py (Line: 108)
- Function: event
- 101 ## Send event to FSM
- 102 ##
- 103 def event(self, event):
- 104 self.debug("event(%s)" % event)
- 105 if event not in self.STATES[self._current_state]:
- 106 raise FSMEventError(self._current_state, event)
- 107 self.call_state_handler(self._current_state, event)
- 108 ==> self.set_state(self.STATES[self._current_state][event])
- 109
- 110 def tick(self):
- 111 """
- 112 Method should be called in event loop every second
- 113 to process timeout and tick events
- 114 """
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- event = 'establish'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 562)
- Function: auth_callback
- 555 if self.get_state() != "REGISTRED":
- 556 return
- 557 if error:
- 558 logging.error("Authentication failed: %s" % error.text)
- 559 self.event("error")
- 560 return
- 561 logging.info("Authenticated")
- 562 ==> self.event("establish")
- 563 name = self.config.get("activator", "name")
- 564 logging.info("Authenticating as %s" % name)
- 565 r = AuthRequest(
- 566 name=name,
- 567 digest=get_digest(name,
- 568 self.config.get("activator", "secret"),
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x807e8ee50>
- transaction = <noc.sa.rpc.Transaction object at 0x80a229690>
- response = <noc.sa.protocols.sae_pb2.AuthResponse object at 0x8083ac910>
- error = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 98)
- Function: commit
- 91 self.factory = factory
- 92 self.id = id
- 93 self.method = method
- 94 self.callback = callback
- 95
- 96 def commit(self, response=None, error=None):
- 97 if self.callback:
- 98 ==> self.callback(self, response, error)
- 99 self.factory.delete_transaction(self.id)
- 100
- 101 def rollback(self, error):
- 102 self.commit(error=error)
- 103
- 104
- Variables:
- self = <noc.sa.rpc.Transaction object at 0x80a229690>
- response = <noc.sa.protocols.sae_pb2.AuthResponse object at 0x8083ac910>
- error = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 442)
- Function: rpc_handle_response
- 435 logging.error("Invalid transaction: %s" % id)
- 436 return
- 437 t = self.transactions[id]
- 438 method = self.service.GetDescriptor().FindMethodByName(t.method)
- 439 if method:
- 440 res = self.service.GetResponseClass(method)()
- 441 res.ParseFromString(response.serialized_response)
- 442 ==> t.commit(response=res)
- 443 else:
- 444 logging.error("Invalid method: %s" % t.method)
- 445 t.rollback()
- 446
- 447 def rpc_handle_error(self, id, error):
- 448 logging.debug("rpc_handle_error:\nid: %s\n%s" % (id, str(error)))
- Variables:
- res = <noc.sa.protocols.sae_pb2.AuthResponse object at 0x8083ac910>
- self = <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>
- response = <noc.sa.protocols.sae_pb2.Response object at 0x8083ac6e0>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x8071e0490>
- t = <noc.sa.rpc.Transaction object at 0x80a229690>
- id = 252240631
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 405)
- Function: on_read
- 398 self.stat_rpc_errors += 1
- 399 self.rpc_handle_error(msg.id, msg.error)
- 400 elif msg.request.ByteSize():
- 401 self.stat_rpc_requests += 1
- 402 self.rpc_handle_request(msg.id, msg.request)
- 403 elif msg.response.ByteSize():
- 404 self.stat_rpc_responses += 1
- 405 ==> self.rpc_handle_response(msg.id, msg.response)
- 406
- 407 def rpc_handle_request(self, id, request):
- 408 logging.debug("rpc_handle_request: %s" % request.method)
- 409 if id in self.transactions:
- 410 self.send_error(id, ERR_TRANSACTION_EXISTS,
- 411 "Transaction %s is already exists" % id)
- Variables:
- msg = <noc.sa.protocols.sae_pb2.Message object at 0x8083ac590>
- self = <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>
- data = '\x08\xf7\xc5\xa3x\x1a\x02\n\x00'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/protocols/base.py (Line: 34)
- Function: feed
- 27 completed PDU.
- 28
- 29 :param data: Raw data portion
- 30 :type data: str
- 31 """
- 32 self.in_buffer += data
- 33 for pdu in self.parse_pdu():
- 34 ==> self.callback(pdu)
- 35
- 36 def parse_pdu(self):
- 37 """
- 38 Scan self.in_buffer, detect all completed PDUs, then remove
- 39 them from buffer and return as list or yield them
- 40
- Variables:
- pdu = '\x08\xf7\xc5\xa3x\x1a\x02\n\x00'
- data = '\x00\x00\x00\t\x08\xf7\xc5\xa3x\x1a\x02\n\x00'
- self = <noc.sa.rpc.RPCProtocol object at 0x80a218150>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/connectedtcpsocket.py (Line: 87)
- Function: handle_read
- 80 return
- 81 raise socket.error, why
- 82 if not data:
- 83 self.close()
- 84 return
- 85 self.update_status()
- 86 if self.protocol_class:
- 87 ==> self.protocol.feed(data)
- 88 else:
- 89 self.on_read(data)
- 90
- 91 def handle_write(self):
- 92 if not self.is_connected:
- 93 try:
- Variables:
- self = <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>
- data = '\x00\x00\x00\t\x08\xf7\xc5\xa3x\x1a\x02\n\x00'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 95)
- Function: guarded_socket_call
- 88 Wrapper for safe call of socket method. Handles and reports
- 89 socket errors.
- 90
- 91 :return: Call status
- 92 :rtype: Bool
- 93 """
- 94 try:
- 95 ==> method()
- 96 except Exception:
- 97 exc = get_socket_error()
- 98 try:
- 99 if exc:
- 100 socket.on_error(exc)
- 101 else:
- Variables:
- self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x80722cb90>
- socket = <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>
- exc = None
- method =
- <bound method ActivatorSocket.handle_read of <ActivatorSocket(0x8083d6e90, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement