Advertisement
Guest User

Untitled

a guest
Feb 28th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.12 KB | None | 0 0
  1. Working directory: /opt/noc
  2. <class 'bson.errors.InvalidStringData'>
  3. strings in documents must be valid UTF-8
  4. START OF TRACEBACK
  5. ------------------------------------------------------------------------
  6. File: /usr/lib/python2.6/site-packages/pymongo-2.0.1-py2.6-linux-i686.egg/pymongo/collection.py (Line: 283)
  7. Function: insert
  8. 276 if self.safe or kwargs:
  9. 277 safe = True
  10. 278 if not kwargs:
  11. 279 kwargs.update(self.get_lasterror_options())
  12. 280
  13. 281 self.__database.connection._send_message(
  14. 282 message.insert(self.__full_name, docs,
  15. 283 ==> check_keys, safe, kwargs), safe)
  16. 284
  17. 285 ids = [doc.get("_id", None) for doc in docs]
  18. 286 return return_one and ids[0] or ids
  19. 287
  20. 288 def update(self, spec, document, upsert=False, manipulate=False,
  21. 289 safe=False, multi=False, **kwargs):
  22. Variables:
  23. check_keys = True
  24. docs = [{'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
  25. '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
  26. 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\
  27. x06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}]
  28. doc = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
  29. '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
  30. 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
  31. 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
  32. self = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
  33. safe = True
  34. kwargs = {}
  35. return_one = True
  36. doc_or_docs = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
  37. '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
  38. 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
  39. 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
  40. manipulate = True
  41. ------------------------------------------------------------------------
  42.  
  43. ------------------------------------------------------------------------
  44. File: /usr/lib/python2.6/site-packages/pymongo-2.0.1-py2.6-linux-i686.egg/pymongo/collection.py (Line: 216)
  45. Function: save
  46. 209
  47. 210 .. mongodoc:: insert
  48. 211 """
  49. 212 if not isinstance(to_save, dict):
  50. 213 raise TypeError("cannot save object of type %s" % type(to_save))
  51. 214
  52. 215 if "_id" not in to_save:
  53. 216 ==> return self.insert(to_save, manipulate, safe, **kwargs)
  54. 217 else:
  55. 218 self.update({"_id": to_save["_id"]}, to_save, True,
  56. 219 manipulate, safe, **kwargs)
  57. 220 return to_save.get("_id", None)
  58. 221
  59. 222 def insert(self, doc_or_docs,
  60. Variables:
  61. to_save = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
  62. '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
  63. 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
  64. 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
  65. safe = True
  66. self = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
  67. manipulate = True
  68. kwargs = {}
  69. ------------------------------------------------------------------------
  70. File: /opt/noc/contrib/lib/mongoengine-0.5-py2.6.egg/mongoengine/document.py (Line: 159)
  71. Function: save
  72. 152 creation_mode = force_insert or not created
  73. 153 try:
  74. 154 collection = self.__class__.objects._collection
  75. 155 if creation_mode:
  76. 156 if force_insert:
  77. 157 object_id = collection.insert(doc, safe=safe, **write_options)
  78. 158 else:
  79. 159 ==> object_id = collection.save(doc, safe=safe, **write_options)
  80. 160 else:
  81. 161 object_id = doc['_id']
  82. 162 updates, removals = self._delta()
  83. 163 if updates:
  84. 164 collection.update({'_id': object_id}, {"$set": updates}, upsert=True, safe=safe, **write_options)
  85. 165 if removals:
  86. Variables:
  87. safe = True
  88. GenericReferenceField = <class 'mongoengine.fields.GenericReferenceField'>
  89. doc = {'timestamp': datetime.datetime(2012, 2, 28, 11, 8, 43), '_id': ObjectId('4f4c7d7b0d27975201041914'), 'raw_vars': {'source': 'syslog',
  90. '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
  91. 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
  92. 06\n(\xc4b\x01\x01\x02\x01\x02\x05\x00\x02\x01\x01', 'collector': '77.40.0.8:514'}, 'log': [], 'managed_object': 114}
  93. self = <NewEvent: None>
  94. created = False
  95. _refs = None
  96. creation_mode = True
  97. collection = Collection(Database(Connection('localhost', 27017), u'noc'), u'noc.events.new')
  98.  
  99. write_options = {}
  100. validate = True
  101. ReferenceField = <class 'mongoengine.fields.ReferenceField'>
  102. force_insert = False
  103. ------------------------------------------------------------------------
  104. File: /opt/noc/sa/sae/sae.py (Line: 268)
  105. Function: write_event
  106. 261 if (self.strip_syslog_severity and "source" in data
  107. 262 and data["source"] == "syslog" and "severity" in data):
  108. 263 del data["severity"]
  109. 264 NewEvent(
  110. 265 timestamp=timestamp,
  111. 266 managed_object=managed_object,
  112. 267 raw_vars=data,
  113. 268 ==> log=[]
  114. 269 ).save()
  115. 270
  116. 271 def on_stream_close(self, stream):
  117. 272 self.streams.unregister(stream)
  118. 273
  119. 274 def get_activator_stream(self, name, for_script=False):
  120. Variables:
  121. timestamp = datetime.datetime(2012, 2, 27, 15, 4, 19)
  122. self = <noc.sa.sae.sae.SAE object at 0x9aac60c>
  123. 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
  124. 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
  125. \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'}
  126. managed_object = <ManagedObject: AGG-annikova-1>
  127. ------------------------------------------------------------------------
  128. File: /opt/noc/sa/sae/service.py (Line: 270)
  129. Function: event
  130. 263 return
  131. 264 else:
  132. 265 mo = None
  133. 266 # Write event to database
  134. 267 self.sae.write_event(
  135. 268 data=[(b.key, b.value) for b in request.body],
  136. 269 timestamp=datetime.datetime.fromtimestamp(request.timestamp),
  137. 270 ==> managed_object=mo
  138. 271 )
  139. 272 done(controller, EventResponse())
  140. 273
  141. 274 def pm_data(self, controller, request, done):
  142. 275 """
  143. 276 Handle RPC pm_data request
  144. Variables:
  145. b = <noc.sa.protocols.sae_pb2.EventBodyItem object at 0x9fd5f5c>
  146. mo = <ManagedObject: AGG-annikova-1>
  147. request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
  148. controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
  149. done = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
  150. activator = <Activator: noc>
  151. self = <noc.sa.sae.service.Service object at 0x9aacbec>
  152. ------------------------------------------------------------------------
  153.  
  154. self = <noc.sa.sae.service.Service object at 0x9aacbec>
  155. ------------------------------------------------------------------------
  156. File: /opt/noc/contrib/lib/protobuf-2.4.1-py2.6.egg/google/protobuf/service_reflection.py (Line: 171)
  157. Function: _CallMethod
  158. 164 request: Request protocol message.
  159. 165 callback: A callback to invoke after the method has completed.
  160. 166 """
  161. 167 if method_descriptor.containing_service != self.descriptor:
  162. 168 raise RuntimeError(
  163. 169 'CallMethod() given method descriptor for wrong service type.')
  164. 170 method = getattr(srvc, method_descriptor.name)
  165. 171 ==> return method(rpc_controller, request, callback)
  166. 172
  167. 173 def _GetRequestClass(self, method_descriptor):
  168. 174 """Returns the class of the request protocol message.
  169. 175
  170. 176 Args:
  171. 177 method_descriptor: Descriptor of the method for which to return the
  172. Variables:
  173. srvc = <noc.sa.sae.service.Service object at 0x9aacbec>
  174. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
  175. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x8c768cc>
  176. request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
  177. rpc_controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
  178. callback = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
  179. method = <bound method Service.event of <noc.sa.sae.service.Service object at 0x9aacbec>>
  180. ------------------------------------------------------------------------
  181. File: /opt/noc/contrib/lib/protobuf-2.4.1-py2.6.egg/google/protobuf/service_reflection.py (Line: 146)
  182. Function: _WrapCallMethod
  183. 139
  184. 140 # CallMethod needs to operate with an instance of the Service class. This
  185. 141 # internal wrapper function exists only to be able to pass the service
  186. 142 # instance to the method that does the real CallMethod work.
  187. 143 def _WrapCallMethod(srvc, method_descriptor,
  188. 144 rpc_controller, request, callback):
  189. 145 return self._CallMethod(srvc, method_descriptor,
  190. 146 ==> rpc_controller, request, callback)
  191. 147 self.cls = cls
  192. 148 cls.CallMethod = _WrapCallMethod
  193. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  194. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  195. 151 cls.GetRequestClass = self._GetRequestClass
  196. 152 cls.GetResponseClass = self._GetResponseClass
  197. Variables:
  198. rpc_controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
  199. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
  200. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x8c768cc>
  201. request = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
  202. srvc = <noc.sa.sae.service.Service object at 0x9aacbec>
  203. callback = <bound method SAESocket.send_response of <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>>
  204. ------------------------------------------------------------------------
  205. File: /opt/noc/sa/rpc.py (Line: 416)
  206. Function: rpc_handle_request
  207. 409 req.ParseFromString(request.serialized_request)
  208. 410 logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  209. 411 controller = Controller(self)
  210. 412 controller.transaction = self.transactions.begin(id=id,
  211.  
  212. 412 controller.transaction = self.transactions.begin(id=id,
  213. 413 method=request.method)
  214. 414 try:
  215. 415 self.service.CallMethod(method, controller,
  216. 416 ==> req, self.send_response)
  217. 417 except:
  218. 418 self.send_error(id, ERR_INTERNAL,
  219. 419 "RPC Call to %s failed" % request.method)
  220. 420 error_report()
  221. 421 else:
  222. 422 self.send_error(id, ERR_INVALID_METHOD,
  223. Variables:
  224. self = <noc.sa.sae.sae_socket.SAESocket object at 0x9ab248c>
  225. req = <noc.sa.protocols.sae_pb2.EventRequest object at 0x9fd5fbc>
  226. request = <noc.sa.protocols.sae_pb2.Request object at 0x9d78b0c>
  227. id = 1956481684L
  228. controller = <noc.sa.rpc.Controller object at 0xb6645e8c>
  229. method = <google.protobuf.descriptor.MethodDescriptor object at 0x8c767ec>
  230. ------------------------------------------------------------------------
  231. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement