Guest User

Untitled

a guest
Oct 21st, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.65 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2014-10-21 12:42:46.508796) Working directory: /opt/noc <class 'mongoengine.queryset.InvalidQueryError'> Cannot resolve field "is_builtin" START OF TRACEBACK ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 639) Function: _lookup_field 632 if field_name in document._fields: 633 field = document._fields[field_name] 634 elif document._dynamic: 635 from fields import DynamicField 636 field = DynamicField(db_field=field_name) 637 else: 638 raise InvalidQueryError('Cannot resolve field "%s"' 639 ==> % field_name) 640 else: 641 from mongoengine.fields import ReferenceField, GenericReferenceField 642 if isinstance(field, (ReferenceField, GenericReferenceField)): 643 raise InvalidQueryError('Cannot perform join in mongoDB: %s' % '__'.join(parts)) 644 if hasattr(getattr(field, 'field', None), 'lookup_member'): 645 new_field = field.field.lookup_member(field_name) Variables: fields = [] field = None parts = ['is_builtin'] document = <class 'noc.inv.models.objectmodel.ObjectModel'> field_name = 'is_builtin' cls = <class 'mongoengine.queryset.QuerySet'> ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 701) Function: _transform_query 694 negate = False 695 if parts[-1] == 'not': 696 parts.pop() 697 negate = True 698 699 if _doc_cls: 700 # Switch field names to proper names [set in Field(name='foo')] 701 ==> fields = QuerySet._lookup_field(_doc_cls, parts) 702 parts = [] 703 704 cleaned_fields = [] 705 for field in fields: 706 append_field = True 707 if isinstance(field, basestring): Variables: mongo_query = {} _field_operation = False geo_operators = ['within_distance', 'within_spherical_distance', 'within_box', 'within_polygon', 'near', 'near_sphere'] match_operators = ['contains', 'icontains', 'startswith', 'istartswith', 'endswith', 'iendswith', 'exact', 'iexact'] p = 'is_builtin' i = 0 operators = ['ne', 'gt', 'gte', 'lt', 'lte', 'in', 'nin', 'mod', 'all', 'size', 'exists', 'not'] parts = ['is_builtin'] value = u'false' indices = [] _doc_cls = <class 'noc.inv.models.objectmodel.ObjectModel'> part = 'is_builtin' cls = <class 'mongoengine.queryset.QuerySet'> key = 'is_builtin' negate = False query = {'is_builtin': u'false'} custom_operators = ['match'] op = None ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 162) Function: visit_query 155 if combination.operation == combination.OR: 156 return {'$or': combination.children} 157 elif combination.operation == combination.AND: 158 return self._mongo_query_conjunction(combination.children) 159 return combination 160 161 def visit_query(self, query): 162 ==> return QuerySet._transform_query(self.document, **query.query) 163 164 def _mongo_query_conjunction(self, queries): 165 """Merges Mongo query dicts - effectively &ing them together. 166 """ 167 combined_query = {} 168 for query in queries: Variables: query = <mongoengine.queryset.Q object at 0x4f87b90> self = <mongoengine.queryset.QueryCompilerVisitor object at 0x4f5de90> ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 270) Function: accept 263 query structures. 264 """ 265 266 def __init__(self, **query): 267 self.query = query 268 269 def accept(self, visitor): 270 ==> return visitor.visit_query(self) 271 272 @property 273 def empty(self): 274 return not bool(self.query) 275 276 Variables: visitor = <mongoengine.queryset.QueryCompilerVisitor object at 0x4f5de90> self = <mongoengine.queryset.Q object at 0x4f87b90> ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 205) Function: to_query 198 199 AND = 0 200 OR = 1 201 202 def to_query(self, document): 203 query = self.accept(SimplificationVisitor()) 204 query = query.accept(QueryTreeTransformerVisitor()) 205 ==> query = query.accept(QueryCompilerVisitor(document)) 206 return query 207 208 def accept(self, visitor): 209 raise NotImplementedError 210 211 def _combine(self, other, operation): Variables: query = <mongoengine.queryset.Q object at 0x4f87b90> self = <mongoengine.queryset.Q object at 0x4f87b90> document = <class 'noc.inv.models.objectmodel.ObjectModel'> ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 379) Function: _query 372 setattr(c, prop, copy.deepcopy(val)) 373 374 return c 375 376 @property 377 def _query(self): 378 if self._mongo_query is None: 379 ==> self._mongo_query = self._query_obj.to_query(self._document) 380 if self._class_check: 381 self._mongo_query.update(self._initial_query) 382 return self._mongo_query 383 384 def ensure_index(self, key_or_list, drop_dups=False, background=False, 385 **kwargs): Variables: self = repr() failed ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 583) Function: _cursor 576 cursor_args['fields'] = self._loaded_fields.as_dict() 577 return cursor_args 578 579 @property 580 def _cursor(self): 581 if self._cursor_obj is None: 582 583 ==> self._cursor_obj = self._collection.find(self._query, 584 **self._cursor_args) 585 # Apply where clauses to cursor 586 if self._where_clause: 587 self._cursor_obj.where(self._where_clause) 588 589 # apply default ordering Variables: self = .. queryset mid-iteration .. ------------------------------------------------------------------------ File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 997) Function: count 990 self._cursor.rewind() 991 992 def count(self): 993 """Count the selected elements in the query. 994 """ 995 if self._limit == 0: 996 return 0 997 ==> return self._cursor.count(with_limit_and_skip=True) 998 999 def __len__(self): 1000 return self.count() 1001 1002 def map_reduce(self, map_f, reduce_f, output, finalize_f=None, limit=None, 1003 scope=None): Variables: self = .. queryset mid-iteration .. ------------------------------------------------------------------------ File: /opt/noc/lib/app/extapplication.py (Line: 157) Function: list_data 150 if hasattr(data, "_as_sql"): # For Models only 151 data = data.select_related() 152 # Apply sorting 153 ordering = ordering or self.default_ordering 154 if ordering: 155 data = data.order_by(*ordering) 156 if request.is_extjs: 157 ==> total = data.count() # Total unpaged count 158 if start is not None and limit is not None: 159 data = data[int(start):int(start) + int(limit)] 160 ld = len(data) 161 if self.row_limit and ld > self.row_limit: 162 # Request too large 163 return self.response( Variables: fs = None ordering = [] self = <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450> request = <WSGIRequest path:/inv/objectmodel/, GET:<QueryDict: {u'__limit': [u'43'], u'__start': [u'0'], u'__page': [u'1'], u'_dc': [u'1413880965170'], u'__format': [u'ext'], u'is_builtin': [u'false']}>, POST:<QueryDict: {}>, COOKIES:{'_ga': 'GA1.2.601433871.1399368775', 'csrftoken': 'NauEjyFMNisZAu2UEEGLVa3tyat4lMZF', 'sessionid': 'a773be5015cb264c84a20d3797086d33'}, META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'close', 'HTTP_COOKIE': '_ga=GA1.2.601433871.1399368775; csrftoken=NauEjyFMNisZAu2UEEGLVa3tyat4lMZF; sessionid=a773be5015cb264c84a20d3797086d33', 'HTTP_HOST': '127.0.0.1:8000', 'HTTP_REFERER': 'http://ncc.pu.ru/main/desktop/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0', 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest', 'PATH_INFO': u'/inv/objectmodel/', 'QUERY_STRING': '_dc=1413880965170&is_builtin=false&__format=ext&__page=1&__start=0&__limit=43', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': '127.0.0.1', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.0', 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x1b060c0>, 'wsgi.input': <_io.BytesIO object at 0x4f892f0>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> q = {'is_builtin': u'false'} start = u'0' only = None limit = u'43' query = None formatter = <bound method ObjectModelApplication.instance_to_dict of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450>> data = .. queryset mid-iteration .. fav_items = None ------------------------------------------------------------------------ File: /opt/noc/lib/app/extdocapplication.py (Line: 206) Function: api_list 199 return { 200 "id": str(o.id), 201 "label": unicode(o) 202 } 203 204 @view(method=["GET"], url="^$", access="read", api=True) 205 def api_list(self, request): 206 ==> return self.list_data(request, self.instance_to_dict) 207 208 @view(method=["GET"], url=r"^lookup/$", access="lookup", api=True) 209 def api_lookup(self, request): 210 return self.list_data(request, self.instance_to_lookup) 211 212 @view(method=["GET"], url=r"^tree_lookup/$", access="lookup", api=True) Variables: self = <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450> request = <WSGIRequest path:/inv/objectmodel/, GET:<QueryDict: {u'__limit': [u'43'], u'__start': [u'0'], u'__page': [u'1'], u'_dc': [u'1413880965170'], u'__format': [u'ext'], u'is_builtin': [u'false']}>, POST:<QueryDict: {}>, COOKIES:{'_ga': 'GA1.2.601433871.1399368775', 'csrftoken': 'NauEjyFMNisZAu2UEEGLVa3tyat4lMZF', 'sessionid': 'a773be5015cb264c84a20d3797086d33'}, META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'close', 'HTTP_COOKIE': '_ga=GA1.2.601433871.1399368775; csrftoken=NauEjyFMNisZAu2UEEGLVa3tyat4lMZF; sessionid=a773be5015cb264c84a20d3797086d33', 'HTTP_HOST': '127.0.0.1:8000', 'HTTP_REFERER': 'http://ncc.pu.ru/main/desktop/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0', 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest', 'PATH_INFO': u'/inv/objectmodel/', 'QUERY_STRING': '_dc=1413880965170&is_builtin=false&__format=ext&__page=1&__start=0&__limit=43', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': '127.0.0.1', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.0', 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x1b060c0>, 'wsgi.input': <_io.BytesIO object at 0x4f892f0>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> ------------------------------------------------------------------------ File: /opt/noc/lib/app/site.py (Line: 233) Function: inner 226 for k, v in request.POST.lists()) 227 elif request.method == "GET": 228 a = dict((k, v[0] if len(v) == 1 else v) 229 for k, v in request.GET.lists()) 230 logging.debug("API %s %s %s" % (request.method, 231 request.path, a)) 232 # Call handler 233 ==> r = v(request, *args, **kwargs) 234 # Dump SQL statements 235 if self.log_sql_statements: 236 from django.db import connections 237 tsc = 0 238 sc = defaultdict(int) 239 for conn in connections.all(): Variables: args = () view_map = {'GET': <bound method ObjectModelApplication.api_list of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450>>, 'POST': <bound method ObjectModelApplication.api_create of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450>>} Form = <class 'django.forms.forms.Form'> DictParameter = <class 'noc.sa.interfaces.base.DictParameter'> self = <noc.lib.app.site.Site object at 0x24bbcd0> v = <bound method ObjectModelApplication.api_list of <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450>> request = <WSGIRequest path:/inv/objectmodel/, GET:<QueryDict: {u'__limit': [u'43'], u'__start': [u'0'], u'__page': [u'1'], u'_dc': [u'1413880965170'], u'__format': [u'ext'], u'is_builtin': [u'false']}>, POST:<QueryDict: {}>, COOKIES:{'_ga': 'GA1.2.601433871.1399368775', 'csrftoken': 'NauEjyFMNisZAu2UEEGLVa3tyat4lMZF', 'sessionid': 'a773be5015cb264c84a20d3797086d33'}, META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING': 'gzip, deflate', 'HTTP_ACCEPT_LANGUAGE': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3', 'HTTP_CONNECTION': 'close', 'HTTP_COOKIE': '_ga=GA1.2.601433871.1399368775; csrftoken=NauEjyFMNisZAu2UEEGLVa3tyat4lMZF; sessionid=a773be5015cb264c84a20d3797086d33', 'HTTP_HOST': '127.0.0.1:8000', 'HTTP_REFERER': 'http://ncc.pu.ru/main/desktop/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0', 'HTTP_X_REQUESTED_WITH': 'XMLHttpRequest', 'PATH_INFO': u'/inv/objectmodel/', 'QUERY_STRING': '_dc=1413880965170&is_builtin=false&__format=ext&__page=1&__start=0&__limit=43', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': '127.0.0.1', 'SERVER_PORT': '8000', 'SERVER_PROTOCOL': 'HTTP/1.0', 'wsgi.errors': <open file '/dev/null', mode 'a+' at 0x1b060c0>, 'wsgi.input': <_io.BytesIO object at 0x4f892f0>, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}> InterfaceTypeError = <class 'noc.sa.interfaces.base.InterfaceTypeError'> to_log_api_call = False kwargs = {} PermissionDenied = <class 'noc.lib.app.access.PermissionDenied'> app = <noc.inv.apps.objectmodel.views.ObjectModelApplication object at 0x47b7450> ------------------------------------------------------------------------ END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment