Advertisement
Guest User

Untitled

a guest
Oct 8th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.10 KB | None | 0 0
  1. UNHANDLED EXCEPTION (2012-10-08 12:02:33.508222)
  2. Working directory: /opt/noc
  3. <class 'django.db.utils.IntegrityError'>
  4. insert or update on table "sa_maptask" violates foreign key constraint "task_id_refs_id_193c71167fb7d148"
  5. DETAIL: Key (task_id)=(939552) is not present in table "sa_reducetask".
  6.  
  7. START OF TRACEBACK
  8. ------------------------------------------------------------------------
  9. File: /opt/noc/contrib/lib/django/db/backends/postgresql_psycopg2/base.py (Line: 235)
  10. Function: _commit
  11. 228 finally:
  12. 229 self.isolation_level = level
  13. 230 self.features.uses_savepoints = bool(level)
  14. 231
  15. 232 def _commit(self):
  16. 233 if self.connection is not None:
  17. 234 try:
  18. 235 ==> return self.connection.commit()
  19. 236 except Database.IntegrityError, e:
  20. 237 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
  21. Variables:
  22. self = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
  23. e = IntegrityError('insert or update on table "sa_maptask" violates foreign key constraint "task_id_refs_id_193c71167fb7d148"\u005cnDETAIL: Key (task_id)=(939552) is not present in table "sa_reducetask".\u005cn',)
  24. ------------------------------------------------------------------------
  25. File: /opt/noc/contrib/lib/django/db/backends/__init__.py (Line: 203)
  26. Function: commit_unless_managed
  27. 196
  28. 197 def commit_unless_managed(self):
  29. 198 """
  30. 199 Commits changes if the system is not in managed transaction mode.
  31. 200 """
  32. 201 self.validate_thread_sharing()
  33. 202 if not self.is_managed():
  34. 203 ==> self._commit()
  35. 204 self.clean_savepoints()
  36. 205 else:
  37. 206 self.set_dirty()
  38. 207
  39. 208 def rollback_unless_managed(self):
  40. 209 """
  41. Variables:
  42. self = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
  43. ------------------------------------------------------------------------
  44. File: /opt/noc/contrib/lib/django/db/transaction.py (Line: 120)
  45. Function: commit_unless_managed
  46. 113 def commit_unless_managed(using=None):
  47. 114 """
  48. 115 Commits changes if the system is not in managed transaction mode.
  49. 116 """
  50. 117 if using is None:
  51. 118 using = DEFAULT_DB_ALIAS
  52. 119 connection = connections[using]
  53. 120 ==> connection.commit_unless_managed()
  54. 121
  55. 122 def rollback_unless_managed(using=None):
  56. 123 """
  57. 124 Rolls back changes if the system is not in managed transaction mode.
  58. 125 """
  59. 126 if using is None:
  60. Variables:
  61. using = 'default'
  62. connection = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
  63. ------------------------------------------------------------------------
  64. File: /opt/noc/contrib/lib/django/db/models/base.py (Line: 555)
  65. Function: save_base
  66. 548 record_exists = False
  67. 549
  68. 550 update_pk = bool(meta.has_auto_field and not pk_set)
  69. 551 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
  70. 552
  71. 553 if update_pk:
  72. 554 setattr(self, meta.pk.attname, result)
  73. 555 ==> transaction.commit_unless_managed(using=using)
  74. 556
  75. 557 # Store the database on which the object was saved
  76. 558 self._state.db = using
  77. 559 # Once saved, this is no longer a to-be-added instance.
  78. 560 self._state.adding = False
  79. 561
  80. Variables:
  81. origin = <class 'noc.sa.models.maptask.MapTask'>
  82. non_pks = [<django.db.models.fields.related.ForeignKey: task>, <django.db.models.fields.related.ForeignKey: managed_object>, <django.db.models.fields.CharField: map_script>, <noc.lib.fields.PickledField: script_params>, <django.db.models.fields.DateTimeField: next_try>, <django.db.models.fields.IntegerField: retries_left>, <django.db.models.fields.CharField: status>, <noc.lib.fields.PickledField: script_result>]
  83. f = <noc.lib.fields.PickledField: script_result>
  84. fields = [<django.db.models.fields.AutoField: id>, <django.db.models.fields.related.ForeignKey: task>, <django.db.models.fields.related.ForeignKey: managed_object>, <django.db.models.fields.CharField: map_script>, <noc.lib.fields.PickledField: script_params>, <django.db.models.fields.DateTimeField: next_try>, <django.db.models.fields.IntegerField: retries_left>, <django.db.models.fields.CharField: status>, <noc.lib.fields.PickledField: script_result>]
  85. self = <MapTask: 1728966: SAE NOC.SAE.ping_check>
  86. force_update = False
  87. force_insert = False
  88. raw = False
  89. manager = <django.db.models.manager.Manager object at 0x803a46090>
  90. meta = <Options for MapTask>
  91. pk_val = 1728966
  92. result = None
  93. using = 'default'
  94. pk_set = True
  95. org = None
  96. cls = <class 'noc.sa.models.maptask.MapTask'>
  97. update_pk = False
  98. record_exists = False
  99. ------------------------------------------------------------------------
  100. File: /opt/noc/contrib/lib/django/db/models/base.py (Line: 463)
  101. Function: save
  102. 456
  103. 457 The 'force_insert' and 'force_update' parameters can be used to insist
  104. 458 that the "save" must be an SQL insert or update (or equivalent for
  105. 459 non-SQL backends), respectively. Normally, they should not be set.
  106. 460 """
  107. 461 if force_insert and force_update:
  108. 462 raise ValueError("Cannot force both insert and updating in model saving.")
  109. 463 ==> self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  110. 464
  111. 465 save.alters_data = True
  112. 466
  113. 467 def save_base(self, raw=False, cls=None, origin=None, force_insert=False,
  114. 468 force_update=False, using=None):
  115. 469 """
  116. Variables:
  117. using = None
  118. self = <MapTask: 1728966: SAE NOC.SAE.ping_check>
  119. force_update = False
  120. force_insert = False
  121. ------------------------------------------------------------------------
  122. File: /opt/noc/sa/sae/sae.py (Line: 518)
  123. Function: process_mrtasks
  124. 511 for mt in MapTask.objects.filter(status="W", next_try__lte=t,
  125. 512 managed_object__activator__shard__is_active=True,
  126. 513 managed_object__activator__shard__name__in=self.shards).select_related():
  127. 514 # Check for task timeouts
  128. 515 if mt.task.stop_time < t:
  129. 516 mt.status = "F"
  130. 517 mt.script_result = dict(code=ERR_TIMEOUT, text="Timed out")
  131. 518 ==> mt.save()
  132. 519 self.log_mrt(logging.INFO, task=mt, status="failed",
  133. 520 code=ERR_TIMEOUT, error="timed out")
  134. 521 continue
  135. 522 # Check blocked pools
  136. 523 if mt.managed_object.activator.name in self.blocked_pools:
  137. 524 # Silently skip task until next round
  138. Variables:
  139. map_callback = <function map_callback at 0x807515398>
  140. exec_script = <function exec_script at 0x807515410>
  141. self = <noc.sa.sae.sae.SAE object at 0x8011b33d0>
  142. throttled_shards = set([])
  143. mt = <MapTask: 1728966: SAE NOC.SAE.ping_check>
  144. t = datetime.datetime(2012, 10, 8, 12, 2, 32, 561068)
  145. sae_mrt_rate = 7
  146. shard_mrt_rate = {}
  147. ------------------------------------------------------------------------
  148. File: /opt/noc/sa/sae/sae.py (Line: 246)
  149. Function: tick
  150. 239 Called every second. Performs periodic maintainance
  151. 240 and runs pending Map/Reduce tasks
  152. 241 """
  153. 242 t = time.time()
  154. 243 reset_queries() # Clear debug SQL log
  155. 244 if t - self.last_mrtask_check >= self.mrt_schedule_interval:
  156. 245 # Check Map/Reduce task status
  157. 246 ==> self.process_mrtasks()
  158. 247 self.last_mrtask_check = t
  159. 248 if t - self.last_status_refresh >= self.activator_status_interval:
  160. 249 self.refresh_activator_status()
  161. 250
  162. 251 def write_event(self, data, timestamp=None, managed_object=None):
  163. 252 """
  164. Variables:
  165. self = <noc.sa.sae.sae.SAE object at 0x8011b33d0>
  166. t = 1349683352.560986
  167. ------------------------------------------------------------------------
  168. File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 246)
  169. Function: run
  170. 239 time.sleep(1)
  171. 240 last_tick = last_stale = time.time()
  172. 241 while cond() and not self.to_shutdown:
  173. 242 self.loop(1)
  174. 243 t = time.time()
  175. 244 if self.tick_callback and t - last_tick >= 1:
  176. 245 try:
  177. 246 ==> self.tick_callback()
  178. 247 except Exception:
  179. 248 error_report()
  180. 249 logging.info("Restoring from tick() failure")
  181. 250 last_tick = t
  182. 251 if t - last_stale >= 1:
  183. 252 self.close_stale()
  184. Variables:
  185. self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x804a97650>
  186. cond = <function <lambda> at 0x8070e7e60>
  187. t = 1349683352.560978
  188. last_stale = 1349683351.028195
  189. run_forever = True
  190. last_tick = 1349683351.028195
  191. ------------------------------------------------------------------------
  192. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement