Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2014-10-13 19:48:29.747840)
- Working directory: /opt/noc
- <type 'exceptions.AttributeError'>
- 'NoneType' object has no attribute 'default_collector'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/pm/models/probeconfig.py (Line: 176)
- Function: get_collectors
- 169
- 170 @classmethod
- 171 def _refresh_object(cls, object):
- 172 def get_collectors(es):
- 173 c = collectors.get(es.probe.id)
- 174 if c:
- 175 return c
- 176 ==> c = es.probe.storage.default_collector
- 177 collectors[es.probe.id] = c
- 178 return c
- 179
- 180 def get_instance(probe, uuid):
- 181 ni = probe.n_instances
- 182 if ni < 1:
- Variables:
- c = None
- collectors = {}
- es =
- <noc.pm.models.effectivesettings.EffectiveSettings object at 0x813847c90>
- ------------------------------------------------------------------------
- File: /opt/noc/pm/models/probeconfig.py (Line: 228)
- Function: get_refresh_ops
- 221 "metrics": [{
- 222 "metric": m.metric,
- 223 "metric_type": m.metric_type.name,
- 224 "thresholds": m.thresholds,
- 225 "convert": m.convert,
- 226 "scale": m.scale,
- 227 "collectors": get_collectors(es)
- 228 ==> } for m in es.metrics]
- 229 }
- 230 }
- 231 )
- 232 for m, n in cls.PROFILES[object.__class__]:
- 233 for obj in m.objects.filter(**{n: o.id}):
- 234 get_refresh_ops(bulk, obj)
- Variables:
- model_id = u'inv.Interface'
- get_collectors = <function get_collectors at 0x8132e62a8>
- object = <Interface: bb-nmts: Gi0/0/1/4>
- m =
- 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)
- o = <Interface: bb-nmts: Gi0/0/1/4>
- bulk = <pymongo.bulk.BulkOperationBuilder object at 0x813384788>
- get_instance = <function get_instance at 0x8132e6410>
- get_refresh_ops = <function get_refresh_ops at 0x8132e6758>
- now = datetime.datetime(2014, 10, 13, 19, 48, 29, 722474)
- es =
- <noc.pm.models.effectivesettings.EffectiveSettings object at 0x813847c90>
- cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
- ------------------------------------------------------------------------
- File: /opt/noc/pm/models/probeconfig.py (Line: 241)
- Function: _refresh_object
- 234 get_refresh_ops(bulk, obj)
- 235
- 236 logger.debug("Refresh object %s", object)
- 237 collectors = {} # Storage rule -> collector url
- 238 # @todo: Make configurable
- 239 now = datetime.datetime.now()
- 240 bulk = cls._get_collection().initialize_ordered_bulk_op()
- 241 ==> get_refresh_ops(bulk, object)
- 242 bulk.execute()
- 243
- 244 @classmethod
- 245 def _refresh_config(cls, object):
- 246 def get_collectors(es):
- 247 c = collectors.get(es.probe.id)
- Variables:
- collectors = {}
- get_collectors = <function get_collectors at 0x8132e62a8>
- object = <Interface: bb-nmts: Gi0/0/1/4>
- bulk = <pymongo.bulk.BulkOperationBuilder object at 0x813384788>
- get_refresh_ops = <function get_refresh_ops at 0x8132e6758>
- now = datetime.datetime(2014, 10, 13, 19, 48, 29, 722474)
- get_instance = <function get_instance at 0x8132e6410>
- cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
- ------------------------------------------------------------------------
- File: /opt/noc/pm/models/probeconfig.py (Line: 389)
- Function: refresh
- 382 logger.debug("Refreshing %s", self.uuid)
- 383 o = self.get_object()
- 384 if not o:
- 385 return
- 386 if self.model_id == "pm.MetricConfig":
- 387 self._refresh_config(o)
- 388 else:
- 389 ==> self._refresh_object(o)
- 390
- 391 @classmethod
- 392 def rebuild(cls, model_id=None):
- 393 pass
- 394
- 395 ##
- Variables:
- self = <ProbeConfig: d22003e8-ec3d-53cd-8768-92509d462ef2>
- o = <Interface: bb-nmts: Gi0/0/1/4>
- ------------------------------------------------------------------------
- File: /opt/noc/pm/models/probeconfig.py (Line: 373)
- Function: on_change_probe
- 366 metric_sets__metric_set=document.id):
- 367 cls._refresh_object(ms.get_object())
- 368
- 369 @classmethod
- 370 def on_change_probe(cls, sender, document=None, *args, **kwargs):
- 371 logger.info("Applying changes to Probe '%s'", document.name)
- 372 for pc in ProbeConfig.objects.filter(probe_id=str(document.id)):
- 373 ==> pc.refresh()
- 374
- 375 @classmethod
- 376 def on_change_auth_profile(cls, sender, instance, *args, **kwargs):
- 377 logger.info("Applying changes to AuthProfile '%s'" % instance.name)
- 378 for mo in instance.managedobject_set.all():
- 379 cls._refresh_object(mo)
- Variables:
- sender = <class 'noc.pm.models.probe.Probe'>
- args = ()
- pc = <ProbeConfig: d22003e8-ec3d-53cd-8768-92509d462ef2>
- kwargs = {'created': False}
- document = <Probe: default>
- cls = <class 'noc.pm.models.probeconfig.ProbeConfig'>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/blinker/base.py (Line: 267)
- Function: send
- 260 '%s given' % len(sender))
- 261 else:
- 262 sender = sender[0]
- 263 if not self.receivers:
- 264 return []
- 265 else:
- 266 return [(receiver, receiver(sender, **kwargs))
- 267 ==> for receiver in self.receivers_for(sender)]
- 268
- 269 def has_receivers_for(self, sender):
- 270 """True if there is probably a receiver for *sender*.
- 271
- 272 Performs an optimistic check only. Does not guarantee that all
- 273 weakly referenced receivers are still alive. See
- Variables:
- self = <blinker.base.NamedSignal object at 0x80d464890; 'post_save'>
- kwargs = {'document': <Probe: default>, 'created': False}
- sender = <class 'noc.pm.models.probe.Probe'>
- receiver =
- <bound method ?.on_change_probe of <class 'noc.pm.models.probeconfig.ProbeConfig'>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/document.py (Line: 301)
- Function: save
- 294 raise OperationError(message % unicode(err))
- 295 id_field = self._meta['id_field']
- 296 if id_field not in self._meta.get('shard_key', []):
- 297 self[id_field] = self._fields[id_field].to_python(object_id)
- 298
- 299 self._clear_changed_fields()
- 300 self._created = False
- 301 ==> signals.post_save.send(self.__class__, document=self, created=created)
- 302 return self
- 303
- 304 def cascade_save(self, *args, **kwargs):
- 305 """Recursively saves any references /
- 306 generic references on an objects"""
- 307 _refs = kwargs.get('_refs', []) or []
- Variables:
- removals = {}
- clean = True
- is_new_object = <function is_new_object at 0x8132c5e60>
- object_id = ObjectId('541302c1f3b6823af77a261b')
- select_dict = {'_id': ObjectId('541302c1f3b6823af77a261b')}
- last_error = {'updatedExisting': True, u'nModified': 0, u'ok': 1, u'n': 1}
- self = <Probe: default>
- kwargs = {}
- _refs = None
- shard_key = ()
- id_field = 'id'
- created = False
- cascade = False
- updates = {'storage': ObjectId('54152955f3b68243c5ec5b1c'), 'user': 15}
- cascade_kwargs = None
- doc =
- SON([('_id', ObjectId('541302c1f3b6823af77a261b')), ('name', u'default'), ('is_active', True), ('description', u''), ('storage', ObjectId('54152955f3b68243c5ec5b1c')), ('user', 15), ('n_instances', 8)])
- collection =
- Collection(Database(MongoClient('localhost', 27017), u'noc'), u'noc.pm.probe')
- validate = True
- force_insert = False
- update_query = {'$set': {'storage': ObjectId('54152955f3b68243c5ec5b1c'), 'user': 15}}
- write_concern = {'w': 1}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/extdocapplication.py (Line: 320)
- Function: api_update
- 313 return HttpResponse("", status=self.NOT_FOUND)
- 314 if self.has_uuid and not attrs.get("uuid") and not o.uuid:
- 315 attrs["uuid"] = uuid.uuid4()
- 316 # @todo: Check for duplicates
- 317 for k in attrs:
- 318 if k != self.pk and "__" not in k:
- 319 setattr(o, k, attrs[k])
- 320 ==> o.save()
- 321 # Reread result
- 322 o = self.model.objects.get(**{self.pk: id})
- 323 if request.is_extjs:
- 324 r = {
- 325 "success": True,
- 326 "data": self.instance_to_dict(o)
- Variables:
- self = <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>
- request =
- <WSGIRequest
- path:/pm/probe/541302c1f3b6823af77a261b/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
- 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
- META:{'CONTENT_LENGTH': '147',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': 'noc',
- 'HTTP_REFERER': 'http://noc/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'http',
- 'PATH_INFO': u'/pm/probe/541302c1f3b6823af77a261b/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'PUT',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': 'noc',
- 'SERVER_PORT': '80',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f665d0>,
- 'wsgi.input': <_io.BytesIO object at 0x813282bf0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- o = <Probe: default>
- id = u'541302c1f3b6823af77a261b'
- attrs =
- {'description': '',
- 'is_active': True,
- 'n_instances': 8,
- 'name': 'default',
- 'storage': <Storage: default>,
- 'user': <User: noc>}
- k = 'name'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 246)
- Function: inner
- 239 for k, v in request.POST.lists())
- 240 elif request.method == "GET":
- 241 a = dict((k, v[0] if len(v) == 1 else v)
- 242 for k, v in request.GET.lists())
- 243 app_logger.debug("API %s %s %s",
- 244 request.method, request.path, a)
- 245 # Call handler
- 246 ==> r = v(request, *args, **kwargs)
- 247 # Dump SQL statements
- 248 if self.log_sql_statements:
- 249 from django.db import connections
- 250 tsc = 0
- 251 sc = defaultdict(int)
- 252 for conn in connections.all():
- Variables:
- args = ()
- view_map =
- {'DELETE': <bound method ProbeApplication.api_delete of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>,
- 'GET': <bound method ProbeApplication.api_read of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>,
- 'PUT': <bound method ProbeApplication.api_update of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>}
- Form = <class 'django.forms.forms.Form'>
- PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x80d5127d0>
- v =
- <bound method ProbeApplication.api_update of <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>>
- request =
- <WSGIRequest
- path:/pm/probe/541302c1f3b6823af77a261b/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
- 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
- META:{'CONTENT_LENGTH': '147',
- 'CONTENT_TYPE': 'application/json; charset=UTF-8',
- 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
- 'HTTP_DNT': '1',
- 'HTTP_HOST': 'noc',
- 'HTTP_REFERER': 'http://noc/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
- 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
- 'HTTP_X_SCHEME': 'http',
- 'PATH_INFO': u'/pm/probe/541302c1f3b6823af77a261b/',
- 'QUERY_STRING': '',
- 'REMOTE_ADDR': '127.0.0.1',
- 'REQUEST_METHOD': 'PUT',
- 'SCRIPT_NAME': u'',
- 'SERVER_NAME': 'noc',
- 'SERVER_PORT': '80',
- 'SERVER_PROTOCOL': 'HTTP/1.0',
- 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f665d0>,
- 'wsgi.input': <_io.BytesIO object at 0x813282bf0>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- app_logger = <logging.Logger object at 0x810ad9050>
- InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
- to_log_api_call = False
- kwargs = {'id': u'541302c1f3b6823af77a261b'}
- nq = <function nq at 0x8132c5de8>
- app = <noc.pm.apps.probe.views.ProbeApplication object at 0x810ac4f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement