Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- UNHANDLED EXCEPTION (2012-10-08 12:02:33.508222)
- Working directory: /opt/noc
- <class 'django.db.utils.IntegrityError'>
- insert or update on table "sa_maptask" violates foreign key constraint "task_id_refs_id_193c71167fb7d148"
- DETAIL: Key (task_id)=(939552) is not present in table "sa_reducetask".
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/backends/postgresql_psycopg2/base.py (Line: 235)
- Function: _commit
- 228 finally:
- 229 self.isolation_level = level
- 230 self.features.uses_savepoints = bool(level)
- 231
- 232 def _commit(self):
- 233 if self.connection is not None:
- 234 try:
- 235 ==> return self.connection.commit()
- 236 except Database.IntegrityError, e:
- 237 raise utils.IntegrityError, utils.IntegrityError(*tuple(e)), sys.exc_info()[2]
- Variables:
- self = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
- 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',)
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/backends/__init__.py (Line: 203)
- Function: commit_unless_managed
- 196
- 197 def commit_unless_managed(self):
- 198 """
- 199 Commits changes if the system is not in managed transaction mode.
- 200 """
- 201 self.validate_thread_sharing()
- 202 if not self.is_managed():
- 203 ==> self._commit()
- 204 self.clean_savepoints()
- 205 else:
- 206 self.set_dirty()
- 207
- 208 def rollback_unless_managed(self):
- 209 """
- Variables:
- self = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/transaction.py (Line: 120)
- Function: commit_unless_managed
- 113 def commit_unless_managed(using=None):
- 114 """
- 115 Commits changes if the system is not in managed transaction mode.
- 116 """
- 117 if using is None:
- 118 using = DEFAULT_DB_ALIAS
- 119 connection = connections[using]
- 120 ==> connection.commit_unless_managed()
- 121
- 122 def rollback_unless_managed(using=None):
- 123 """
- 124 Rolls back changes if the system is not in managed transaction mode.
- 125 """
- 126 if using is None:
- Variables:
- using = 'default'
- connection = <django.db.backends.postgresql_psycopg2.base.DatabaseWrapper object at 0x803ba2950>
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/models/base.py (Line: 555)
- Function: save_base
- 548 record_exists = False
- 549
- 550 update_pk = bool(meta.has_auto_field and not pk_set)
- 551 result = manager._insert([self], fields=fields, return_id=update_pk, using=using, raw=raw)
- 552
- 553 if update_pk:
- 554 setattr(self, meta.pk.attname, result)
- 555 ==> transaction.commit_unless_managed(using=using)
- 556
- 557 # Store the database on which the object was saved
- 558 self._state.db = using
- 559 # Once saved, this is no longer a to-be-added instance.
- 560 self._state.adding = False
- 561
- Variables:
- origin = <class 'noc.sa.models.maptask.MapTask'>
- 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>]
- f = <noc.lib.fields.PickledField: script_result>
- 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>]
- self = <MapTask: 1728966: SAE NOC.SAE.ping_check>
- force_update = False
- force_insert = False
- raw = False
- manager = <django.db.models.manager.Manager object at 0x803a46090>
- meta = <Options for MapTask>
- pk_val = 1728966
- result = None
- using = 'default'
- pk_set = True
- org = None
- cls = <class 'noc.sa.models.maptask.MapTask'>
- update_pk = False
- record_exists = False
- ------------------------------------------------------------------------
- File: /opt/noc/contrib/lib/django/db/models/base.py (Line: 463)
- Function: save
- 456
- 457 The 'force_insert' and 'force_update' parameters can be used to insist
- 458 that the "save" must be an SQL insert or update (or equivalent for
- 459 non-SQL backends), respectively. Normally, they should not be set.
- 460 """
- 461 if force_insert and force_update:
- 462 raise ValueError("Cannot force both insert and updating in model saving.")
- 463 ==> self.save_base(using=using, force_insert=force_insert, force_update=force_update)
- 464
- 465 save.alters_data = True
- 466
- 467 def save_base(self, raw=False, cls=None, origin=None, force_insert=False,
- 468 force_update=False, using=None):
- 469 """
- Variables:
- using = None
- self = <MapTask: 1728966: SAE NOC.SAE.ping_check>
- force_update = False
- force_insert = False
- ------------------------------------------------------------------------
- File: /opt/noc/sa/sae/sae.py (Line: 518)
- Function: process_mrtasks
- 511 for mt in MapTask.objects.filter(status="W", next_try__lte=t,
- 512 managed_object__activator__shard__is_active=True,
- 513 managed_object__activator__shard__name__in=self.shards).select_related():
- 514 # Check for task timeouts
- 515 if mt.task.stop_time < t:
- 516 mt.status = "F"
- 517 mt.script_result = dict(code=ERR_TIMEOUT, text="Timed out")
- 518 ==> mt.save()
- 519 self.log_mrt(logging.INFO, task=mt, status="failed",
- 520 code=ERR_TIMEOUT, error="timed out")
- 521 continue
- 522 # Check blocked pools
- 523 if mt.managed_object.activator.name in self.blocked_pools:
- 524 # Silently skip task until next round
- Variables:
- map_callback = <function map_callback at 0x807515398>
- exec_script = <function exec_script at 0x807515410>
- self = <noc.sa.sae.sae.SAE object at 0x8011b33d0>
- throttled_shards = set([])
- mt = <MapTask: 1728966: SAE NOC.SAE.ping_check>
- t = datetime.datetime(2012, 10, 8, 12, 2, 32, 561068)
- sae_mrt_rate = 7
- shard_mrt_rate = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/sae/sae.py (Line: 246)
- Function: tick
- 239 Called every second. Performs periodic maintainance
- 240 and runs pending Map/Reduce tasks
- 241 """
- 242 t = time.time()
- 243 reset_queries() # Clear debug SQL log
- 244 if t - self.last_mrtask_check >= self.mrt_schedule_interval:
- 245 # Check Map/Reduce task status
- 246 ==> self.process_mrtasks()
- 247 self.last_mrtask_check = t
- 248 if t - self.last_status_refresh >= self.activator_status_interval:
- 249 self.refresh_activator_status()
- 250
- 251 def write_event(self, data, timestamp=None, managed_object=None):
- 252 """
- Variables:
- self = <noc.sa.sae.sae.SAE object at 0x8011b33d0>
- t = 1349683352.560986
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 246)
- Function: run
- 239 time.sleep(1)
- 240 last_tick = last_stale = time.time()
- 241 while cond() and not self.to_shutdown:
- 242 self.loop(1)
- 243 t = time.time()
- 244 if self.tick_callback and t - last_tick >= 1:
- 245 try:
- 246 ==> self.tick_callback()
- 247 except Exception:
- 248 error_report()
- 249 logging.info("Restoring from tick() failure")
- 250 last_tick = t
- 251 if t - last_stale >= 1:
- 252 self.close_stale()
- Variables:
- self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x804a97650>
- cond = <function <lambda> at 0x8070e7e60>
- t = 1349683352.560978
- last_stale = 1349683351.028195
- run_forever = True
- last_tick = 1349683351.028195
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement