MAAS flush bug

Bug #1005482 reported by gojkok
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
maas (Ubuntu)
Medium
Unassigned

Bug Description

When you do command maas flush, you get an error:

root@maas-serv:~# maas flush
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the 'maasdb' database,
and return each table to the state it was in after syncdb.
Are you sure you want to do this?

    Type 'yes' to continue, or 'no' to cancel: yes

You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'root'):
E-mail address: <email address hidden>
Password:
Password (again):
Traceback (most recent call last):
  File "/usr/bin/django-admin", line 5, in <module>
    management.execute_from_command_line()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 429, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 379, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 191, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 351, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/flush.py", line 74, in handle_noargs
    emit_post_sync_signal(set(all_models), verbosity, interactive, db)
  File "/usr/lib/python2.7/dist-packages/django/core/management/sql.py", line 190, in emit_post_sync_signal
    interactive=interactive, db=db)
  File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py", line 70, in create_superuser
    call_command("createsuperuser", interactive=True)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 166, in call_command
    return klass.execute(*args, **defaults)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 220, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/management/commands/createsuperuser.py", line 134, in handle
    User.objects.create_superuser(username, email, password)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 140, in create_superuser
    u = self.create_user(username, email, password)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 136, in create_user
    user.save(using=self._db)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 570, in save_base
    created=(not record_exists), raw=raw, using=using)
  File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/lib/python2.7/dist-packages/maasserver/models.py", line 838, in create_user
    profile.create_authorisation_token()
  File "/usr/lib/python2.7/dist-packages/maasserver/models.py", line 809, in create_authorisation_token
    token = create_auth_token(self.user)
  File "/usr/lib/python2.7/dist-packages/maasserver/models.py", line 714, in create_auth_token
    user=user, name=GENERIC_CONSUMER, status='accepted')
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 138, in create
    return self.get_query_set().create(**kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 360, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save
    self.save_base(using=using, force_insert=force_insert, force_update=force_update)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 570, in save_base
    created=(not record_exists), raw=raw, using=using)
  File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/usr/lib/python2.7/dist-packages/piston/signals.py", line 8, in consumer_post_save
    send_consumer_mail(instance)
  File "/usr/lib/python2.7/dist-packages/piston/utils.py", line 314, in send_consumer_mail
    subject = "Your API Consumer for %s " % Site.objects.get_current().name
  File "/usr/lib/python2.7/dist-packages/django/contrib/sites/models.py", line 25, in get_current
    current_site = self.get(pk=sid)
  File "/usr/lib/python2.7/dist-packages/django/db/models/manager.py", line 132, in get
    return self.get_query_set().get(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/db/models/query.py", line 349, in get
    % self.model._meta.object_name)
django.contrib.sites.models.DoesNotExist: Site matching query does not exist.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug - trivially reproduced.

Changed in maas (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers