Guest User

Untitled

a guest
Oct 2nd, 2014
199
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. UNHANDLED EXCEPTION (2014-10-02 23:15:48.239617)
  2. Working directory: /opt/noc
  3. <class 'noc.main.models.sync.DoesNotExist'>
  4. Sync matching query does not exist.
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset/base.py (Line: 186)
  8. Function: get
  9. 179 queryset = queryset.filter(*q_objs, **query)
  10. 180
  11. 181 try:
  12. 182 result = queryset.next()
  13. 183 except StopIteration:
  14. 184 msg = ("%s matching query does not exist."
  15. 185 % queryset._document._class_name)
  16. 186 ==> raise queryset._document.DoesNotExist(msg)
  17. 187 try:
  18. 188 queryset.next()
  19. 189 except StopIteration:
  20. 190 return result
  21. 191
  22. 192 queryset.rewind()
  23. Variables:
  24. msg = 'Sync matching query does not exist.'
  25. query = {'id': u'542d97e5f3b682c0b6b9787f'}
  26. self = [<Sync: comin>, <Sync: xkis>]
  27. queryset = []
  28. q_objs = ()
  29. ------------------------------------------------------------------------
  30. File: /opt/noc/lib/fields.py (Line: 318)
  31. Function: to_python
  32. 311 def db_type(self, connection):
  33. 312 return "CHAR(24)"
  34. 313
  35. 314 def to_python(self, value):
  36. 315 if value is None:
  37. 316 return None
  38. 317 else:
  39. 318 ==> return self.document.objects.get(id=value)
  40. 319
  41. 320 def get_prep_value(self, value):
  42. 321 if value is None:
  43. 322 return None
  44. 323 elif isinstance(value, basestring):
  45. 324 return value
  46. Variables:
  47. self = <noc.lib.fields.DocumentReferenceField: sync>
  48. value = u'542d97e5f3b682c0b6b9787f'
  49. ------------------------------------------------------------------------
  50. File: /opt/noc/lib/python2.7/site-packages/django/db/models/fields/subclassing.py (Line: 34)
  51. Function: __set__
  52. 27
  53. 28 def __get__(self, obj, type=None):
  54. 29 if obj is None:
  55. 30 raise AttributeError('Can only be accessed via an instance.')
  56. 31 return obj.__dict__[self.field.name]
  57. 32
  58. 33 def __set__(self, obj, value):
  59. 34 ==> obj.__dict__[self.field.name] = self.field.to_python(value)
  60. 35
  61. 36 def make_contrib(superclass, func=None):
  62. 37 """
  63. 38 Returns a suitable contribute_to_class() method for the Field subclass.
  64. 39
  65. 40 If 'func' is passed in, it is the existing contribute_to_class() method on
  66. Variables:
  67. self = <django.db.models.fields.subclassing.Creator object at 0x80f64a690>
  68. obj = <DNSServer: ns1.local>
  69. value = u'542d97e5f3b682c0b6b9787f'
  70. ------------------------------------------------------------------------
  71. File: /opt/noc/lib/python2.7/site-packages/django/db/models/base.py (Line: 300)
  72. Function: __init__
  73. 293 fields_iter = iter(self._meta.fields)
  74. 294 if not kwargs:
  75. 295 # The ordering of the izip calls matter - izip throws StopIteration
  76. 296 # when an iter throws it. So if the first iter throws it, the second
  77. 297 # is *not* consumed. We rely on this, so don't change the order
  78. 298 # without changing the logic.
  79. 299 for val, field in izip(args, fields_iter):
  80. 300 ==> setattr(self, field.attname, val)
  81. 301 else:
  82. 302 # Slower, kwargs-ready version.
  83. 303 for val, field in izip(args, fields_iter):
  84. 304 setattr(self, field.attname, val)
  85. 305 kwargs.pop(field.name, None)
  86. 306 # Maintain compatibility with existing calls.
  87. Variables:
  88. fields_iter = <listiterator object at 0x81320e450>
  89. val = u'542d97e5f3b682c0b6b9787f'
  90. args_len = 5
  91. self = <DNSServer: ns1.local>
  92. args =
  93. (3, u'ns1.local', '10.10.0.8', u'xkis fttb', u'542d97e5f3b682c0b6b9787f')
  94. field = <noc.lib.fields.DocumentReferenceField: sync>
  95. kwargs = {}
  96. ------------------------------------------------------------------------
  97. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 1388)
  98. Function: get_cached_row
  99. 1381 # Otherwise, construct the related object.
  100. 1382 if fields == (None,) * field_count:
  101. 1383 obj = None
  102. 1384 else:
  103. 1385 if field_names:
  104. 1386 obj = klass(**dict(zip(field_names, fields)))
  105. 1387 else:
  106. 1388 ==> obj = klass(*fields)
  107. 1389
  108. 1390 # If an object was retrieved, set the database state.
  109. 1391 if obj:
  110. 1392 obj._state.db = using
  111. 1393 obj._state.adding = False
  112. 1394
  113. Variables:
  114. klass_info = (<class 'noc.dns.models.dnsserver.DNSServer'>, (), 5, [], [])
  115. fields =
  116. (3, u'ns1.local', '10.10.0.8', u'xkis fttb', u'542d97e5f3b682c0b6b9787f')
  117. field_count = 5
  118. reverse_related_fields = []
  119. index_start = 0
  120. klass = <class 'noc.dns.models.dnsserver.DNSServer'>
  121. offset = 0
  122. using = 'default'
  123. field_names = ()
  124. related_fields = []
  125. row =
  126. (3, u'ns1.local', '10.10.0.8', u'xkis fttb', u'542d97e5f3b682c0b6b9787f')
  127. ------------------------------------------------------------------------
  128. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 294)
  129. Function: iterator
  130. 287 compiler = self.query.get_compiler(using=db)
  131. 288 if fill_cache:
  132. 289 klass_info = get_klass_info(model, max_depth=max_depth,
  133. 290 requested=requested, only_load=only_load)
  134. 291 for row in compiler.results_iter():
  135. 292 if fill_cache:
  136. 293 obj, _ = get_cached_row(row, index_start, db, klass_info,
  137. 294 ==> offset=len(aggregate_select))
  138. 295 else:
  139. 296 if skip:
  140. 297 row_data = row[index_start:aggregate_start]
  141. 298 obj = model_cls(**dict(zip(init_list, row_data)))
  142. 299 else:
  143. 300 # Omit aggregates in object creation.
  144. Variables:
  145. requested = None
  146. fill_cache = True
  147. obj = <DNSServer: ns.kis.ru>
  148. klass_info = (<class 'noc.dns.models.dnsserver.DNSServer'>, (), 5, [], [])
  149. skip = None
  150. self = repr() failed
  151. load_fields = []
  152. db = 'default'
  153. index_start = 0
  154. extra_select = []
  155. aggregate_start = 5
  156. aggregate_select = []
  157. model = <class 'noc.dns.models.dnsserver.DNSServer'>
  158. row =
  159. (3, u'ns1.local', '10.10.0.8', u'xkis fttb', u'542d97e5f3b682c0b6b9787f')
  160. only_load = {}
  161. max_depth = 5
  162. _ = 5
  163. compiler = <django.db.models.sql.compiler.SQLCompiler object at 0x813288990>
  164. ------------------------------------------------------------------------
  165. File: /opt/noc/lib/python2.7/site-packages/django/db/models/query.py (Line: 85)
  166. Function: __len__
  167. 78 # Since __len__ is called quite frequently (for example, as part of
  168. 79 # list(qs), we make some effort here to be as efficient as possible
  169. 80 # whilst not messing up any existing iterators against the QuerySet.
  170. 81 if self._result_cache is None:
  171. 82 if self._iter:
  172. 83 self._result_cache = list(self._iter)
  173. 84 else:
  174. 85 ==> self._result_cache = list(self.iterator())
  175. 86 elif self._iter:
  176. 87 self._result_cache.extend(self._iter)
  177. 88 if self._prefetch_related_lookups and not self._prefetch_done:
  178. 89 self._prefetch_related_objects()
  179. 90 return len(self._result_cache)
  180. 91
  181. Variables:
  182. self = repr() failed
  183. ------------------------------------------------------------------------
  184. File: /opt/noc/lib/app/extapplication.py (Line: 159)
  185. Function: list_data
  186. 152 ordering = ordering or self.default_ordering
  187. 153 if ordering:
  188. 154 data = data.order_by(*ordering)
  189. 155 if request.is_extjs:
  190. 156 total = data.count() # Total unpaged count
  191. 157 if start is not None and limit is not None:
  192. 158 data = data[int(start):int(start) + int(limit)]
  193. 159 ==> ld = len(data)
  194. 160 if self.row_limit and ld > self.row_limit:
  195. 161 # Request too large
  196. 162 return self.response(
  197. 163 "System limit is %d records (%d requested)" % (self.row_limit, ld),
  198. 164 status=self.TOO_LARGE)
  199. 165 out = [formatter(o, fields=only) for o in data]
  200. Variables:
  201. fs = None
  202. ordering = []
  203. self =
  204. <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>
  205. request =
  206. <WSGIRequest
  207. path:/dns/dnsserver/,
  208. GET:<QueryDict: {u'__limit': [u'54'], u'__page': [u'1'], u'_dc': [u'1412277339342'], u'__start': [u'0'], u'__format': [u'ext']}>,
  209. POST:<QueryDict: {}>,
  210. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  211. 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
  212. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  213. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  214. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  215. 'HTTP_CONNECTION': 'close',
  216. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
  217. 'HTTP_DNT': '1',
  218. 'HTTP_HOST': 'noc',
  219. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  220. 'HTTP_X_SCHEME': 'http',
  221. 'PATH_INFO': u'/dns/dnsserver/',
  222. 'QUERY_STRING': '_dc=1412277339342&__format=ext&__page=1&__start=0&__limit=54',
  223. 'REMOTE_ADDR': '127.0.0.1',
  224. 'REQUEST_METHOD': 'GET',
  225. 'SCRIPT_NAME': u'',
  226. 'SERVER_NAME': 'noc',
  227. 'SERVER_PORT': '80',
  228. 'SERVER_PROTOCOL': 'HTTP/1.0',
  229. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f59660>,
  230. 'wsgi.input': <_io.BytesIO object at 0x8132073b0>,
  231. 'wsgi.multiprocess': True,
  232. 'wsgi.multithread': False,
  233. 'wsgi.run_once': False,
  234. 'wsgi.url_scheme': 'http',
  235. 'wsgi.version': (1, 0)}>
  236. q = {}
  237. start = u'0'
  238. only = None
  239. limit = u'54'
  240. formatter =
  241. <bound method DNSServerApplication.instance_to_dict of <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>>
  242. query = None
  243. total = 5
  244. data = repr() failed
  245. fav_items = None
  246. ------------------------------------------------------------------------
  247. File: /opt/noc/lib/app/extmodelapplication.py (Line: 341)
  248. Function: api_list
  249. 334 f[n] = pdata[n]
  250. 335 return f, m2m
  251. 336 else:
  252. 337 return pdata, {}
  253. 338
  254. 339 @view(method=["GET"], url="^$", access="read", api=True)
  255. 340 def api_list(self, request):
  256. 341 ==> return self.list_data(request, self.instance_to_dict)
  257. 342
  258. 343 @view(method=["GET"], url=r"^lookup/$", access="lookup", api=True)
  259. 344 def api_lookup(self, request):
  260. 345 return self.list_data(request, self.instance_to_lookup)
  261. 346
  262. 347 @view(method=["POST"], url="^$", access="create", api=True)
  263. Variables:
  264. self =
  265. <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>
  266. request =
  267. <WSGIRequest
  268. path:/dns/dnsserver/,
  269. GET:<QueryDict: {u'__limit': [u'54'], u'__page': [u'1'], u'_dc': [u'1412277339342'], u'__start': [u'0'], u'__format': [u'ext']}>,
  270. POST:<QueryDict: {}>,
  271. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  272. 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
  273. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  274. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  275. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  276. 'HTTP_CONNECTION': 'close',
  277. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
  278. 'HTTP_DNT': '1',
  279. 'HTTP_HOST': 'noc',
  280. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  281. 'HTTP_X_SCHEME': 'http',
  282. 'PATH_INFO': u'/dns/dnsserver/',
  283. 'QUERY_STRING': '_dc=1412277339342&__format=ext&__page=1&__start=0&__limit=54',
  284. 'REMOTE_ADDR': '127.0.0.1',
  285. 'REQUEST_METHOD': 'GET',
  286. 'SCRIPT_NAME': u'',
  287. 'SERVER_NAME': 'noc',
  288. 'SERVER_PORT': '80',
  289. 'SERVER_PROTOCOL': 'HTTP/1.0',
  290. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f59660>,
  291. 'wsgi.input': <_io.BytesIO object at 0x8132073b0>,
  292. 'wsgi.multiprocess': True,
  293. 'wsgi.multithread': False,
  294. 'wsgi.run_once': False,
  295. 'wsgi.url_scheme': 'http',
  296. 'wsgi.version': (1, 0)}>
  297. ------------------------------------------------------------------------
  298. File: /opt/noc/lib/app/site.py (Line: 246)
  299. Function: inner
  300. 239 for k, v in request.POST.lists())
  301. 240 elif request.method == "GET":
  302. 241 a = dict((k, v[0] if len(v) == 1 else v)
  303. 242 for k, v in request.GET.lists())
  304. 243 app_logger.debug("API %s %s %s",
  305. 244 request.method, request.path, a)
  306. 245 # Call handler
  307. 246 ==> r = v(request, *args, **kwargs)
  308. 247 # Dump SQL statements
  309. 248 if self.log_sql_statements:
  310. 249 from django.db import connections
  311. 250 tsc = 0
  312. 251 sc = defaultdict(int)
  313. 252 for conn in connections.all():
  314. Variables:
  315. args = ()
  316. view_map =
  317. {'GET': <bound method DNSServerApplication.api_list of <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>>,
  318. 'POST': <bound method DNSServerApplication.api_create of <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>>}
  319. Form = <class 'django.forms.forms.Form'>
  320. PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'>
  321. DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
  322. self = <noc.lib.app.site.Site object at 0x80d50ac90>
  323. v =
  324. <bound method DNSServerApplication.api_list of <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>>
  325. request =
  326. <WSGIRequest
  327. path:/dns/dnsserver/,
  328. GET:<QueryDict: {u'__limit': [u'54'], u'__page': [u'1'], u'_dc': [u'1412277339342'], u'__start': [u'0'], u'__format': [u'ext']}>,
  329. POST:<QueryDict: {}>,
  330. COOKIES:{'csrftoken': '102bc6e214b4272a803d0c0a1dd106aa',
  331. 'sessionid': 'a7330916f4fb14ed90fa11fb6f5b7eac'},
  332. META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  333. 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
  334. 'HTTP_ACCEPT_LANGUAGE': 'ru,en-us;q=0.7,en;q=0.3',
  335. 'HTTP_CONNECTION': 'close',
  336. 'HTTP_COOKIE': 'csrftoken=102bc6e214b4272a803d0c0a1dd106aa; sessionid=a7330916f4fb14ed90fa11fb6f5b7eac',
  337. 'HTTP_DNT': '1',
  338. 'HTTP_HOST': 'noc',
  339. 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0',
  340. 'HTTP_X_SCHEME': 'http',
  341. 'PATH_INFO': u'/dns/dnsserver/',
  342. 'QUERY_STRING': '_dc=1412277339342&__format=ext&__page=1&__start=0&__limit=54',
  343. 'REMOTE_ADDR': '127.0.0.1',
  344. 'REQUEST_METHOD': 'GET',
  345. 'SCRIPT_NAME': u'',
  346. 'SERVER_NAME': 'noc',
  347. 'SERVER_PORT': '80',
  348. 'SERVER_PROTOCOL': 'HTTP/1.0',
  349. 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x808f59660>,
  350. 'wsgi.input': <_io.BytesIO object at 0x8132073b0>,
  351. 'wsgi.multiprocess': True,
  352. 'wsgi.multithread': False,
  353. 'wsgi.run_once': False,
  354. 'wsgi.url_scheme': 'http',
  355. 'wsgi.version': (1, 0)}>
  356. app_logger = <logging.Logger object at 0x8113895d0>
  357. InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'>
  358. to_log_api_call = False
  359. kwargs = {}
  360. nq = <function nq at 0x813335cf8>
  361. app =
  362. <noc.dns.apps.dnsserver.views.DNSServerApplication object at 0x8113893d0>
  363. ------------------------------------------------------------------------
  364. END OF TRACEBACK
RAW Paste Data