re-installing maas-region-controller fails

Bug #1281758 reported by Tycho Andersen
64
This bug affects 13 people
Affects Status Importance Assigned to Milestone
MAAS
Expired
Undecided
Unassigned
maas (Ubuntu)
Confirmed
Undecided
Unassigned
Nominated for Xenial by Peter Matulis

Bug Description

When I re-install maas-region-controller on a machine (when it was uninstalled via sudo apt-get -yy purge '.*maas.*'), I see the following:

Setting up maas-region-controller (1.5+bzr1951-0ubuntu1) ...
 * Stopping web server apache2 *
 * Restarting PostgreSQL 9.3 database server [ OK ]
Considering dependency proxy for proxy_http:
Module proxy already enabled
Module proxy_http already enabled
Module expires already enabled
Module wsgi already enabled
 * Restarting message broker rabbitmq-server [ OK ]
Changing password for user "maas_longpoll" ...
...done.
Changing password for user "maas_workers" ...
...done.
Syncing...
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 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/django/core/management/base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/dist-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  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/django/core/management/base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 159, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 129, in _cursor
    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/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  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 112, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 116, in get_new_connection
    return Database.connect(**conn_params)
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
    connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL: password authentication failed for user "maas"
FATAL: password authentication failed for user "maas"

It hangs there, and I have to kill a bunch of random dpkg stuff, edit the postinst file to comment that part out, finish the install, then purge the database. Two things should happen:

1. when I purge, the packaging should drop the maas database
2. it shouldn't hang like this :-)

Tags: docteam
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in maas (Ubuntu):
status: New → Confirmed
huiwen (huiwen921)
Changed in maas (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
stsp (stsp-0) wrote :

What fix is mentioned here?
I am getting this when trying to upgrade from trusty to xenial.

Revision history for this message
Marc H. (marc-hofstetter) wrote :
Download full text (3.3 KiB)

hi all
I'm trying upgrading from maas 1.8.2 to the latest 1.9.1 version via apg-get update / upgrade commands and the mass update hangs exactly at:
----------------------------
 * Stopping web server apache2 *
 * Restarting PostgreSQL 9.3 database server [ OK ]
Syncing...
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/django/core/management/base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/dist-packages/south/management/commands/syncdb.py", line 90, in handle_noargs
    syncdb.Command().execute(**options)
  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/django/core/management/base.py", line 415, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py", line 57, in handle_noargs
    cursor = connection.cursor()
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 159, in cursor
    cursor = util.CursorWrapper(self._cursor(), self)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/__init__.py", line 129, in _cursor
    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/utils.py", line 99, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  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 112, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/lib/python2.7/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 116, in get_new_connection
    return Database.connect(**conn_params)
  File "/usr/lib/python2.7/dist-packages/psycopg2/__init__.py", line 179, in connect
    connection_factory=connection_factory, async=async)
django.db.utils.OperationalError: FATAL: password authentication failed for user...

Read more...

Revision history for this message
Peter Matulis (petermatulis) wrote :

This happened to me today on Xenial and the MAAS 'next' PPA (2.0.0~rc3).

Revision history for this message
Peter Matulis (petermatulis) wrote :
Download full text (4.8 KiB)

It didn't hang though.

.
.
.
Setting up maas-dns (2.0.0~rc3+bzr5180-0ubuntu2~16.04.1) ...
Setting up postgresql (9.5+173) ...
Setting up maas-region-controller (2.0.0~rc3+bzr5180-0ubuntu2~16.04.1) ...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 119, in connect
    self.connection = self.get_new_connection(conn_params)
  File "/usr/lib/python3/dist-packages/django/db/backends/postgresql_psycopg2/base.py", line 176, in get_new_connection
    connection = Database.connect(**conn_params)
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 164, in connect
    conn = _connect(dsn, connection_factory=connection_factory, async=async)
psycopg2.OperationalError: FATAL: password authentication failed for user "maas"
FATAL: password authentication failed for user "maas"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/sbin/maas-region", line 67, in <module>
    main()
  File "/usr/sbin/maas-region", line 63, in main
    run()
  File "/usr/sbin/maas-region", line 51, in run
    management.execute_from_command_line()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 354, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 346, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 394, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 445, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/maasserver/management/commands/dbupgrade.py", line 274, in handle
    if always_south or self._south_needs_to_be_performed(database):
  File "/usr/lib/python3/dist-packages/maasserver/management/commands/dbupgrade.py", line 200, in _south_needs_to_be_performed
    cls._south_was_performed(database) and
  File "/usr/lib/python3/dist-packages/maasserver/management/commands/dbupgrade.py", line 143, in _south_was_performed
    cursor = connections[database].cursor()
  File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 164, in cursor
    cursor = self.make_cursor(self._cursor())
  File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 135, in _cursor
    self.ensure_connection()
  File "/usr/lib/python3/dist-packages/django/db/backends/base/base.py", line 130, in ensure_connection
    self.connect()
  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 130, in ensure_connection
    self.connect()
  File "/usr/lib/python3/dist-packages/django/db/backends/base/bas...

Read more...

tags: added: docteam
Revision history for this message
Peter Matulis (petermatulis) wrote :

I had previously purged and wanted to reinstall.

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

Work around:

sudo apt-get autoremove --purge maas
sudo apt-get remove --purge postgresql-9.5

Revision history for this message
Peter Matulis (petermatulis) wrote :

This worked for me:

$ sudo apt-get autoremove --purge maas
$ sudo apt-get install maas

Revision history for this message
Данило Шеган (danilo) wrote :

At the very least, this bug should be re-opened (seems to have accidentally been marked "fix released").

Changed in maas (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Andres Rodriguez (andreserl) wrote :

I can't seem to be able to reproduce. If you could please provide a exact step by step on how to reproduce it would be very helpful.

Changed in maas:
status: New → Incomplete
Changed in maas (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for maas (Ubuntu) because there has been no activity for 60 days.]

Changed in maas (Ubuntu):
status: Incomplete → Expired
W.J.Kennedy (wjkennedy)
Changed in maas (Ubuntu):
status: Expired → Confirmed
Revision history for this message
W.J.Kennedy (wjkennedy) wrote :

To reproduce in 16.04 with MAAS 2.1.1+bzr5544:

    apt remove maas

    (apt autoremove)

    apt install maas

dpkg fails with: 'django.db.utils.OperationalError: FATAL: password authentication failed for user "maas"
FATAL: password authentication failed for user "maas"'

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

I'm definitely hitting this issue, too, on MAAS 2.1.3+bzr5573-0ubuntu1~16.04.1 from 16.04.

Revision history for this message
Alexis Rodriguez (arod412) wrote :

I ran into this issue today as well. Performing the following can recreate the issue on Ubuntu 18.04.3 LTS:

$ sudo apt remove maas
$ sudo apt remove autoremove
$ sudo apt install maas

This was fixed by the previous suggestion:

$ sudo apt autoremove --purge maas
$ sudo apt install maas

Revision history for this message
Hua Zhang (zhhuabj) wrote :

I ran into this issue (FATAL: password authentication failed for user "maas") by running the command 'maas-region createadmin --username admin --password kNab4Q9fSa --email <email address hidden>' today as well. I solved the problem in the following way.

1, confirm database_pass is wQ3fxcdSH1aI

root@maas-ha-2:~# grep -r 'pass' /etc/maas/regiond.conf
database_pass: wQ3fxcdSH1aI

2, change md5 into trust temporarily, then restart postgresql by 'systemctl restart pacemaker'
/etc/postgresql/9.5/main/pg_hba.conf
local all all trust

3, change the password of the user maas to wQ3fxcdSH1aI

sudo su - maas
psql -d maasdb -U maas
maasdb=> alter user maas with password 'wQ3fxcdSH1aI';

4, ok

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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