Obscure error message when region without racks fails to retreive LXD projects list

Bug #1997007 reported by Igor Brovtsin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Triaged
Low
Unassigned

Bug Description

When trying to add an LXD host on a region without rack controllers, region fails with

`'NoneType' object is not iterable`

Steps to reproduce:
1. Initialize MAAS in `region` configuration without adding rack controllers
2. Go to KVM -> Add LXD host
3. Fill in the name and IP address
4. Add the certificate to LXD, click "Check Authentication"
5. An error message will appear.

It's easy to fix that by handling an exception or raising a proper one when no racks are registered for region. Another easy fix with better UX is to prohibit user from adding LXDs when there are no rack controllers.

Revision history for this message
Igor Brovtsin (igor-brovtsin) wrote :

Here's a traceback:

2022-11-18 10:16:00 maasserver.websockets.protocol: [critical] Error on request (98) pod.get_projects: 'NoneType' object is not iterable
        Traceback (most recent call last):
          <omitted>
          File "/snap/maas/x1/lib/python3.10/site-packages/maasserver/websockets/handlers/pod.py", line 181, in get_projects
            return [attr.asdict(project) for project in projects]
        builtins.TypeError: 'NoneType' object is not iterable

Changed in maas:
status: New → Triaged
milestone: none → 3.4.0
Alberto Donato (ack)
Changed in maas:
milestone: 3.4.0 → 3.4.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.