MAAS Region Controller fails to install using external postgres via debconf

Bug #1663324 reported by Dan Offord
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned

Bug Description

O/S Information specific:

root@maas:~# uname -air
Linux maas 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
root@maas:~#

root@maas:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
root@maas:~#

The following debconf options have been set prior to an install:
dbconfig-common dbconfig-common/pgsql/authmethod-admin
dbconfig-common dbconfig-common/pgsql/app-pass
dbconfig-common dbconfig-common/remote/host
dbconfig-common dbconfig-common/remote/newhost
dbconfig-common dbconfig-common/remote/port

maas-region-controller maas-region-controller/pgsql/admin-pass
maas-region-controller maas-region-controller/pgsql/authmethod-admin
maas-region-controller maas-region-controller/pgsql/admin-user
maas-region-controller maas-region-controller/pgsql/app-pass
maas-region-controller maas-region-controller/remote/host
maas-region-controller maas-region-controller/remote/newhost
maas-region-controller maas-rack-controller/maas-url
maas-common maas-rack-controller/shared-secret

Expected to happen:

MaaS to fully install using the Postgres information supplied within debconf and setup the new database, without talking to the local Postgresql install.

Actually happened:

MaaS checks for a maas user and maasdb and resets the password on the remote Postgresql server, it then tries to talk to the Postgres install on the localhost
Setting up maas-region-controller (2.1.3+bzr5573-0ubuntu1~16.04.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/maas-region-controller.conf

Creating config file /etc/dbconfig-common/maas-region-controller.conf with new version
creating postgres user maas: already exists.
resetting password: success.
creating database maasdb: already exists.
dbconfig-common: flushing administrative password
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"

Log file of the local postgres install:

root@maas:~# tail -F /var/log/postgresql/postgresql-9.5-main.log
tail: cannot open '/var/log/postgresql/postgresql-9.5-main.log' for reading: No such file or directory

tail: '/var/log/postgresql/postgresql-9.5-main.log' has appeared; following new file
2017-02-09 16:51:30 UTC [20081-1] LOG: database system was shut down at 2017-02-09 16:51:29 UTC
2017-02-09 16:51:30 UTC [20081-2] LOG: MultiXact member wraparound protections are now enabled
2017-02-09 16:51:30 UTC [20080-1] LOG: database system is ready to accept connections
2017-02-09 16:51:30 UTC [20085-1] LOG: autovacuum launcher started
2017-02-09 16:51:30 UTC [20087-1] [unknown]@[unknown] LOG: incomplete startup packet
2017-02-09 16:51:46 UTC [20080-2] LOG: received fast shutdown request
2017-02-09 16:51:46 UTC [20080-3] LOG: aborting any active transactions
2017-02-09 16:51:46 UTC [20085-2] LOG: autovacuum launcher shutting down
2017-02-09 16:51:46 UTC [20082-1] LOG: shutting down
2017-02-09 16:51:46 UTC [20082-2] LOG: database system is shut down
2017-02-09 16:51:47 UTC [20776-1] LOG: database system was shut down at 2017-02-09 16:51:46 UTC
2017-02-09 16:51:47 UTC [20776-2] LOG: MultiXact member wraparound protections are now enabled
2017-02-09 16:51:47 UTC [20775-1] LOG: database system is ready to accept connections
2017-02-09 16:51:47 UTC [20780-1] LOG: autovacuum launcher started
2017-02-09 16:51:48 UTC [20787-1] [unknown]@[unknown] LOG: incomplete startup packet
2017-02-09 16:51:52 UTC [21093-1] maas@maasdb FATAL: password authentication failed for user "maas"
2017-02-09 16:51:52 UTC [21093-2] maas@maasdb DETAIL: Connection matched pg_hba.conf line 94: "host all all ::1/128 md5"
2017-02-09 16:51:52 UTC [21094-1] maas@maasdb FATAL: password authentication failed for user "maas"
2017-02-09 16:51:52 UTC [21094-2] maas@maasdb DETAIL: Connection matched pg_hba.conf line 94: "host all all ::1/128 md5"

MaaS version is: 2.1.3+bzr5573-0ubuntu1~16.04.1

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

Hi Dan,

Can you please provide exact instructions on how you set debconf options and how you proceed to run the install?

THanks.

Changed in maas (Ubuntu):
status: New → Incomplete
Revision history for this message
Dan Offord (liv3d) wrote :

Hi Andres,

Debconf options for testing are set via:

debconf-set-selections <<< "dbconfig-common dbconfig-common/pgsql/authmethod-admin select password"
debconf-set-selections <<< "dbconfig-common dbconfig-common/pgsql/app-pass password <password-here>"
debconf-set-selections <<< "dbconfig-common dbconfig-common/remote/host select newhost"
debconf-set-selections <<< "dbconfig-common dbconfig-common/remote/newhost string 1.2.3.4"
debconf-set-selections <<< "dbconfig-common dbconfig-common/remote/port string 5432"

debconf-set-selections <<< "maas-region-controller maas-region-controller/pgsql/admin-pass password <password-here>"
debconf-set-selections <<< "maas-region-controller maas-region-controller/pgsql/authmethod-admin select password"
debconf-set-selections <<< "maas-region-controller maas-region-controller/pgsql/admin-user string massadmin"
debconf-set-selections <<< "maas-region-controller maas-region-controller/pgsql/app-pass password <password-here>"
debconf-set-selections <<< "maas-region-controller maas-region-controller/remote/host select newhost"
debconf-set-selections <<< "maas-region-controller maas-region-controller/remote/newhost string 1.2.3.4"
debconf-set-selections <<< "maas-region-controller maas-rack-controller/maas-url string http://1.2.3.5:5240/MAAS"
debconf-set-selections <<< "maas-common maas-rack-controller/shared-secret string generate-secret"

apt install -y maas-region-controller

Regards,

Dan

Changed in maas (Ubuntu):
status: Incomplete → Triaged
no longer affects: maas (Ubuntu)
Changed in maas:
milestone: none → 2.2.0
importance: Undecided → Medium
status: New → Triaged
Changed in maas:
milestone: 2.2.0 → 2.2.x
Changed in maas:
milestone: 2.2.x → 2.3.x
Revision history for this message
Drew Freiberger (afreiberger) wrote :

I'm seeing this still occuring when using the FCE tools (cpe-foundation) to build out an HA MAAS cluster with externally clustered postgres DB.

maas package version 2.6.0-7802-g59416a869-0ubuntu1~18.04.1 from ppa:maas/stable

Changed in maas:
milestone: 2.3.x → none
summary: - Maas Region Controller fails to install using external postgres via
+ MAAS Region Controller fails to install using external postgres via
debconf
Changed in maas:
importance: Medium → Low
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.x
Changed in maas:
milestone: 3.4.x → 3.5.x
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.