Advertisement
Guest User

Untitled

a guest
Nov 20th, 2013
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.99 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2013-11-20 13:07:02.456484)
  2. Working directory: /usr/local/noc
  3. <class 'mongoengine.base.ValidationError'>
  4. Unable to dereference <class 'noc.inv.models.objectmodel.ObjectModel'>:528b7bf85c8b82725af590d4
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /usr/local/noc/lib/nosql.py (Line: 103)
  8. Function: __get__
  9. 96 # Dereference DBRefs
  10. 97 if isinstance(value, ObjectId):
  11. 98 v = self.document_type.objects(id=value).first()
  12. 99 if v is not None:
  13. 100 instance._data[self.name] = v
  14. 101 else:
  15. 102 raise ValidationError("Unable to dereference %s:%s" % (
  16. 103 ==> self.document_type, value))
  17. 104 return super(PlainReferenceField, self).__get__(instance, owner)
  18. 105
  19. 106 def to_mongo(self, document):
  20. 107 if isinstance(document, Document):
  21. 108 # We need the id from the saved object to create the DBRef
  22. 109 id_ = document.id
  23. Variables:
  24. owner = <class 'noc.inv.models.object.Object'>
  25. instance = <Object: 528c440a5c8b821225468b1f>
  26. self = <noc.lib.nosql.PlainReferenceField object at 0x809971410>
  27. value = ObjectId('528b7bf85c8b82725af590d4')
  28. v = None
  29. ------------------------------------------------------------------------
  30. File: /usr/local/noc/sa/apps/managedobject/views.py (Line: 478)
  31. Function: get_nested_inventory
  32. 471 self.discovery_scheduler = DiscoveryScheduler()
  33. 472 self.discovery_scheduler.ensure_job(job_name, managed_object)
  34. 473
  35. 474 def get_nested_inventory(self, o):
  36. 475 r = {
  37. 476 "id": str(o.id),
  38. 477 "serial": o.get_data("asset", "serial"),
  39. 478 ==> "description": o.model.description,
  40. 479 "model": o.model.name
  41. 480 }
  42. 481 children = []
  43. 482 for n in o.model.connections:
  44. 483 if n.direction == "i":
  45. 484 c, r_object, _ = o.get_p2p_connection(n.name)
  46. Variables:
  47. self =
  48. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>
  49. o = <Object: 528c440a5c8b821225468b1f>
  50. ------------------------------------------------------------------------
  51. File: /usr/local/noc/sa/apps/managedobject/views.py (Line: 523)
  52. Function: api_inventory
  53. 516 access="read", api=True)
  54. 517 def api_inventory(self, request, id):
  55. 518 o = self.get_object_or_404(ManagedObject, id=id)
  56. 519 if not o.has_access(request.user):
  57. 520 return self.response_forbidden("Access denied")
  58. 521 r = []
  59. 522 for p in o.get_inventory():
  60. 523 ==> c = self.get_nested_inventory(p)
  61. 524 c["name"] = p.model.description
  62. 525 r += [c]
  63. 526 return {
  64. 527 "expanded": True,
  65. 528 "children": r
  66. 529 }
  67. Variables:
  68. self =
  69. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>
  70. request =
  71. <WSGIRequest
  72. path:/sa/managedobject/98/inventory/,
  73. GET:<QueryDict: {u'_dc': [u'1384938422397']}>,
  74. POST:<QueryDict: {}>,
  75. COOKIES:{'sessionid': '3e41a8ed7e4eb93ff3ab356637aa0ab2'},
  76. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  77. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  78. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
  79. 'HTTP_CONNECTION': 'close',
  80. 'HTTP_COOKIE': 'sessionid=3e41a8ed7e4eb93ff3ab356637aa0ab2',
  81. 'HTTP_HOST': '127.0.0.1:8000',
  82. 'HTTP_REFERER': 'http://noc1.line-r.ru:8081/main/desktop/',
  83. 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0',
  84. 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
  85. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  86. 'PATH_INFO': u'/sa/managedobject/98/inventory/',
  87. 'QUERY_STRING': '_dc=1384938422397',
  88. 'REMOTE_ADDR': '127.0.0.1',
  89. 'REQUEST_METHOD': 'GET',
  90. 'SCRIPT_NAME': u'',
  91. 'SERVER_NAME': '127.0.0.1',
  92. 'SERVER_PORT': '8000',
  93. 'SERVER_PROTOCOL': 'HTTP/1.0',
  94. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x804147ed0>,
  95. 'wsgi.input': <_io.BytesIO object at 0x8099dfa70>,
  96. 'wsgi.multiprocess': True,
  97. 'wsgi.multithread': False,
  98. 'wsgi.run_once': False,
  99. 'wsgi.url_scheme': 'http',
  100. 'wsgi.version': (1, 0)}>
  101. o = <ManagedObject: M80-cc-6509-1>
  102. p = <Object: 528c440a5c8b821225468b1f>
  103. r = []
  104. id = u'98'
  105. ------------------------------------------------------------------------
  106. File: /usr/local/noc/lib/app/site.py (Line: 232)
  107. Function: inner
  108. 225 for k, v in request.POST.lists())
  109. 226 elif request.method == "GET":
  110. 227 a = dict((k, v[0] if len(v) == 1 else v)
  111. 228 for k, v in request.GET.lists())
  112. 229 logging.debug("API %s %s %s" % (request.method,
  113. 230 request.path, a))
  114. 231 # Call handler
  115. 232 ==> r = v(request, *args, **kwargs)
  116. 233 # Dump SQL statements
  117. 234 if self.log_sql_statements:
  118. 235 from django.db import connections
  119. 236 tsc = 0
  120. 237 sc = defaultdict(int)
  121. 238 for conn in connections.all():
  122. Variables:
  123. args = ()
  124. view_map =
  125. {'GET': <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>>}
  126. Form = <class 'django.forms.forms.Form'>
  127. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  128. self = <noc.lib.app.site.Site object at 0x806207210>
  129. v =
  130. <bound method ManagedObjectApplication.api_inventory of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>>
  131. request =
  132. <WSGIRequest
  133. path:/sa/managedobject/98/inventory/,
  134. GET:<QueryDict: {u'_dc': [u'1384938422397']}>,
  135. POST:<QueryDict: {}>,
  136. COOKIES:{'sessionid': '3e41a8ed7e4eb93ff3ab356637aa0ab2'},
  137. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  138. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  139. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
  140. 'HTTP_CONNECTION': 'close',
  141. 'HTTP_COOKIE': 'sessionid=3e41a8ed7e4eb93ff3ab356637aa0ab2',
  142. 'HTTP_HOST': '127.0.0.1:8000',
  143. 'HTTP_REFERER': 'http://noc1.line-r.ru:8081/main/desktop/',
  144. 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0',
  145. 'HTTP_X_CLICKONCESUPPORT': '( .NET CLR 3.5.30729; .NET4.0E)',
  146. 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest',
  147. 'PATH_INFO': u'/sa/managedobject/98/inventory/',
  148. 'QUERY_STRING': '_dc=1384938422397',
  149. 'REMOTE_ADDR': '127.0.0.1',
  150. 'REQUEST_METHOD': 'GET',
  151. 'SCRIPT_NAME': u'',
  152. 'SERVER_NAME': '127.0.0.1',
  153. 'SERVER_PORT': '8000',
  154. 'SERVER_PROTOCOL': 'HTTP/1.0',
  155. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x804147ed0>,
  156. 'wsgi.input': <_io.BytesIO object at 0x8099dfa70>,
  157. 'wsgi.multiprocess': True,
  158. 'wsgi.multithread': False,
  159. 'wsgi.run_once': False,
  160. 'wsgi.url_scheme': 'http',
  161. 'wsgi.version': (1, 0)}>
  162. to_log_api_call = False
  163. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  164. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  165. kwargs = {'id': u'98'}
  166. app =
  167. <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x809229910>
  168. ------------------------------------------------------------------------
  169. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement