2013-09-19 14:06:28,523 UNHANDLED EXCEPTION (2013-09-19 14:06:28.482462)
Working directory: /opt/noc
<class 'bson.errors.InvalidStringData'>
strings in documents must be valid UTF-8: 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.'
START OF TRACEBACK
------------------------------------------------------------------------
File: /opt/noc/lib/python2.6/site-packages/pymongo/collection.py (Line: 362)
Function: insert
355 if manipulate:
356 docs = [self.__database._fix_incoming(doc, self) for doc in docs]
357
358 safe, options = self._get_write_mode(safe, **kwargs)
359 message._do_batched_insert(self.__full_name, docs,
360 check_keys, safe, options,
361 continue_on_error, self.__uuid_subtype,
362 ==> self.database.connection)
363
364 ids = [doc.get("_id", None) for doc in docs]
365 if return_one:
366 return ids[0]
367 else:
368 return ids
Variables:
safe = True
check_keys = True
docs =
[{'_id': ObjectId('523acca4e1382305ccc89fdb'),
'log': [],
'managed_object': 432,
'raw_vars': {'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'},
'timestamp': datetime.datetime(2013, 9, 19, 14, 6, 27)}]
doc =
{'_id': ObjectId('523acca4e1382305ccc89fdb'),
'log': [],
'managed_object': 432,
'raw_vars': {'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'},
'timestamp': datetime.datetime(2013, 9, 19, 14, 6, 27)}
self =
Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
kwargs = {}
continue_on_error = False
return_one = True
doc_or_docs =
{'_id': ObjectId('523acca4e1382305ccc89fdb'),
'log': [],
'managed_object': 432,
'raw_vars': {'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'},
'timestamp': datetime.datetime(2013, 9, 19, 14, 6, 27)}
options = {}
manipulate = True
------------------------------------------------------------------------
File: /opt/noc/lib/python2.6/site-packages/pymongo/collection.py (Line: 266)
Function: save
259
260 .. mongodoc:: insert
261 """
262 if not isinstance(to_save, dict):
263 raise TypeError("cannot save object of type %s" % type(to_save))
264
265 if "_id" not in to_save:
266 ==> return self.insert(to_save, manipulate, safe, check_keys, **kwargs)
267 else:
268 self.update({"_id": to_save["_id"]}, to_save, True,
269 manipulate, safe, check_keys=check_keys, **kwargs)
270 return to_save.get("_id", None)
271
272 def insert(self, doc_or_docs, manipulate=True,
Variables:
check_keys = True
self =
Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
safe = True
to_save =
{'_id': ObjectId('523acca4e1382305ccc89fdb'),
'log': [],
'managed_object': 432,
'raw_vars': {'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'},
'timestamp': datetime.datetime(2013, 9, 19, 14, 6, 27)}
kwargs = {}
manipulate = True
------------------------------------------------------------------------
File: /opt/noc/lib/python2.6/site-packages/mongoengine/document.py (Line: 199)
Function: save
192
193 try:
194 collection = self.__class__.objects._collection
195 if created:
196 if force_insert:
197 object_id = collection.insert(doc, safe=safe, **write_options)
198 else:
199 ==> object_id = collection.save(doc, safe=safe, **write_options)
200 else:
201 object_id = doc['_id']
202 updates, removals = self._delta()
203
204 # Need to add shard key to query, or you get an error
205 select_dict = {'_id': object_id}
Variables:
safe = True
created = True
doc =
{'_id': ObjectId('523acca4e1382305ccc89fdb'),
'log': [],
'managed_object': 432,
'raw_vars': {'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'},
'timestamp': datetime.datetime(2013, 9, 19, 14, 6, 27)}
self = <NewEvent: None>
force_insert = False
_refs = None
collection =
Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
cascade = None
cascade_kwargs = None
write_options = {}
validate = True
------------------------------------------------------------------------
File: /opt/noc/sa/sae/sae.py (Line: 228)
Function: write_event
221 if (self.strip_syslog_severity and "source" in data
222 and data["source"] == "syslog" and "severity" in data):
223 del data["severity"]
224 NewEvent(
225 timestamp=timestamp,
226 managed_object=managed_object,
227 raw_vars=data,
228 ==> log=[]
229 ).save()
230
231 def on_stream_close(self, stream):
232 self.streams.unregister(stream)
233
234 def get_activator_stream(self, name, for_script=False,
Variables:
timestamp = datetime.datetime(2013, 9, 19, 14, 6, 27)
self = <noc.sa.sae.sae.SAE object at 0x7fecfb446dd0>
data =
{'collector': '88.147.128.54:1514',
'message': 'Sep 19 14:06:27 10.64.134.142 Sep 19 2013 10:06:27 fsw-8-Lenina-117\xe0-0-kln %%01MSTP/6/RECEIVE_MSTITC(l)[45027]:MSTP received BPDU with TC, MSTP process 0 instance 0, port name is GigabitEthernet0/0/2.',
'source': 'syslog'}
managed_object = <ManagedObject: 10.64.134.142>
------------------------------------------------------------------------
File: /opt/noc/sa/sae/service.py (Line: 261)
Function: event
254 return
255 else:
256 mo = None
257 # Write event to database
258 self.sae.write_event(
259 data=[(b.key, b.value) for b in request.body],
260 timestamp=datetime.datetime.fromtimestamp(request.timestamp),
261 ==> managed_object=mo
262 )
263 done(controller, EventResponse())
264
265 def object_status(self, controller, request, done):
266 """
267 Handle RPC object_status request
Variables:
b = <noc.sa.protocols.sae_pb2.EventBodyItem object at 0x3eefde0>
mo = <ManagedObject: 10.64.134.142>
request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x25efdec0>
controller = <noc.sa.rpc.Controller object at 0x16d079d0>
done =
<bound method SAESocket.send_response of <SAESocket(0x30a5490, connected)>>
self = <noc.sa.sae.service.Service object at 0x2a74b50>
------------------------------------------------------------------------
File: /opt/noc/lib/python2.6/site-packages/google/protobuf/service_reflection.py (Line: 171)
Function: _CallMethod
164 request: Request protocol message.
165 callback: A callback to invoke after the method has completed.
166 """
167 if method_descriptor.containing_service != self.descriptor:
168 raise RuntimeError(
169 'CallMethod() given method descriptor for wrong service type.')
170 method = getattr(srvc, method_descriptor.name)
171 ==> return method(rpc_controller, request, callback)
172
173 def _GetRequestClass(self, method_descriptor):
174 """Returns the class of the request protocol message.
175
176 Args:
177 method_descriptor: Descriptor of the method for which to return the
Variables:
srvc = <noc.sa.sae.service.Service object at 0x2a74b50>
method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1685150>
self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1685290>
request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x25efdec0>
rpc_controller = <noc.sa.rpc.Controller object at 0x16d079d0>
callback =
<bound method SAESocket.send_response of <SAESocket(0x30a5490, connected)>>
method =
<bound method Service.event of <noc.sa.sae.service.Service object at 0x2a74b50>>
------------------------------------------------------------------------
File: /opt/noc/lib/python2.6/site-packages/google/protobuf/service_reflection.py (Line: 146)
Function: _WrapCallMethod
139
140 # CallMethod needs to operate with an instance of the Service class. This
141 # internal wrapper function exists only to be able to pass the service
142 # instance to the method that does the real CallMethod work.
143 def _WrapCallMethod(srvc, method_descriptor,
144 rpc_controller, request, callback):
145 return self._CallMethod(srvc, method_descriptor,
146 ==> rpc_controller, request, callback)
147 self.cls = cls
148 cls.CallMethod = _WrapCallMethod
149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
151 cls.GetRequestClass = self._GetRequestClass
152 cls.GetResponseClass = self._GetResponseClass
Variables:
rpc_controller = <noc.sa.rpc.Controller object at 0x16d079d0>
method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1685150>
self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1685290>
request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x25efdec0>
srvc = <noc.sa.sae.service.Service object at 0x2a74b50>
callback =
<bound method SAESocket.send_response of <SAESocket(0x30a5490, connected)>>
------------------------------------------------------------------------
File: /opt/noc/sa/rpc.py (Line: 416)
Function: rpc_handle_request
409 req.ParseFromString(request.serialized_request)
410 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
411 controller = Controller(self)
412 controller.transaction = self.transactions.begin(id=id,
413 method=request.method)
414 try:
415 self.service.CallMethod(method, controller,
416 ==> req, self.send_response)
417 except:
418 self.send_error(id, ERR_INTERNAL,
419 "RPC Call to %s failed" % request.method)
420 error_report()
421 else:
422 self.send_error(id, ERR_INVALID_METHOD,
Variables:
self = <SAESocket(0x30a5490, connected)>
req = <noc.sa.protocols.sae_pb2.EventRequest object at 0x25efdec0>
request = <noc.sa.protocols.sae_pb2.Request object at 0x25efd1a0>
id = 1441838555
controller = <noc.sa.rpc.Controller object at 0x16d079d0>
method = <google.protobuf.descriptor.MethodDescriptor object at 0x1685150>
------------------------------------------------------------------------
END OF TRACEBACK