[2.0b6] django.db.utils.IntegrityError: insert or update on table "piston3_consumer" violates foreign key constraint "piston3_consumer_user_id_4ac0863fa7e05162_fk_auth_user_id"

Bug #1588907 reported by Andres Rodriguez on 2016-06-03
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Critical
Lee Trager

Bug Description

2016-06-04 00:49:58 [-] 127.0.0.1 - - [03/Jun/2016:16:49:57 +0000] "GET /MAAS/metadata/latest/by-id/4y3h7y/?op=get_preseed HTTP/1.1" 500 332 "-" "Cloud-Init/0.7.7"
2016-06-04 00:49:59 [HTTPChannel,28,127.0.0.1] 500 Error - /MAAS/metadata/latest/by-id/4y3h7y/
 Traceback (most recent call last):
   File "/usr/lib/python3/dist-packages/twisted/web/wsgi.py", line 496, in run
     appIterator = self.application(self.environ, self.startResponse)
   File "/usr/lib/python3/dist-packages/django/core/handlers/wsgi.py", line 189, in __call__
     response = self.get_response(request)
   File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 227, in get_response
     response = get_response(request)
   File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 216, in get_response
     request, get_resolver(None), sys.exc_info())
 --- <exception caught here> ---
   File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line 201, in get_response
     return django_get_response(request)
   File "/usr/lib/python3/dist-packages/django/db/transaction.py", line 225, in __exit__
     connection.commit()
   File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 173, in commit
     self._commit()
   File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 142, in _commit
     return self.connection.commit()
   File "/usr/lib/python3/dist-packages/django/db/utils.py", line 98, in __exit__
     six.reraise(dj_exc_type, dj_exc_value, traceback)
   File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in reraise
     raise value.with_traceback(tb)
   File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 142, in _commit
     return self.connection.commit()
 django.db.utils.IntegrityError: insert or update on table "piston3_consumer" violates foreign key constraint "piston3_consumer_user_id_4ac0863fa7e05162_fk_auth_user_id"
 DETAIL: Key (user_id)=(2) is not present in table "auth_user".

Related branches

Changed in maas:
milestone: none → 2.0.0
importance: Undecided → Critical
summary: - django.db.utils.IntegrityError: insert or update on table
+ [2.0b6] django.db.utils.IntegrityError: insert or update on table
"piston3_consumer" violates foreign key constraint
"piston3_consumer_user_id_4ac0863fa7e05162_fk_auth_user_id"
John George (jog) on 2016-06-06
tags: added: cdo-qa-blocker
Changed in maas:
assignee: nobody → Lee Trager (ltrager)
status: New → In Progress
Lee Trager (ltrager) on 2016-06-10
Changed in maas:
status: In Progress → Fix Committed
Lee Trager (ltrager) on 2016-06-12
Changed in maas:
status: Fix Committed → In Progress
Lee Trager (ltrager) on 2016-06-16
Changed in maas:
status: In Progress → Fix Committed
LaMont Jones (lamont) wrote :

I just ran into this with rev 5130. See http://paste.ubuntu.com/17418004/ -- the loop in question is (for various reasons):

 while true; do ps auxf> ~/zz; yes| purge-maas 2>&1 | tee -i zz.out; rm -rf /var/log/maas; apt-get update; apt-get install -y maas ; grep '^ ' /var/log/maas/regiond.log && break; i=i+1;done

(where that grep is looking for a leading tab, and purge-maas just purges all the maas packages and then drops the database)

LaMont Jones (lamont) wrote :

The attached file gets rid of maas on the box, and does so with no user interaction, if debconf has been reconfigured to only prompt for critical messages.

Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers