Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2014-03-30 16:24:30.952257)
- 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.fm.models.eventclassificationrule.EventClassificationRule'>
- 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 = False
- indices = []
- _doc_cls = <class 'noc.fm.models.eventclassificationrule.EventClassificationRule'>
- part = 'is_builtin'
- cls = <class 'mongoengine.queryset.QuerySet'>
- key = 'is_builtin'
- negate = False
- query = {'is_builtin': 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 0x68d0cd0>
- self = <mongoengine.queryset.QueryCompilerVisitor object at 0x68d0a50>
- ------------------------------------------------------------------------
- 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 0x68d0a50>
- self = <mongoengine.queryset.Q object at 0x68d0cd0>
- ------------------------------------------------------------------------
- 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 0x68d0cd0>
- self = <mongoengine.queryset.Q object at 0x68d0cd0>
- document = <class 'noc.fm.models.eventclassificationrule.EventClassificationRule'>
- ------------------------------------------------------------------------
- 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: 990)
- Function: rewind
- 983
- 984 def rewind(self):
- 985 """Rewind the cursor to its unevaluated state.
- 986
- 987 .. versionadded:: 0.3
- 988 """
- 989 self._iter = False
- 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
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/mongoengine/queryset.py (Line: 1517)
- Function: __iter__
- 1510
- 1511 if ret is not None and 'n' in ret:
- 1512 return ret['n']
- 1513 except pymongo.errors.OperationFailure, e:
- 1514 raise OperationError(u'Update failed [%s]' % unicode(e))
- 1515
- 1516 def __iter__(self):
- 1517 ==> self.rewind()
- 1518 return self
- 1519
- 1520 def _get_scalar(self, doc):
- 1521
- 1522 def lookup(obj, name):
- 1523 chunks = name.split('__')
- Variables:
- self = .. queryset mid-iteration ..
- ------------------------------------------------------------------------
- File: /opt/noc/fm/apps/reportlocalrules/views.py (Line: 22)
- Function: report_html
- 15
- 16 class ReportClassificationRules(ReportApplication):
- 17 title = "Local Classification Rules (JSON)"
- 18
- 19 def report_html(self):
- 20 r = ["["]
- 21 r += [",\n".join([indent(r.to_json())
- 22 ==> for r in EventClassificationRule.objects.filter(is_builtin=False)])]
- 23 r += ["]",""]
- 24 return "<pre>" + escape("\n".join(r)) + "</pre>"
- Variables:
- self =
- <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>
- r = ['[']
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/reportapplication.py (Line: 81)
- Function: view_report
- 74 else:
- 75 form = form_class()
- 76 # No POST or error - render form
- 77 if not query:
- 78 return self.render(request, "report_form.html",
- 79 form=form, app=self, is_report=True)
- 80 # Build result
- 81 ==> rdata = getattr(self, "report_%s" % format)(**query)
- 82 # Render result
- 83 if format == "html":
- 84 return self.render(request, "report.html",
- 85 data=rdata, app=self, is_report=True)
- 86 else:
- 87 return self.render_response(rdata,
- Variables:
- query = {}
- self =
- <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>
- request =
- <WSGIRequest
- path:/fm/reportlocalrules/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'sessionid': 'c61dac282d554ec640a9a3d665701442'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=c61dac282d554ec640a9a3d665701442',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://192.168.0.251/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
- 'PATH_INFO': u'/fm/reportlocalrules/',
- 'QUERY_STRING': '',
- '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 0x2deff60>,
- 'wsgi.input': <_io.BytesIO object at 0x6d0c170>,
- 'wsgi.multiprocess': True,
- 'wsgi.multithread': False,
- 'wsgi.run_once': False,
- 'wsgi.url_scheme': 'http',
- 'wsgi.version': (1, 0)}>
- form_class = None
- format = 'html'
- ------------------------------------------------------------------------
- File: /opt/noc/lib/app/site.py (Line: 232)
- Function: inner
- 225 for k, v in request.POST.lists())
- 226 elif request.method == "GET":
- 227 a = dict((k, v[0] if len(v) == 1 else v)
- 228 for k, v in request.GET.lists())
- 229 logging.debug("API %s %s %s" % (request.method,
- 230 request.path, a))
- 231 # Call handler
- 232 ==> r = v(request, *args, **kwargs)
- 233 # Dump SQL statements
- 234 if self.log_sql_statements:
- 235 from django.db import connections
- 236 tsc = 0
- 237 sc = defaultdict(int)
- 238 for conn in connections.all():
- Variables:
- args = ()
- view_map =
- {'DELETE': <bound method ReportClassificationRules.view_report of <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>>,
- 'GET': <bound method ReportClassificationRules.view_report of <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>>,
- 'POST': <bound method ReportClassificationRules.view_report of <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>>,
- 'PUT': <bound method ReportClassificationRules.view_report of <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>>}
- Form = <class 'django.forms.forms.Form'>
- DictParameter = <class 'noc.sa.interfaces.base.DictParameter'>
- self = <noc.lib.app.site.Site object at 0x37d57d0>
- v =
- <bound method ReportClassificationRules.view_report of <noc.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>>
- request =
- <WSGIRequest
- path:/fm/reportlocalrules/,
- GET:<QueryDict: {}>,
- POST:<QueryDict: {}>,
- COOKIES:{'sessionid': 'c61dac282d554ec640a9a3d665701442'},
- META:{'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
- 'HTTP_ACCEPT_ENCODING': 'gzip, deflate',
- 'HTTP_ACCEPT_LANGUAGE': 'en-US,en;q=0.5',
- 'HTTP_CONNECTION': 'close',
- 'HTTP_COOKIE': 'sessionid=c61dac282d554ec640a9a3d665701442',
- 'HTTP_HOST': '127.0.0.1:8000',
- 'HTTP_REFERER': 'http://192.168.0.251/main/desktop/',
- 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0',
- 'PATH_INFO': u'/fm/reportlocalrules/',
- 'QUERY_STRING': '',
- '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 0x2deff60>,
- 'wsgi.input': <_io.BytesIO object at 0x6d0c170>,
- '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.fm.apps.reportlocalrules.views.ReportClassificationRules object at 0x5caa390>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment