Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Synchronize collections
- ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2015-04-09 09:43:39.995428)
- BRANCH: None TIP: None
- PROCESS: manage.py
- ERROR FINGERPRINT: 81a9bbad-f825-5ad3-bf1e-b9b0ae9f29b2
- WORKING DIRECTORY: /usr/local/noc
- EXCEPTION: <class 'mongoengine.errors.FieldDoesNotExist'> The field 'is_builtin' does not exist on the document 'OIDAlias'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/mongoengine/base/document.py (Line: 81)
- Function: __init__
- 74 # Exception.
- 75 if not self._dynamic:
- 76 for var in values.keys():
- 77 if var not in self._fields.keys() + ['id', 'pk', '_cls', '_text_score']:
- 78 msg = (
- 79 "The field '{0}' does not exist on the document '{1}'"
- 80 ).format(var, self._class_name)
- 81 ==> raise FieldDoesNotExist(msg)
- 82
- 83 if self.STRICT and not self._dynamic:
- 84 self._data = StrictDict.create(allowed_keys=self._fields_ordered)()
- 85 else:
- 86 self._data = SemiStrictDict.create(
- 87 allowed_keys=self._fields_ordered)()
- Variables:
- self = repr() failed
- args = ()
- var = u'is_builtin'
- values =
- {'id': ObjectId('4eeb5058bcf4b106a3000099'),
- u'is_builtin': True,
- u'rewrite_oid': u'1.3.6.1.4.1.259.8.1.5',
- u'to_oid': u'1.3.6.1.4.1.259.6.10.94',
- u'uuid': UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')}
- _BaseDocument__auto_convert = False
- msg = "The field 'is_builtin' does not exist on the document 'OIDAlias'"
- _created = False
- _BaseDocument__only_fields = set([])
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/mongoengine/base/document.py (Line: 709)
- Function: _from_son
- 702 msg = ("Invalid data to create a `%s` instance.\n%s"
- 703 % (cls._class_name, errors))
- 704 raise InvalidDocumentError(msg)
- 705
- 706 if cls.STRICT:
- 707 data = dict((k, v)
- 708 for k, v in data.iteritems() if k in cls._fields)
- 709 ==> obj = cls(__auto_convert=False, _created=created, __only_fields=only_fields, **data)
- 710 obj._changed_fields = changed_fields
- 711 if not _auto_dereference:
- 712 obj._fields = fields
- 713
- 714 return obj
- 715
- Variables:
- only_fields = []
- changed_fields = []
- created = False
- class_name = 'OIDAlias'
- fields =
- {'description': <mongoengine.fields.StringField object at 0x80a2c6090>,
- 'id': <mongoengine.base.fields.ObjectIdField object at 0x80a2c6150>,
- 'rewrite_oid': <mongoengine.fields.StringField object at 0x80a2bcf10>,
- 'to_oid': <mongoengine.fields.StringField object at 0x80a2c6050>,
- 'uuid': <mongoengine.fields.UUIDField object at 0x80a2c60d0>}
- errors_dict = {}
- value = UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')
- data =
- {'id': ObjectId('4eeb5058bcf4b106a3000099'),
- u'is_builtin': True,
- u'rewrite_oid': u'1.3.6.1.4.1.259.8.1.5',
- u'to_oid': u'1.3.6.1.4.1.259.6.10.94',
- u'uuid': UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')}
- field = <mongoengine.fields.StringField object at 0x80a2c6090>
- _auto_dereference = True
- son =
- {u'_id': ObjectId('4eeb5058bcf4b106a3000099'),
- u'is_builtin': True,
- u'rewrite_oid': u'1.3.6.1.4.1.259.8.1.5',
- u'to_oid': u'1.3.6.1.4.1.259.6.10.94',
- u'uuid': UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')}
- field_name = 'description'
- cls = <class 'noc.fm.models.oidalias.OIDAlias'>
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/mongoengine/queryset/base.py (Line: 161)
- Function: __getitem__
- 154 queryset._document._from_son(queryset._cursor[key],
- 155 _auto_dereference=self._auto_dereference,
- 156 only_fields=self.only_fields))
- 157
- 158 if queryset._as_pymongo:
- 159 return queryset._get_as_pymongo(queryset._cursor[key])
- 160 return queryset._document._from_son(queryset._cursor[key],
- 161 ==> _auto_dereference=self._auto_dereference, only_fields=self.only_fields)
- 162
- 163 raise AttributeError
- 164
- 165 def __iter__(self):
- 166 raise NotImplementedError
- 167
- Variables:
- self = repr() failed
- queryset = repr() failed
- key = 0
- ------------------------------------------------------------------------
- File: lib/python2.7/site-packages/mongoengine/queryset/base.py (Line: 309)
- Function: first
- 302 return doc, True
- 303
- 304 def first(self):
- 305 """Retrieve the first object matching the query.
- 306 """
- 307 queryset = self.clone()
- 308 try:
- 309 ==> result = queryset[0]
- 310 except IndexError:
- 311 result = None
- 312 return result
- 313
- 314 def insert(self, doc_or_docs, load_bulk=True, write_concern=None):
- 315 """bulk insert documents
- Variables:
- self = repr() failed
- queryset = []
- ------------------------------------------------------------------------
- File: lib/collection.py (Line: 205)
- Function: get_by_uuid
- 198 del self.items[u]
- 199 self.changed = True
- 200
- 201 def get_by_uuid(self, u):
- 202 """
- 203 Returns object instance or None
- 204 """
- 205 ==> d = self.doc.objects.filter(uuid=u).first()
- 206 if d:
- 207 return d
- 208 else:
- 209 # Try to fix UUID
- 210 c = self.doc._get_collection()
- 211 d = c.find_one({"uuid": str(u)})
- Variables:
- self = <noc.lib.collection.Collection object at 0x80a595c10>
- u = UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')
- ------------------------------------------------------------------------
- File: lib/collection.py (Line: 357)
- Function: upgrade_item
- 350 """
- 351 def upgrade_item(u):
- 352 d = self.load_item(collection.items[u])
- 353 if d is None:
- 354 p = self.get_item_path(collection.items[u])
- 355 self.die("File not found: %s" % p)
- 356 d = self.dereference(self.doc, d)
- 357 ==> o = self.get_by_uuid(d["uuid"])
- 358 if o:
- 359 return # Already upgraded
- 360 for un in unique:
- 361 o = self.doc.objects.filter(**{un: d[un]}).first()
- 362 if o:
- 363 self.logger.info("Upgrading %s", unicode(o))
- Variables:
- self = <noc.lib.collection.Collection object at 0x80a595c10>
- unique = set(['rewrite_oid'])
- u = UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')
- d =
- {'rewrite_oid': '1.3.6.1.4.1.259.8.1.5',
- 'to_oid': '1.3.6.1.4.1.259.6.10.94',
- 'uuid': UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')}
- collection = <noc.lib.collection.Collection object at 0x80a5953d0>
- ------------------------------------------------------------------------
- File: lib/collection.py (Line: 382)
- Function: upgrade_collection
- 375 if not unique:
- 376 for spec in self.doc._meta["index_specs"]:
- 377 if spec.get("unique") and len(spec["fields"]) == 1:
- 378 unique.add(spec["fields"][0][0])
- 379 break
- 380 for u in collection.items:
- 381 try:
- 382 ==> upgrade_item(u)
- 383 except DereferenceError:
- 384 pass
- 385
- 386 def install_item(self, data, load=False):
- 387 o = self.doc(**self.dereference(self.doc, data))
- 388 self.logger.info("Installing %s", unicode(o))
- Variables:
- f = 'rewrite_oid'
- self = <noc.lib.collection.Collection object at 0x80a595c10>
- collection = <noc.lib.collection.Collection object at 0x80a5953d0>
- u = UUID('0652ed85-1c9b-4a65-9e2d-5d2ce062e263')
- upgrade_item = <function upgrade_item at 0x80a534cf8>
- unique = set(['rewrite_oid'])
- spec = {'fields': [('rewrite_oid', 1)], 'unique': True, 'sparse': False}
- _ = 1
- ------------------------------------------------------------------------
- File: lib/collection.py (Line: 171)
- Function: apply
- 164 ## Apply migration sequences
- 165 for f, u in LEGACY_COLLECTIONS[self.name]:
- 166 self.doc._get_collection().update(f, u)
- 167 ##
- 168 self.upgrade_collection(collection)
- 169 if not self.items:
- 170 # Empty local file, needs to upgrade collection first
- 171 ==> self.upgrade_collection(collection)
- 172 self.logger.debug("Syncing %s.%s" % (self.module, self.name))
- 173 sl = set(self.items)
- 174 sr = set(collection.items)
- 175 # Delete revoked items
- 176 for i in collection.get_revoked_items():
- 177 if i in self.items:
- Variables:
- self = <noc.lib.collection.Collection object at 0x80a595c10>
- collection = <noc.lib.collection.Collection object at 0x80a5953d0>
- ------------------------------------------------------------------------
- File: main/management/commands/collection.py (Line: 182)
- Function: handle_sync
- 175 DocCategory.fix_all()
- 176 try:
- 177 for name, doc in self.collections:
- 178 lc = Collection(name, doc, local=True)
- 179 lc.load()
- 180 dc = Collection(name, doc)
- 181 dc.load()
- 182 ==> lc.apply(dc)
- 183 except ValueError, why:
- 184 raise CommandError(why)
- 185 except DereferenceError, why:
- 186 raise CommandError(why)
- 187
- 188 def handle_upgrade(self, collections):
- Variables:
- doc = <class 'noc.fm.models.oidalias.OIDAlias'>
- self = <noc.main.management.commands.collection.Command object at 0x80a3954d0>
- dc = <noc.lib.collection.Collection object at 0x80a5953d0>
- name = 'fm.oidaliases'
- lc = <noc.lib.collection.Collection object at 0x80a595c10>
- ------------------------------------------------------------------------
- File: main/management/commands/collection.py (Line: 146)
- Function: _handle
- 139 except:
- 140 error_report()
- 141 sys.exit(1)
- 142
- 143 def _handle(self, *args, **options):
- 144 self.verbose = bool(options.get("verbosity"))
- 145 if options["cmd"] == "sync":
- 146 ==> return self.handle_sync()
- 147 elif options["cmd"] == "upgrade":
- 148 return self.handle_upgrade(args)
- 149 elif options["cmd"] == "install":
- 150 if len(args) < 2:
- 151 parts = args[0].split(os.path.sep)
- 152 if (len(parts) < 2 or parts[1] != "collections"):
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x80a3954d0>
- args = ()
- options =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- File: main/management/commands/collection.py (Line: 136)
- Function: handle
- 129 msg = "%s\nAvailable collections:" % msg
- 130 for n, d in self.collections:
- 131 msg = "%s\n %s" % (msg, n)
- 132 return msg
- 133
- 134 def handle(self, *args, **kwargs):
- 135 try:
- 136 ==> self._handle(*args, **kwargs)
- 137 except CommandError:
- 138 raise
- 139 except:
- 140 error_report()
- 141 sys.exit(1)
- 142
- Variables:
- self = <noc.main.management.commands.collection.Command object at 0x80a3954d0>
- args = ()
- kwargs =
- {'cmd': 'sync',
- 'pythonpath': None,
- 'settings': None,
- 'traceback': None,
- 'verbosity': '1'}
- ------------------------------------------------------------------------
- END OF TRACEBACK
- ERROR:noc.lib.debug:Writing CP report to local/cp/crashinfo/new/81a9bbad-f825-5ad3-bf1e-b9b0ae9f29b2.json
- upgrade-user: 45: collection --sync failed
- Terminating
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement