MAAS installation doesn't create database config

Bug #1540548 reported by Peter Sabaini
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned

Bug Description

MAAS leaves behind an empty database config, region controller fails to start

Purge databases and configs from previous install attempt
root@spoink:/etc# apt-get purge maas maas-dns maas-dhcp maas-proxy maas-region-controller-min postgresql postgresql-common bind9
...
root@spoink:/etc# apt-get autoremove
...
root@spoink:/etc# ls -la /etc/bind /etc/maas /var/lib/maas
ls: cannot access /etc/maas: No such file or directory
ls: cannot access /var/lib/maas: No such file or directory
/etc/bind:
total 12
drwxr-sr-x 2 root 113 4096 Feb 1 16:47 .
drwxr-xr-x 100 root root 4096 Feb 1 16:47 ..
-rw-rw---- 1 root 113 890 Feb 1 16:00 named.conf.options.2016-02-01T16:00:07.035617
root@spoink:/etc# rm -rf bind

Install maas:

root@spoink:~# apt-get install maas
...

Remove dnssec-validation duplicate config

root@spoink:~# vi /etc/bind/named.conf.options
root@spoink:~# sudo dpkg-reconfigure -fnoninteractive maas-dns
 * Stopping domain name service... bind9
rndc: connect failed: 127.0.0.1#953: connection refused
   ...done.
 * Starting domain name service... bind9
   ...done.

Check database config:
root@spoink:~# cat /etc/maas/regiond.conf
database_host: localhost
database_name: ''
database_pass: ''
database_user: ''
...

Reconfig, just to make sure -- the region controller seems to start fine:
root@spoink:~# dpkg-reconfigure -fnoninteractive maas-region-controller
 * Stopping web server apache2
 *
maas-regiond stop/waiting
maas-regiond start/running
 * Restarting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
   ...done.
maas-clusterd stop/waiting
maas-clusterd start/running, process 17899

But it's not actually functional:
root@spoink:~# maas-region-admin createadmin --username=maas-root --password=sikkrit --email=root+bootstack-$(hostname)@canonical.com
Traceback (most recent call last):
  File "/usr/sbin/maas-region-admin", line 68, in <module>
    main()
  File "/usr/sbin/maas-region-admin", line 64, in main
    run()
  File "/usr/sbin/maas-region-admin", line 57, in run
    management.execute_from_command_line()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 242, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 285, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/maasserver/management/commands/createadmin.py", line 127, in handle
    username, email=email, password=password)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 195, in create_superuser
    **extra_fields)
  File "/usr/lib/python2.7/dist-packages/django/contrib/auth/models.py", line 186, in _create_user
    user.save(using=self._db)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 545, in save
    force_update=force_update, update_fields=update_fields)
  File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 570, in save_base
    with transaction.commit_on_success_unless_managed(using=using, savepoint=False):
  File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 500, in commit_on_success_unless_managed
    if connection.get_autocommit() or connection.in_atomic_block:
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 324, in get_autocommit
    self.ensure_connection()
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 124, in ensure_connection
    self.connect()
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 111, in connect
    conn_params = self.get_connection_params()
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 95, in get_connection_params
    "settings.DATABASES is improperly configured. "
django.core.exceptions.ImproperlyConfigured: settings.DATABASES is improperly configured. Please supply the NAME value.

Update: maas 1.9.0+bzr4533-0ubuntu on trusty.

description: updated
Revision history for this message
Andres Rodriguez (andreserl) wrote :

HI Peter,

I've tried to reproduce this over and over, but I've been unable to reproduce it. I have two questions:

1. When you purged MAAS, did you answer Yes to all questions asked about purging the DB?
2. Can you reproduce this consistently?

Marking this incomplete as I can't seem to reproduce it in various environments.

Changed in maas:
status: New → Incomplete
milestone: none → 1.9.1
Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

Yes, I can reproduce this consistently. When doing the purge there are no questions about purging the DB.

Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

FWIW, doing an additional

# apt-get purge dbconfig-common
# rm -rf /etc/dbconfig-common # clean left-over maas-region-controller.conf

and subsequent reinstall gets me a working db / db config.

Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

[bump] Still incomplete?

Changed in maas:
milestone: 1.9.1 → 1.9.2
Changed in maas:
milestone: 1.9.2 → 1.9.3
Changed in maas:
milestone: 1.9.3 → 1.9.4
Changed in maas:
milestone: 1.9.4 → 1.9.5
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Peter,

Does this continue to be an issue? it doens't seem to be the case. AS such I'm marking this as invalid. If you find the issue again, please file a new bug or re-open this one.

tags: added: inernal
Changed in maas:
status: Incomplete → Invalid
Revision history for this message
Peter Sabaini (peter-sabaini) wrote :

I haven't seen this issue with recent maas releases, ok for me to close

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.