Advertisement
Guest User

Untitled

a guest
Dec 4th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.32 KB | None | 0 0
  1. Not synced (use migrations):
  2. - noc.main
  3. - noc.project
  4. - noc.gis
  5. - noc.inv
  6. - noc.sa
  7. - noc.fm
  8. - noc.pm
  9. - noc.cm
  10. - noc.ip
  11. - noc.vc
  12. - noc.dns
  13. - noc.peer
  14. - noc.kb
  15. (use ./manage.py migrate to migrate these)
  16. Migrating database
  17. Running migrations for main:
  18. - Nothing to migrate.
  19. - Loading initial data for main.
  20. Installed 0 object(s) from 0 fixture(s)
  21. Running migrations for project:
  22. - Nothing to migrate.
  23. - Loading initial data for project.
  24. Installed 0 object(s) from 0 fixture(s)
  25. Running migrations for gis:
  26. - Nothing to migrate.
  27. - Loading initial data for gis.
  28. Installed 0 object(s) from 0 fixture(s)
  29. Running migrations for inv:
  30. - Nothing to migrate.
  31. - Loading initial data for inv.
  32. Installed 0 object(s) from 0 fixture(s)
  33. Running migrations for sa:
  34. - Nothing to migrate.
  35. - Loading initial data for sa.
  36. Installed 0 object(s) from 0 fixture(s)
  37. Running migrations for fm:
  38. - Nothing to migrate.
  39. - Loading initial data for fm.
  40. Installed 0 object(s) from 0 fixture(s)
  41. Running migrations for pm:
  42. - Nothing to migrate.
  43. - Loading initial data for pm.
  44. Installed 0 object(s) from 0 fixture(s)
  45. Running migrations for cm:
  46. - Nothing to migrate.
  47. - Loading initial data for cm.
  48. Installed 0 object(s) from 0 fixture(s)
  49. Running migrations for ip:
  50. - Nothing to migrate.
  51. - Loading initial data for ip.
  52. Installed 0 object(s) from 0 fixture(s)
  53. Running migrations for vc:
  54. - Nothing to migrate.
  55. - Loading initial data for vc.
  56. Installed 0 object(s) from 0 fixture(s)
  57. Running migrations for dns:
  58. - Nothing to migrate.
  59. - Loading initial data for dns.
  60. Installed 0 object(s) from 0 fixture(s)
  61. Running migrations for peer:
  62. - Nothing to migrate.
  63. - Loading initial data for peer.
  64. Installed 0 object(s) from 0 fixture(s)
  65. Running migrations for kb:
  66. - Nothing to migrate.
  67. - Loading initial data for kb.
  68. Installed 0 object(s) from 0 fixture(s)
  69. Synchronize collections
  70. ERROR:noc.lib.debug:UNHANDLED EXCEPTION (2014-12-04 13:46:47.254390)
  71. Working directory: /opt/noc
  72. <class 'mongoengine.errors.NotUniqueError'>
  73. Tried to save duplicate unique keys (E11000 duplicate key error index: noc.noc.vendors.$name_1 dup key: { : "D-Link" })
  74. START OF TRACEBACK
  75. ------------------------------------------------------------------------
  76. File: /opt/noc/lib/python2.7/site-packages/mongoengine/document.py (Line: 286)
  77. Function: save
  78. 279 }
  79. 280 if cascade_kwargs: # Allow granular control over cascades
  80. 281 kwargs.update(cascade_kwargs)
  81. 282 kwargs['_refs'] = _refs
  82. 283 self.cascade_save(**kwargs)
  83. 284 except pymongo.errors.DuplicateKeyError, err:
  84. 285 message = u'Tried to save duplicate unique keys (%s)'
  85. 286 ==> raise NotUniqueError(message % unicode(err))
  86. 287 except pymongo.errors.OperationFailure, err:
  87. 288 message = 'Could not save document (%s)'
  88. 289 if re.match('^E1100[01] duplicate key', unicode(err)):
  89. 290 # E11000 - duplicate key error index
  90. 291 # E11001 - duplicate key on update
  91. 292 message = u'Tried to save duplicate unique keys (%s)'
  92. Variables:
  93. clean = True
  94. err =
  95. DuplicateKeyError(u'E11000 duplicate key error index: noc.noc.vendors.$name_1 dup key: { : "D-Link" }',)
  96. force_insert = False
  97. doc =
  98. SON([('name', u'D-Link'), ('code', u'DLINK'), ('site', u'http://www.dlink.com/'), ('uuid', UUID('deaacf21-325b-4b62-94d1-b8f3123e8f21')), ('_id', ObjectId('54803b974a5e685beb895ca0'))])
  99. self = <Vendor: D-Link>
  100. created = True
  101. _refs = None
  102. collection =
  103. Collection(Database(MongoClient('localhost', 27017), u'noc'), u'noc.vendors')
  104. cascade = None
  105. write_concern = {'w': 1}
  106. cascade_kwargs = None
  107. kwargs = {}
  108. message = u'Tried to save duplicate unique keys (%s)'
  109. validate = True
  110. ------------------------------------------------------------------------
  111. File: /opt/noc/lib/collection.py (Line: 218)
  112. Function: update_item
  113. 211 if o:
  114. 212 # Update fields
  115. 213 for k in d:
  116. 214 setattr(o, k, d[k])
  117. 215 else:
  118. 216 # Create item
  119. 217 o = self.doc(**d)
  120. 218 ==> o.save()
  121. 219 self.items[mi.uuid] = mi
  122. 220 self.changed = True
  123. 221
  124. 222 def lookup(self, ref, field, key):
  125. 223 field = str(field)
  126. 224 if ref not in self.ref_cache:
  127. Variables:
  128. mi =
  129. CollectionItem(name='D-Link', uuid=UUID('deaacf21-325b-4b62-94d1-b8f3123e8f21'), path='DLINK.json', hash='1e0d7b170975361042d595ba7c75f3799bbf5399fe2159e49e187935b7c27903')
  130. self = <noc.lib.collection.Collection object at 0x397acd0>
  131. data =
  132. {'code': 'DLINK',
  133. 'name': 'D-Link',
  134. 'site': 'http://www.dlink.com/',
  135. 'uuid': 'deaacf21-325b-4b62-94d1-b8f3123e8f21'}
  136. d =
  137. {'code': 'DLINK',
  138. 'name': 'D-Link',
  139. 'site': 'http://www.dlink.com/',
  140. 'uuid': UUID('deaacf21-325b-4b62-94d1-b8f3123e8f21')}
  141. o = <Vendor: D-Link>
  142. ------------------------------------------------------------------------
  143. File: /opt/noc/lib/collection.py (Line: 162)
  144. Function: apply
  145. 155 sr = set(collection.items)
  146. 156 # Delete revoked items
  147. 157 for i in collection.get_revoked_items():
  148. 158 if i in self.items:
  149. 159 self.delete_item(i)
  150. 160 # Check for new items
  151. 161 for i in sr - sl:
  152. 162 ==> self.update_item(collection.items[i])
  153. 163 # Update changed items
  154. 164 for i in sr & sl:
  155. 165 if self.items[i].hash != collection.items[i].hash:
  156. 166 self.update_item(collection.items[i])
  157. 167 # Update partial items
  158. 168 for i in self.partial:
  159. Variables:
  160. i = UUID('deaacf21-325b-4b62-94d1-b8f3123e8f21')
  161. sr =
  162. set([UUID('0018a846-e3ad-4fa7-9352-6ac2e64b3048'),
  163. UUID('2f9cc9f6-19a1-4abf-86ac-7906065475d3'),
  164. UUID('393be551-8335-476d-b73d-f83aae285b37'),
  165. UUID('3b613993-3c19-4b04-9bd5-fcf01b7efecd'),
  166. UUID('43ca9798-c7ef-4f2f-ac9d-b1b547bb058f'),
  167. UUID('4d248e16-d835-4bac-8e01-a696d37c1761'),
  168. UUID('5000319a-cc5f-46f1-b2f4-23277db14ad6'),
  169. UUID('65634396-7826-4bfb-8092-5ed300e25445'),
  170. UUID('66e079d1-2fdd-4172-b850-c9359e55bbae'),
  171. UUID('6c888d44-b1dc-46d3-92a3-3e55f652b881'),
  172. UUID('6d0ea90b-6184-42c3-87a8-9f4271bf2383'),
  173. UUID('6e506a22-6f51-4b04-8e2f-3f240643d668'),
  174. UUID('770da8a7-df6c-4b28-9d66-a8c803cee5b2'),
  175. UUID('78305fbb-2cb2-4f67-8e94-659616856424'),
  176. UUID('89b344f1-14ae-4e2b-9c98-4eea13509f15'),
  177. UUID('8c5a642f-67b3-475a-ba39-b4835f7ead55'),
  178. UUID('9ae510be-7f03-4ff5-89f2-3504187762fe'),
  179. UUID('ae42a900-7e76-4cfe-93c3-21e3c7c9b1ba'),
  180. UUID('b06d7df2-e4d8-4697-aa24-6317530417f0'),
  181. UUID('b552bd2d-68b8-427b-a0f6-3775399cc7da'),
  182. UUID('b6af93da-bea4-40c2-8149-90172471b721'),
  183. UUID('b704b0b3-ba91-4a87-9d17-a8b92182e5be'),
  184. UUID('b8e63d51-ee3c-4e93-a782-27ae730be17f'),
  185. UUID('b98546f4-270d-4c3c-892f-25a5babc0af3'),
  186. UUID('befdf816-0aee-47c1-b84f-f93f0a7f6b79'),
  187. UUID('deaacf21-325b-4b62-94d1-b8f3123e8f21'),
  188. UUID('e5e779a2-3c25-4ba4-8644-10dd43ea7c0a'),
  189. UUID('eaffacec-f2ea-469f-90fa-6fafba9f9bbf'),
  190. UUID('ebae01bb-4677-4aee-a844-0161c5585a37'),
  191. UUID('eccf0b1f-349e-449c-8ead-0209b0df36a0'),
  192. UUID('ee35ecb4-0217-4f89-9196-6afd127322c3'),
  193. UUID('fa69f993-53ef-452e-a866-4df0e3dff3a5')])
  194. self = <noc.lib.collection.Collection object at 0x397acd0>
  195. collection = <noc.lib.collection.Collection object at 0x397a750>
  196. sl = set([])
  197. ------------------------------------------------------------------------
  198. File: /opt/noc/main/management/commands/collection.py (Line: 177)
  199. Function: handle_sync
  200. 170 DocCategory.fix_all()
  201. 171 try:
  202. 172 for name, doc in self.collections:
  203. 173 lc = Collection(name, doc, local=True)
  204. 174 lc.load()
  205. 175 dc = Collection(name, doc)
  206. 176 dc.load()
  207. 177 ==> lc.apply(dc)
  208. 178 except ValueError, why:
  209. 179 raise CommandError(why)
  210. 180 except DereferenceError, why:
  211. 181 raise CommandError(why)
  212. 182
  213. 183 def handle_upgrade(self, collections):
  214. Variables:
  215. doc = <class 'noc.inv.models.vendor.Vendor'>
  216. self = <noc.main.management.commands.collection.Command object at 0x373d0d0>
  217. dc = <noc.lib.collection.Collection object at 0x397a750>
  218. name = 'inv.vendors'
  219. lc = <noc.lib.collection.Collection object at 0x397acd0>
  220. ------------------------------------------------------------------------
  221. File: /opt/noc/main/management/commands/collection.py (Line: 141)
  222. Function: _handle
  223. 134 raise
  224. 135 except:
  225. 136 error_report()
  226. 137
  227. 138 def _handle(self, *args, **options):
  228. 139 self.verbose = bool(options.get("verbosity"))
  229. 140 if options["cmd"] == "sync":
  230. 141 ==> return self.handle_sync()
  231. 142 elif options["cmd"] == "upgrade":
  232. 143 return self.handle_upgrade(args)
  233. 144 elif options["cmd"] == "install":
  234. 145 if len(args) < 2:
  235. 146 parts = args[0].split(os.path.sep)
  236. 147 if (len(parts) < 2 or parts[1] != "collections"):
  237. Variables:
  238. self = <noc.main.management.commands.collection.Command object at 0x373d0d0>
  239. args = ()
  240. options =
  241. {'cmd': 'sync',
  242. 'pythonpath': None,
  243. 'settings': None,
  244. 'traceback': None,
  245. 'verbosity': '1'}
  246. ------------------------------------------------------------------------
  247. File: /opt/noc/main/management/commands/collection.py (Line: 132)
  248. Function: handle
  249. 125 msg = "%s\nAvailable collections:" % msg
  250. 126 for n, d in self.collections:
  251. 127 msg = "%s\n %s" % (msg, n)
  252. 128 return msg
  253. 129
  254. 130 def handle(self, *args, **kwargs):
  255. 131 try:
  256. 132 ==> self._handle(*args, **kwargs)
  257. 133 except CommandError:
  258. 134 raise
  259. 135 except:
  260. 136 error_report()
  261. 137
  262. 138 def _handle(self, *args, **options):
  263. Variables:
  264. self = <noc.main.management.commands.collection.Command object at 0x373d0d0>
  265. args = ()
  266. kwargs =
  267. {'cmd': 'sync',
  268. 'pythonpath': None,
  269. 'settings': None,
  270. 'traceback': None,
  271. 'verbosity': '1'}
  272. ------------------------------------------------------------------------
  273. END OF TRACEBACK
  274. Synchronizing pyRules
  275. Traceback (most recent call last):
  276. File "manage.py", line 35, in <module>
  277. import noc.urls
  278. File "/opt/noc/urls.py", line 18, in <module>
  279. site.autodiscover()
  280. File "/opt/noc/lib/app/site.py", line 473, in autodiscover
  281. {}, {}, "*")
  282. File "/opt/noc/inv/apps/inv/views.py", line 21, in <module>
  283. class InvApplication(ExtApplication):
  284. File "/opt/noc/lib/app/application.py", line 109, in __new__
  285. site.register(m)
  286. File "/opt/noc/lib/app/site.py", line 381, in register
  287. app = app_class(self)
  288. File "/opt/noc/inv/apps/inv/views.py", line 52, in __init__
  289. self.plugins[o.name] = o(self)
  290. File "/opt/noc/inv/apps/inv/plugins/base.py", line 22, in __init__
  291. self.init_plugin()
  292. File "/opt/noc/inv/apps/inv/plugins/conduits.py", line 61, in init_plugin
  293. self.conduits_model = ObjectModel.objects.get(name=self.CONDUITS_MODEL)
  294. File "/opt/noc/lib/python2.7/site-packages/mongoengine/queryset/base.py", line 186, in get
  295. raise queryset._document.DoesNotExist(msg)
  296. noc.inv.models.objectmodel.DoesNotExist: ObjectModel matching query does not exist.
  297. -e upgrade-user: : sync-pyrules failed
  298. Terminating
  299. upgrade complete
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement