Guest User

Untitled

a guest
Mar 21st, 2012
31
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. UNHANDLED EXCEPTION (2012-03-21 09:06:37.177448)
  2. Working directory: /usr/local/noc
  3. <type 'exceptions.IndexError'>
  4. list index out of range
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /usr/local/noc/contrib/lib/django/db/models/query.py (Line: 190)
  8. Function: __getitem__
  9. 183 else:
  10. 184 stop = None
  11. 185 qs.query.set_limits(start, stop)
  12. 186 return k.step and list(qs)[::k.step] or qs
  13. 187 try:
  14. 188 qs = self._clone()
  15. 189 qs.query.set_limits(k, k + 1)
  16. 190 ==> return list(qs)[0]
  17. 191 except self.model.DoesNotExist, e:
  18. 192 raise IndexError(e.args)
  19. 193
  20. 194 def __and__(self, other):
  21. 195 self._merge_sanity_check(other)
  22. 196 if isinstance(other, EmptyQuerySet):
  23. Variables:
  24. qs = []
  25. k = 0
  26. self = []
  27. ------------------------------------------------------------------------
  28. File: /usr/local/noc/sa/apps/managedobject/views.py (Line: 158)
  29. Function: script_reduce
  30. 151 ##
  31. 152 class TaskFailed(object):
  32. 153 def __init__(self, msg):
  33. 154 self.msg = u"Task failed: %s" % msg
  34. 155
  35. 156 def script_reduce(task):
  36. 157 from noc.sa.apps.managedobject.views import TaskFailed
  37. 158 ==> mt = task.maptask_set.all()[0]
  38. 159 if mt.status != "C":
  39. 160 msg = str(mt.script_result["text"]) if mt.script_result else ""
  40. 161 return mt.script_params, TaskFailed(msg)
  41. 162 return mt.script_params, mt.script_result
  42. 163
  43. 164 ##
  44. Variables:
  45. task = <ReduceTask: 1>
  46. TaskFailed = <class 'noc.sa.apps.managedobject.views.TaskFailed'>
  47. ------------------------------------------------------------------------
  48. File: /usr/local/noc/sa/models.py (Line: 953)
  49. Function: reduce
  50. 946 m.save()
  51. 947 return r_task
  52. 948
  53. 949 ##
  54. 950 ## Perform reduce script and execute result
  55. 951 ##
  56. 952 def reduce(self):
  57. 953 ==> return PyRule.compile_text(self.script)(self, **self.script_params)
  58. 954
  59. 955 ##
  60. 956 ## Get task result
  61. 957 ##
  62. 958 def get_result(self, block=True):
  63. 959 while True:
  64. Variables:
  65. self = <ReduceTask: 1>
  66. ------------------------------------------------------------------------
  67. File: /usr/local/noc/sa/models.py (Line: 961)
  68. Function: get_result
  69. 954
  70. 955 ##
  71. 956 ## Get task result
  72. 957 ##
  73. 958 def get_result(self, block=True):
  74. 959 while True:
  75. 960 if self.complete:
  76. 961 ==> result = self.reduce()
  77. 962 self.delete()
  78. 963 return result
  79. 964 else:
  80. 965 if block:
  81. 966 time.sleep(3)
  82. 967 else:
  83. Variables:
  84. self = <ReduceTask: 1>
  85. block = False
  86. ------------------------------------------------------------------------
  87. File: /usr/local/noc/sa/apps/managedobject/views.py (Line: 350)
  88. Function: view_scriptresult
  89. 343 # Check script exists
  90. 344 try:
  91. 345 scr = script_registry[script]
  92. 346 except:
  93. 347 return self.response_not_found("Script not found")
  94. 348 # Wait for task completion
  95. 349 try:
  96. 350 ==> params, result = task.get_result(block=False)
  97. 351 except ReduceTask.NotReady:
  98. 352 return self.render_wait(request, subject="Script %s" % script,
  99. 353 text="Processing script. Please wait ...")
  100. 354 # Format result
  101. 355 display_box = True
  102. 356 refresh = self.site.reverse("sa:managedobject:script", object.id,
  103. Variables:
  104. task = <ReduceTask: 1>
  105. task_id = u'1'
  106. script = u'DLink.DxS.get_config'
  107. self = <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>
  108. format = u'HTML'
  109. request = <WSGIRequest
  110. GET:<QueryDict: {}>,
  111. POST:<QueryDict: {}>,
  112. COOKIES:{'csrftoken': 'ff32da21eb89cc5a91d8e362b7f1a80c',
  113. 'sessionid': '5a63a28e997bfa988a3f308b2e8eac7a'},
  114. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  115. 'HTTP_ACCEPT_CHARSET': 'windows-1251,utf-8;q=0.7,*;q=0.3',
  116. 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
  117. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
  118. 'HTTP_CONNECTION': 'close',
  119. 'HTTP_COOKIE': 'sessionid=5a63a28e997bfa988a3f308b2e8eac7a; csrftoken=ff32da21eb89cc5a91d8e362b7f1a80c',
  120. 'HTTP_HOST': '127.0.0.1:8000',
  121. 'HTTP_REFERER': 'http://10.14.90.41/sa/managedobject/2/scripts/',
  122. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/10.04 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11',
  123. 'PATH_INFO': u'/sa/managedobject/2/scripts/DLink.DxS.get_config/1/HTML',
  124. 'QUERY_STRING': '',
  125. 'REMOTE_ADDR': '127.0.0.1',
  126. 'REQUEST_METHOD': 'GET',
  127. 'SCRIPT_NAME': u'',
  128. 'SERVER_NAME': '127.0.0.1',
  129. 'SERVER_PORT': '8000',
  130. 'SERVER_PROTOCOL': 'HTTP/1.0',
  131. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8043c44b0>,
  132. 'wsgi.input': <io.BytesIO object at 0x808f8f7d0>,
  133. 'wsgi.multiprocess': True,
  134. 'wsgi.multithread': False,
  135. 'wsgi.run_once': False,
  136. 'wsgi.url_scheme': 'http',
  137. 'wsgi.version': (1, 0)}>
  138. object = <ManagedObject: dlink-test>
  139. object_id = u'2'
  140. scr = <class 'noc.sa.profiles.DLink.DxS.get_config.Script'>
  141. ------------------------------------------------------------------------
  142. File: /usr/local/noc/lib/app/site.py (Line: 174)
  143. Function: inner
  144. 167 "status": False,
  145. 168 "errors": dict([(f, "; ".join(e))
  146. 169 for f, e in f.errors.items()])
  147. 170 })
  148. 171 status = 200 if ext_format else 400 # OK or BAD_REQUEST
  149. 172 return HttpResponse(r, status=status,
  150. 173 mimetype="text/json; charset=utf-8")
  151. 174 ==> r = v(request, *args, **kwargs)
  152. 175 except PermissionDenied, why:
  153. 176 return HttpResponseForbidden(why)
  154. 177 except:
  155. 178 # Generate 500
  156. 179 r = HttpResponse(content=get_traceback(), status=500,
  157. 180 mimetype="text/plain; charset=utf-8")
  158. Variables:
  159. v = <bound method ManagedObjectApplication.view_scriptresult of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>>
  160. view_map = {'PUT': <bound method ManagedObjectApplication.view_scriptresult of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>>, 'POST': <bound method ManagedObjectApplication.view_scriptresult of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>>, 'GET': <bound method ManagedObjectApplication.view_scriptresult of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>>, 'DELETE': <bound method ManagedObjectApplication.view_scriptresult of <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>>}
  161. Form = <class 'django.forms.forms.Form'>
  162. app = <noc.sa.apps.managedobject.views.ManagedObjectApplication object at 0x8087ddd90>
  163. args = ()
  164. request = <WSGIRequest
  165. GET:<QueryDict: {}>,
  166. POST:<QueryDict: {}>,
  167. COOKIES:{'csrftoken': 'ff32da21eb89cc5a91d8e362b7f1a80c',
  168. 'sessionid': '5a63a28e997bfa988a3f308b2e8eac7a'},
  169. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  170. 'HTTP_ACCEPT_CHARSET': 'windows-1251,utf-8;q=0.7,*;q=0.3',
  171. 'HTTP_ACCEPT_ENCODING': 'gzip,deflate,sdch',
  172. 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4',
  173. 'HTTP_CONNECTION': 'close',
  174. 'HTTP_COOKIE': 'sessionid=5a63a28e997bfa988a3f308b2e8eac7a; csrftoken=ff32da21eb89cc5a91d8e362b7f1a80c',
  175. 'HTTP_HOST': '127.0.0.1:8000',
  176. 'HTTP_REFERER': 'http://10.14.90.41/sa/managedobject/2/scripts/',
  177. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Ubuntu/10.04 Chromium/17.0.963.79 Chrome/17.0.963.79 Safari/535.11',
  178. 'PATH_INFO': u'/sa/managedobject/2/scripts/DLink.DxS.get_config/1/HTML',
  179. 'QUERY_STRING': '',
  180. 'REMOTE_ADDR': '127.0.0.1',
  181. 'REQUEST_METHOD': 'GET',
  182. 'SCRIPT_NAME': u'',
  183. 'SERVER_NAME': '127.0.0.1',
  184. 'SERVER_PORT': '8000',
  185. 'SERVER_PROTOCOL': 'HTTP/1.0',
  186. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x8043c44b0>,
  187. 'wsgi.input': <io.BytesIO object at 0x808f8f7d0>,
  188. 'wsgi.multiprocess': True,
  189. 'wsgi.multithread': False,
  190. 'wsgi.run_once': False,
  191. 'wsgi.url_scheme': 'http',
  192. 'wsgi.version': (1, 0)}>
  193. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  194. kwargs = {'script': u'DLink.DxS.get_config', 'object_id': u'2', 'task_id': u'1', 'format': u'HTML'}
  195. ------------------------------------------------------------------------
  196. END OF TRACEBACK
RAW Paste Data