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".
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)