lpupdate crashes because of database constraints

Bug #667458 reported by Daniel Holbach
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LoCo Team Portal
Invalid
Critical
Unassigned

Bug Description

Traceback (most recent call last):
  File "./manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 362, in execute_manager
    utility.execute()
  File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 303, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 195, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 222, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/srv/loco.ubuntu.com/loco_directory/teams/management/commands/lpupdate.py", line 59, in handle_noargs
    update_admins(team, l, lp)
  File "/srv/loco.ubuntu.com/loco_directory/teams/management/commands/lpupdate.py", line 34, in update_admins
    ld_team.admin_profiles.add(admin)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py", line 430, in add
    self._add_items(self.source_col_name, self.target_col_name, *objs)
  File "/usr/lib/pymodules/python2.6/django/db/models/fields/related.py", line 505, in _add_items
    transaction.commit_unless_managed()
  File "/usr/lib/pymodules/python2.6/django/db/transaction.py", line 149, in commit_unless_managed
    connection._commit()
  File "/usr/lib/pymodules/python2.6/django/db/backends/__init__.py", line 38, in _commit
    return self.connection.commit()
psycopg2.IntegrityError: insert or update on table "teams_admin_profiles" violates foreign key constraint "team_id_refs_id_1770d74546386c23"
DETAIL: Key (team_id)=(145) is not present in table "teams".

Tags: teams
Changed in loco-directory:
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Michael Hall (mhall119) wrote :

Has this ever happened again?

Revision history for this message
Michael Hall (mhall119) wrote :

Could not reproduce, suspect it was just bad timing

Changed in loco-directory:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.