Database Error Message when installing Maas

I keep getting this error message below when trying to install maas 2.8 running on Ubuntu 20.04(snap). Can anyone advise what the below means?

Failed to perfom migrations:ations
Traceback (most recent call last):
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/base/ba se.py”, line 213, in ensure_connection
self.connect()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/base/ba se.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/postgre sql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/snap/maas/7808/usr/lib/python3/dist-packages/psycopg2/init.py”, lin e 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: could not translate host name “http” to address: Temp orary failure in name resolution

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

Traceback (most recent call last):
File “/snap/maas/7808/bin/maas-region”, line 33, in
sys.exit(load_entry_point(‘maas==2.8.1’, ‘console_scripts’, ‘maas-region’)() )
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/region_script.py” , line 77, in run
run_django(is_snap, is_devenv)
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/region_script.py” , line 66, in run_django
management.execute_from_command_line()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/core/management/i nit.py”, line 364, in execute_from_command_line
utility.execute()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/core/management/i nit.py”, line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/core/management/bas e.py”, line 283, in run_from_argv
self.execute(*args, **cmd_options)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/core/management/bas e.py”, line 330, in execute
output = self.handle(*args, **options)
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/management/comman ds/dbupgrade.py”, line 108, in handle
self._drop_all_views(database)
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/management/comman ds/dbupgrade.py”, line 88, in _drop_all_views
dbviews.drop_all_views()
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/utils/orm.py”, li ne 736, in call_within_transaction
with connected(), post_commit_hooks:
File “/snap/maas/7808/usr/lib/python3.6/contextlib.py”, line 81, in enter
return next(self.gen)
File “/snap/maas/7808/lib/python3.6/site-packages/maasserver/utils/orm.py”, li ne 663, in connected
connection.ensure_connection()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/base/ba se.py”, line 213, in ensure_connection
self.connect()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/utils.py”, line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/utils/six.py”, line 685, in reraise
raise value.with_traceback(tb)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/base/ba se.py”, line 213, in ensure_connection
self.connect()
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/base/ba se.py”, line 189, in connect
self.connection = self.get_new_connection(conn_params)
File “/snap/maas/7808/usr/lib/python3/dist-packages/django/db/backends/postgre sql/base.py”, line 176, in get_new_connection
connection = Database.connect(**conn_params)
File “/snap/maas/7808/usr/lib/python3/dist-packages/psycopg2/init.py”, lin e 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: could not translate host name “http” to addres s: Temporary failure in name resolution

I resolved the issue.

The version of postgresql was 12.

I located and edited /etc/postgresql/12/main/pg_hba.conf I also had to do the same with ‘/etc/postgresql/12/main/postgresql.conf’

Then reinitialised maas.

Initially I created and edited /etc/postgresql/10/main/pg_hba.conf as stated in the installation document but due to the version the conf file couldn’t be accessed.

I also changed listen_addresses in postgresql.conf to listen_addresses ‘*’

/@sircam, nice catch, good troubleshooting! i’m going to add this problem to our troubleshooting guide, this one would be hard to find quickly.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.