Advertisement
Guest User

Untitled

a guest
Oct 13th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.50 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2014-10-13 19:48:29.747840)
  2. Working directory: /opt/noc
  3. <type 'exceptions.AttributeError'>
  4. 'NoneType' object has no attribute 'default_collector'
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/pm/models/probeconfig.py (Line: 176)
  8. Function: get_collectors
  9. 169
  10. 170 @classmethod
  11. 171 def _refresh_object(cls, object):
  12. 172 def get_collectors(es):
  13. 173 c = collectors.get(es.probe.id)
  14. 174 if c:
  15. 175 return c
  16. 176 ==> c = es.probe.storage.default_collector
  17. 177 collectors[es.probe.id] = c
  18. 178 return c
  19. 179
  20. 180 def get_instance(probe, uuid):
  21. 181 ni = probe.n_instances
  22. 182 if ni < 1:
  23. Variables:
  24. c = None
  25. collectors = {}
  26. es =
  27. <noc.pm.models.effectivesettings.EffectiveSettings object at 0x813847c90>
  28. ------------------------------------------------------------------------
  29. File: /opt/noc/pm/models/probeconfig.py (Line: 228)
  30. Function: get_refresh_ops
  31. 221 "metrics": [{
  32. 222 "metric": m.metric,
  33. 223 "metric_type": m.metric_type.name,
  34. 224 "thresholds": m.thresholds,
  35. 225 "convert": m.convert,
  36. 226 "scale": m.scale,
  37. 227 "collectors": get_collectors(es)
  38. 228 ==> } for m in es.metrics]
  39. 229 }
  40. 230 }
  41. 231 )
  42. 232 for m, n in cls.PROFILES[object.__class__]:
  43. 233 for obj in m.objects.filter(**{n: o.id}):
  44. 234 get_refresh_ops(bulk, obj)
  45. Variables:
  46. model_id = u'inv.Interface'
  47. get_collectors = <function get_collectors at 0x8132e62a8>
  48. object = <Interface: bb-nmts: Gi0/0/1/4>
  49. m =
  50. EffectiveSettingsMetric(metric=u'object.bb-nmts.interface.gi0-0-1-4.interface.load.in', metric_type=<MetricType: Interface | Load | In>, thresholds=[None, None, None, None], convert='counter', scale=8)
  51. o = <Interface: bb-nmts: Gi0/0/1/4>
  52. bulk = <pymongo.bulk.BulkOperationBuilder object at 0x813384788>
  53. get_instance = <function get_instance at 0x8132e6410>
  54. get_refresh_ops = <function get_refresh_ops at 0x8132e6758>
  55. now = datetime.datetime(2014, 10, 13, 19, 48, 29, 722474)
  56. es =
  57. <noc.pm.models.effectivesettings.EffectiveSettings object at 0x813847c90>
  58. cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
  59. ------------------------------------------------------------------------
  60. File: /opt/noc/pm/models/probeconfig.py (Line: 241)
  61. Function: _refresh_object
  62. 234 get_refresh_ops(bulk, obj)
  63. 235
  64. 236 logger.debug("Refresh object %s", object)
  65. 237 collectors = {} # Storage rule -> collector url
  66. 238 # @todo: Make configurable
  67. 239 now = datetime.datetime.now()
  68. 240 bulk = cls._get_collection().initialize_ordered_bulk_op()
  69. 241 ==> get_refresh_ops(bulk, object)
  70. 242 bulk.execute()
  71. 243
  72. 244 @classmethod
  73. 245 def _refresh_config(cls, object):
  74. 246 def get_collectors(es):
  75. 247 c = collectors.get(es.probe.id)
  76. Variables:
  77. collectors = {}
  78. get_collectors = <function get_collectors at 0x8132e62a8>
  79. object = <Interface: bb-nmts: Gi0/0/1/4>
  80. bulk = <pymongo.bulk.BulkOperationBuilder object at 0x813384788>
  81. get_refresh_ops = <function get_refresh_ops at 0x8132e6758>
  82. now = datetime.datetime(2014, 10, 13, 19, 48, 29, 722474)
  83. get_instance = <function get_instance at 0x8132e6410>
  84. cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
  85. ------------------------------------------------------------------------
  86. File: /opt/noc/pm/models/probeconfig.py (Line: 389)
  87. Function: refresh
  88. 382 logger.debug("Refreshing %s", self.uuid)
  89. 383 o = self.get_object()
  90. 384 if not o:
  91. 385 return
  92. 386 if self.model_id == "pm.MetricConfig":
  93. 387 self._refresh_config(o)
  94. 388 else:
  95. 389 ==> self._refresh_object(o)
  96. 390
  97. 391 @classmethod
  98. 392 def rebuild(cls, model_id=None):
  99. 393 pass
  100. 394
  101. 395 ##
  102. Variables:
  103. self = <ProbeConfig: d22003e8-ec3d-53cd-8768-92509d462ef2>
  104. o = <Interface: bb-nmts: Gi0/0/1/4>
  105. ------------------------------------------------------------------------
  106. File: /opt/noc/pm/models/probeconfig.py (Line: 373)
  107. Function: on_change_probe
  108. 366 metric_sets__metric_set=document.id):
  109. 367 cls._refresh_object(ms.get_object())
  110. 368
  111. 369 @classmethod
  112. 370 def on_change_probe(cls, sender, document=None, *args, **kwargs):
  113. 371 logger.info("Applying changes to Probe '%s'", document.name)
  114. 372 for pc in ProbeConfig.objects.filter(probe_id=str(document.id)):
  115. 373 ==> pc.refresh()
  116. 374
  117. 375 @classmethod
  118. 376 def on_change_auth_profile(cls, sender, instance, *args, **kwargs):
  119. 377 logger.info("Applying changes to AuthProfile '%s'" % instance.name)
  120. 378 for mo in instance.managedobject_set.all():
  121. 379 cls._refresh_object(mo)
  122. Variables:
  123. sender = <class 'noc.pm.models.probe.Probe'>
  124. args = ()
  125. pc = <ProbeConfig: d22003e8-ec3d-53cd-8768-92509d462ef2>
  126. kwargs = {'created': False}
  127. document = <Probe: default>
  128. cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
  129. ------------------------------------------------------------------------
  130. File: /opt/noc/lib/python2.7/site-packages/blinker/base.py (Line: 267)
  131. Function: send
  132. 260 '%s given' % len(sender))
  133. 261 else:
  134. 262 sender = sender[0]
  135. 263 if not self.receivers:
  136. 264 return []
  137. 265 else:
  138. 266 return [(receiver, receiver(sender, **kwargs))
  139. 267 ==> for receiver in self.receivers_for(sender)]
  140. 268
  141. 269 def has_receivers_for(self, sender):
  142. 270 """True if there is probably a receiver for *sender*.
  143. 271
  144. 272 Performs an optimistic check only. Does not guarantee that all
  145. 273 weakly referenced receivers are still alive. See
  146. Variables:
  147. self = <blinker.base.NamedSignal object at 0x80d464890; 'post_save'>
  148. kwargs = {'document': <Probe: default>, 'created': False}
  149. sender = <class 'noc.pm.models.probe.Probe'>
  150. receiver =
  151. <bound method ?.on_change_probe of <class 'noc.pm.models.probeconfig.ProbeConfig'>>
  152. ------------------------------------------------------------------------
  153. File: /opt/noc/lib/python2.7/site-packages/mongoengine/document.py (Line: 301)
  154. Function: save
  155. 294 raise OperationError(message % unicode(err))
  156. 295 id_field = self._meta['id_field']
  157. 296 if id_field not in self._meta.get('shard_key', []):
  158. 297 self[id_field] = self._fields[id_field].to_python(object_id)
  159. 298
  160. 299 self._clear_changed_fields()
  161. 300 self._created = False
  162. 301 ==> signals.post_save.send(self.__class__, document=self, created=created)
  163. 302 return self
  164. 303
  165. 304 def cascade_save(self, *args, **kwargs):
  166. 305 """Recursively saves any references /
  167. 306 generic references on an objects"""
  168. 307 _refs = kwargs.get('_refs', []) or []
  169. Variables:
  170. removals = {}
  171. clean = True
  172. is_new_object = <function is_new_object at 0x8132c5e60>
  173. object_id = ObjectId('541302c1f3b6823af77a261b')
  174. select_dict = {'_id': ObjectId('541302c1f3b6823af77a261b')}
  175. last_error = {'updatedExisting': True, u'nModified': 0, u'ok': 1, u'n': 1}
  176. self = <Probe: default>
  177. kwargs = {}
  178. _refs = None
  179. shard_key = ()
  180. id_field = 'id'
  181. created = False
  182. cascade = False
  183. updates = {'storage': ObjectId('54152955f3b68243c5ec5b1c'), 'user': 15}
  184. cascade_kwargs = None
  185. doc =
  186. SON([('_id', ObjectId('541302c1f3b6823af77a261b')), ('name', u'default'), ('is_active', True), ('description', u''), ('storage', ObjectId('54152955f3b68243c5ec5b1c')), ('user', 15), ('n_instances', 8)])
  187. collection =
  188. Collection(Database(MongoClient('localhost', 27017), u'noc'), u'noc.pm.probe')
  189. validate = True
  190. force_insert = False
  191. update_query = {'$set': {'storage': ObjectId('54152955f3b68243c5ec5b1c'), 'user': 15}}
  192. write_concern = {'w': 1}
  193. ------------------------------------------------------------------------
  194. File: /opt/noc/lib/app/extdocapplication.py (Line: 320)
  195. Function: api_update
  196. 313 return HttpResponse("", status=self.NOT_FOUND)
  197. 314 if self.has_uuid and not attrs.get("uuid") and not o.uuid:
  198. 315 attrs["uuid"] = uuid.uuid4()
  199. 316 # @todo: Check for duplicates
  200. 317 for k in attrs:
  201. 318 if k != self.pk and "__" not in k:
  202. 319 setattr(o, k, attrs[k])
  203. 320 ==> o.save()
  204. 321 # Reread result
  205. 322 o = self.model.objects.get(**{self.pk: id})
  206. 323 if request.is_extjs:
  207. 324 r = {
  208. 325 "success": True,
  209. 326 "data": self.instance_to_dict(o)
  210. Variables:
  211. self = <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>
  212. request =
  213. <WSGIRequest
  214. path:/pm/probe/541302c1f3b6823af77a261b/,
  215. GET:<QueryDict: {}>,
  216. POST:<QueryDict: {}>,
  217. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  218. 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
  219. META:{'CONTENT_LENGTH': '147',
  220. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  221. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  222. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  223. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  224. 'HTTP_CONNECTION': 'close',
  225. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
  226. 'HTTP_DNT': '1',
  227. 'HTTP_HOST': 'noc',
  228. 'HTTP_REFERER': 'http://noc/main/desktop/',
  229. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  230. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  231. 'HTTP_X_SCHEME': 'http',
  232. 'PATH_INFO': u'/pm/probe/541302c1f3b6823af77a261b/',
  233. 'QUERY_STRING': '',
  234. 'REMOTE_ADDR': '127.0.0.1',
  235. 'REQUEST_METHOD': 'PUT',
  236. 'SCRIPT_NAME': u'',
  237. 'SERVER_NAME': 'noc',
  238. 'SERVER_PORT': '80',
  239. 'SERVER_PROTOCOL': 'HTTP/1.0',
  240. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f665d0>,
  241. 'wsgi.input': <_io.BytesIO object at 0x813282bf0>,
  242. 'wsgi.multiprocess': True,
  243. 'wsgi.multithread': False,
  244. 'wsgi.run_once': False,
  245. 'wsgi.url_scheme': 'http',
  246. 'wsgi.version': (1, 0)}>
  247. o = <Probe: default>
  248. id = u'541302c1f3b6823af77a261b'
  249. attrs =
  250. {'description': '',
  251. 'is_active': True,
  252. 'n_instances': 8,
  253. 'name': 'default',
  254. 'storage': <Storage: default>,
  255. 'user': <User: noc>}
  256. k = 'name'
  257. ------------------------------------------------------------------------
  258. File: /opt/noc/lib/app/site.py (Line: 246)
  259. Function: inner
  260. 239 for k, v in request.POST.lists())
  261. 240 elif request.method == "GET":
  262. 241 a = dict((k, v[0] if len(v) == 1 else v)
  263. 242 for k, v in request.GET.lists())
  264. 243 app_logger.debug("API %s %s %s",
  265. 244 request.method, request.path, a)
  266. 245 # Call handler
  267. 246 ==> r = v(request, *args, **kwargs)
  268. 247 # Dump SQL statements
  269. 248 if self.log_sql_statements:
  270. 249 from django.db import connections
  271. 250 tsc = 0
  272. 251 sc = defaultdict(int)
  273. 252 for conn in connections.all():
  274. Variables:
  275. args = ()
  276. view_map =
  277. {'DELETE': <bound method ProbeApplication.api_delete of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>,
  278. 'GET': <bound method ProbeApplication.api_read of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>,
  279. 'PUT': <bound method ProbeApplication.api_update of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>}
  280. Form = <class 'django.forms.forms.Form'>
  281. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  282. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  283. self = <noc.lib.app.site.Site object at 0x80d5127d0>
  284. v =
  285. <bound method ProbeApplication.api_update of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>
  286. request =
  287. <WSGIRequest
  288. path:/pm/probe/541302c1f3b6823af77a261b/,
  289. GET:<QueryDict: {}>,
  290. POST:<QueryDict: {}>,
  291. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  292. 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
  293. META:{'CONTENT_LENGTH': '147',
  294. 'CONTENT_TYPE': 'application/json; charset=UTF-8',
  295. 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  296. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  297. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  298. 'HTTP_CONNECTION': 'close',
  299. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
  300. 'HTTP_DNT': '1',
  301. 'HTTP_HOST': 'noc',
  302. 'HTTP_REFERER': 'http://noc/main/desktop/',
  303. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  304. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  305. 'HTTP_X_SCHEME': 'http',
  306. 'PATH_INFO': u'/pm/probe/541302c1f3b6823af77a261b/',
  307. 'QUERY_STRING': '',
  308. 'REMOTE_ADDR': '127.0.0.1',
  309. 'REQUEST_METHOD': 'PUT',
  310. 'SCRIPT_NAME': u'',
  311. 'SERVER_NAME': 'noc',
  312. 'SERVER_PORT': '80',
  313. 'SERVER_PROTOCOL': 'HTTP/1.0',
  314. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f665d0>,
  315. 'wsgi.input': <_io.BytesIO object at 0x813282bf0>,
  316. 'wsgi.multiprocess': True,
  317. 'wsgi.multithread': False,
  318. 'wsgi.run_once': False,
  319. 'wsgi.url_scheme': 'http',
  320. 'wsgi.version': (1, 0)}>
  321. app_logger = <logging.Logger object at 0x810ad9050>
  322. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  323. to_log_api_call = False
  324. kwargs = {'id': u'541302c1f3b6823af77a261b'}
  325. nq = <function nq at 0x8132c5de8>
  326. app = <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>
  327. ------------------------------------------------------------------------
  328. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement