MAAS reports invalid command to run when maas-url is incorrect

Bug #1990416 reported by Adam Vest
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Eline Maaike De Weerd
3.3
Fix Released
Medium
Eline Maaike De Weerd

Bug Description

Hello,

It would seem as though MAAS instructs the user to run an invalid (probably old) command when the maas_url configuration is set incorrectly. This was revealed on my local test setup where my MAAS region+rack controller was receiving it's IP via DHCP, and that IP changed along the way. On subsequent attempts at deploying images (using juju bootstrap in this case), it would throw the error:
---
ERROR failed to bootstrap model: cannot start bootstrap instance: unexpected: ServerError: 400 Bad Request (Failed to render preseed: Unable to find MAAS server IP address: Address family for hostname not supported. MAAS's DNS server requires this IP address for the NS records in its zone files. Make sure that the configuration setting for the MAAS URL has the correct hostname. Consult the 'maas-region local_config_set --maas-url' command.)
---

It suggests you "Consult the 'maas-region local_config_set --maas-url' command", which does not appear to exist (anymore?):
---
root@maas:~# maas-region
maas-region: command not found
---

It would appear as though the new command syntax for this would be:
---
maas config --maas-url
---

I would recommend updating the error message to reference the proper command for troubleshooting. Subjectively speaking, the message stating "Address family for hostname not supported" is a bit misleading, since it seems to suggest an IPv4/IPv6 mismatch. Perhaps it's meant as a catch-all? In any case, it might be nice if it only mentioned that if that were actually the case.

Related software versions:
$ snap list
Name Version Rev Tracking Publisher Notes
charmcraft 2.0.0 1033 latest/stable canonical✓ classic
core18 20220831 2566 latest/stable canonical✓ base
core20 20220826 1623 latest/stable canonical✓ base
juju 2.9.34 20510 2.9/stable canonical✓ classic
lxd 5.5-37534be 23537 latest/stable canonical✓ -
maas 3.2.5-12014-g.da4969479 23696 3.2/stable canonical✓ -
maas-cli 0.6.8 79 latest/stable canonical✓ -
maas-test-db 12.4-24-g.8add233 105 3.2/stable canonical✓ -
snapd 2.57.1 16778 latest/stable canonical✓ snapd

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Thank you!

Tags: easy-to-fix

Related branches

description: updated
Revision history for this message
Christian Grabowski (cgrabowski) wrote :

Hi there, `maas-region` is the command for the deb install, the snap just uses `maas` for this command. Was it in an error message where the suggested command was shown, or elsewhere?

Changed in maas:
status: New → Incomplete
Revision history for this message
Adam Vest (foxmulder2004) wrote :

Hello,

Ah, OK, thanks for the explanation. And yep, the error I provided in the description was copied verbatim from my terminal. It mentions:

"Consult the 'maas-region local_config_set --maas-url' command."

Revision history for this message
Alexsander de Souza (alexsander-souza) wrote :

We have references to `maas-region local_config_set` in the following places

src/maasserver/dns/zonegenerator.py
src/maasserver/server_address.py
src/maasserver/utils/__init__.py

Changed in maas:
status: Incomplete → Triaged
importance: Undecided → Medium
milestone: none → 3.3.0
tags: added: easy-to-fix
Changed in maas:
milestone: 3.3.0 → 3.4.0
Changed in maas:
status: Triaged → Fix Committed
Changed in maas:
assignee: nobody → Eline Maaike De Weerd (emdw)
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.0-beta1
Alberto Donato (ack)
Changed in maas:
status: Fix Committed → Fix Released
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.