[2.2.0+bzr6057-snap] Stacktrace appears when pointing to a non-existent region controller

Bug #1695463 reported by Peter Matulis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned

Bug Description

Adequate error handling is missing from the MAAS snap.

When putting the snap in 'region' mode and pointing to the default MAAS URL a stacktrace can be displayed. The user could instead be presented with something like:

"There is no functional region controller available at the specified URL."

$ snap info maas

.
.
.
tracking: stable
installed: 2.2.0+bzr6057-snap (91) 98MB devmode
refreshed: 2017-05-30 16:15:09 +0000 UTC
channels:
  latest/stable: 2.2.0+bzr6057-snap (91) 98MB -
  latest/edge: trunk+bzr6071-snap (101) 98MB devmode

$ sudo maas init

Mode (all/region+rack/region/rack/noneall/region+rack/region/rack/none) [default=all]? region
MAAS URL [default=http://10.55.60.1:5240/MAAS]:
Traceback (most recent call last):
  File "/snap/maas/91/bin/maas", line 24, in <module>
    sys.exit(run())
  File "/snap/maas/91/bin/maas", line 21, in run
    return maascli.main()
  File "/snap/maas/91/lib/python3.5/site-packages/maascli/__init__.py", line 29, in main
    options.execute(options)
  File "/snap/maas/91/lib/python3.5/site-packages/maascli/snappy.py", line 573, in __call__
    raise exc
  File "/snap/maas/91/lib/python3.5/site-packages/maascli/snappy.py", line 570, in __call__
    self.handle(options)
  File "/snap/maas/91/lib/python3.5/site-packages/maascli/snappy.py", line 669, in handle
    help_text=ARGUMENTS['database_host']['help'])
KeyError: 'database_host'

Unsurprisingly, the same thing happens for mode 'region+rack'.

Oddly, no error is generated at all when 'rack' mode is chosen, even though there is no region controller to connect to:

$ sudo maas init

Mode (all/region+rack/region/rack/noneall/region+rack/region/rack/none) [default=all]? rack
MAAS URL [default=http://10.55.60.1:5240/MAAS]:
Secret: kjkj

$ sudo maas status
dhcpd STOPPED Not started
dhcpd6 STOPPED Not started
ntp RUNNING pid 6064, uptime 0:01:41
rackd RUNNING pid 6066, uptime 0:01:41
tgt RUNNING pid 6225, uptime 0:01:22

Does this mean that the rack controller was installed but is not registered (with a region controller)?

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

Hi Peter, can you clarify this "When putting the snap in 'region' mode and pointing to the default MAAS ".

Is this when pointing a rack controller to a non-existing region, or is this when pointing the region controller to a non-existing region ? The output you are providing seems to be related to the rack and not to a region.

Changed in maas:
status: New → Incomplete
milestone: none → 2.3.0
Revision history for this message
Peter Matulis (petermatulis) wrote :

The latter, when pointing the region controller to a non-existing region.

Changed in maas:
milestone: 2.3.0 → 2.3.x
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi!

**This is an automated message**

We believe this is may no longer be an issue in the latest MAAS release. Due to the original date of the bug report, we are currently marking it as Invalid. If you believe this bug report still valid against the latest release of MAAS, or if you are still interested in this, please re-open this bug report.

Thanks

Changed in maas:
status: Incomplete → Invalid
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.