Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Working directory: /opt/noc
- <class 'bson.errors.InvalidStringData'>
- strings in documents must be valid UTF-8
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /usr/lib/python2.6/site-packages/pymongo-2.0.1-py2.6-linux-i686.egg/pymongo/collection.py (Line: 283)
- Function: insert
- 276 if self.safe or kwargs:
- 277 safe = True
- 278 if not kwargs:
- 279 kwargs.update(self.get_lasterror_options())
- 280
- 281 self.__database.connection._send_message(
- 282 message.insert(self.__full_name, docs,
- 283 ==> check_keys, safe, kwargs), safe)
- 284
- 285 ids = [doc.get("_id", None) for doc in docs]
- 286 return return_one and ids[0] or ids
- 287
- 288 def update(self, spec, document, upsert=False, manipulate=False,
- 289 safe=False, multi=False, **kwargs):
- Variables:
- check_keys = True
- docs = [{'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
- 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x02\x01\x01C\x04T\xf8oD0D0\x0f\x06\n(\xc4b\x
- 01\x01\x02\x01\x02\x02\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\
- x06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}]
- doc = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
- 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x02\x01\x01C\x04T\xf8oD0D0\x0f\x06\n(\xc4b\x0
- 1\x01\x02\x01\x02\x02\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\x
- 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
- self = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
- safe = True
- kwargs = {}
- return_one = True
- doc_or_docs = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
- 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x02\x01\x01C\x04T\xf8oD0D0\x0f\x06\n(\xc4b\x0
- 1\x01\x02\x01\x02\x02\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\x
- 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
- manipulate = True
- ------------------------------------------------------------------------
- ------------------------------------------------------------------------
- File: /usr/lib/python2.6/site-packages/pymongo-2.0.1-py2.6-linux-i686.egg/pymongo/collection.py (Line: 216)
- Function: save
- 209
- 210 .. mongodoc:: insert
- 211 """
- 212 if not isinstance(to_save, dict):
- 213 raise TypeError("cannot save object of type %s" % type(to_save))
- 214
- 215 if "_id" not in to_save:
- 216 ==> return self.insert(to_save, manipulate, safe, **kwargs)
- 217 else:
- 218 self.update({"_id": to_save["_id"]}, to_save, True,
- 219 manipulate, safe, **kwargs)
- 220 return to_save.get("_id", None)
- 221
- 222 def insert(self, doc_or_docs,
- Variables:
- to_save = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
- 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x02\x01\x01C\x04T\xf8oD0D0\x0f\x06\n(\xc4b\x0
- 1\x01\x02\x01\x02\x02\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\x
- 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
- safe = True
- self = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
- manipulate = True
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/mongoengine-0.5-py2.6.egg/mongoengine/document.py (Line: 159)
- Function: save
- 152 creation_mode = force_insert or not created
- 153 try:
- 154 collection = self.__class__.objects._collection
- 155 if creation_mode:
- 156 if force_insert:
- 157 object_id = collection.insert(doc, safe=safe, **write_options)
- 158 else:
- 159 ==> object_id = collection.save(doc, safe=safe, **write_options)
- 160 else:
- 161 object_id = doc['_id']
- 162 updates, removals = self._delta()
- 163 if updates:
- 164 collection.update({'_id': object_id}, {"$set": updates}, upsert=True, safe=safe, **write_options)
- 165 if removals:
- Variables:
- safe = True
- GenericReferenceField = <class 'mongoengine.fields.GenericReferenceField'>
- doc = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
- 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x02\x01\x01C\x04T\xf8oD0D0\x0f\x06\n(\xc4b\x0
- 1\x01\x02\x01\x02\x02\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\x
- 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
- self = <NewEvent: None>
- created = False
- _refs = None
- creation_mode = True
- collection = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
- write_options = {}
- validate = True
- ReferenceField = <class 'mongoengine.fields.ReferenceField'>
- force_insert = False
- ------------------------------------------------------------------------
- File: /opt/noc/sa/sae/sae.py (Line: 268)
- Function: write_event
- 261 if (self.strip_syslog_severity and "source" in data
- 262 and data["source"] == "syslog" and "severity" in data):
- 263 del data["severity"]
- 264 NewEvent(
- 265 timestamp=timestamp,
- 266 managed_object=managed_object,
- 267 raw_vars=data,
- 268 ==> log=[]
- 269 ).save()
- 270
- 271 def on_stream_close(self, stream):
- 272 self.streams.unregister(stream)
- 273
- 274 def get_activator_stream(self, name, for_script=False):
- Variables:
- timestamp = datetime.datetime(2012, 2, 27, 15, 4, 19)
- self = <noc.sa.sae.sae.SAE object at 0x9aac60c>
- data = {'source': 'syslog', 'message': '0v\x02\x01\x00\x04\x0eAGG-annikova-1\xa4a\x06\x07(\xc4b\x01\x01\x02\x00@\x04\n\xc8\xd2\r\x02\x01\x06\x
- 02\x01\x01C\x04T\x8a/\xd40D0\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x02\x00\x02\x01\x010\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x03\x00\x02\x01\x000\x0f\x06\n(\xc4b
- \x01\x01\x02\x01\x02\x04\x00\x02\x01\x000\x0f\x06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x00', 'collector': '77.40.0.8:514'}
- managed_object = <ManagedObject: AGG-annikova-1>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/sae/service.py (Line: 270)
- Function: event
- 263 return
- 264 else:
- 265 mo = None
- 266 # Write event to database
- 267 self.sae.write_event(
- 268 data=[(b.key, b.value) for b in request.body],
- 269 timestamp=datetime.datetime.fromtimestamp(request.timestamp),
- 270 ==> managed_object=mo
- 271 )
- 272 done(controller, EventResponse())
- 273
- 274 def pm_data(self, controller, request, done):
- 275 """
- 276 Handle RPC pm_data request
- Variables:
- b = <noc.sa.protocols.sae_pb2.EventBodyItem object at 0x9fd5f5c>
- mo = <ManagedObject: AGG-annikova-1>
- request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
- controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
- done = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
- activator = <Activator: noc>
- self = <noc.sa.sae.service.Service object at 0x9aacbec>
- ------------------------------------------------------------------------
- self = <noc.sa.sae.service.Service object at 0x9aacbec>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/protobuf-2.4.1-py2.6.egg/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 0x9aacbec>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x8c768cc>
- request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
- rpc_controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
- callback = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
- method = <bound method Service.event of <noc.sa.sae.service.Service object at 0x9aacbec>>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/protobuf-2.4.1-py2.6.egg/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 0xb6645e8c>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x8c768cc>
- request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
- srvc = <noc.sa.sae.service.Service object at 0x9aacbec>
- callback = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
- ------------------------------------------------------------------------
- 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,
- 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 = <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>
- req = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x9d78b0c>
- id = 1956481684L
- controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement