Error '<' not supported between instances of 'NoneType' and 'str' in GUI


Using Maas 2.6.2-7841-ga10625be3-0ubuntu1~18.04.1 from bionic/main, when I added the ‘focal’ image where previously it was just ‘18.04’ and ‘16.04’, the Maas GUI became unusable as every page returns '<' not supported between instances of 'NoneType' and 'str'.

I don’t see a way using the CLI to delete the ‘focal’ image, which leaves me unable to use Maas via GUI any longer. Any suggestions for a workaround other than upgrading (which is a much larger task)? I’m OK to just remove the focal image (in this particular case) if that’s possible, in the gui I would just unselect it but I can no longer access that page.

Note this looks very much like but this is a Bionic system in production and upgrading to the snap is a project in itself. Just ticking the box for a new image shouldn’t result in the GUI being unusable.

@xavpaice, have you attempted maas $PROFILE boot-resource delete through the CLI? You’d want to be careful to make sure that you have the right image(s), because you’ll need the ID to delete them.

An easy way to see the image name (which will tell you whether it’s Focal, BTW) and the ID? Use the command:

maas admin boot-resources read | jq -r '(["IMAGE_NAME","ID"] | (.,map(length*"-"))), (.[] | [.name, .id]) | @tsv' | column -t

which will tabulate just what you need. On my home system, this produces the following table:

IMAGE_NAME                   ID
----------                   --
grub-efi-signed/uefi         7
grub-efi/uefi                8
grub-ieee1275/open-firmware  9
pxelinux/pxe                 10
ubuntu/focal                 1
ubuntu/focal                 2
ubuntu/focal                 3
ubuntu/focal                 4
ubuntu/focal                 5
ubuntu/focal                 6

If you’re unsure, bounce back to me and we’ll talk it through and involve others if we need to do so. You may also need to file a bug, since the UI shouldn’t lock up and block pages like that, but we can walk through that as well (the fix might involve an upgrade, IDK ATM). No promises here, but let’s try and get you back to operational status before dealing with the bug.

Thanks - I had tried that yesterday but with boot-resources delete, along with attempting to delete the boot-source using boot-sources delete, but the CLI just told me that delete isn’t an option. I was tripped up by the plural vs singular, copy/paste helped :slight_smile:

yeah, the plural/singular thing (noun declension) is confusing sometimes, but we (MAAS) didn’t invent that manner of speaking. i’m not fond of it, either, but it’s apparently standard. on the brighter side, did this solve your issue?

The delete worked, but then the gui was totally unresponsive. Checked again a bit later, and the images were back… I needed to also delete the selection (having collected IDs)

maas $PROFILE boot-source-selections read 1
maas $PROFILE boot-source-selection delete 1 34

After that, the focal images all disappeared and the GUI came back to life immediately.

Thanks for the help!

Now… is there a way to get a focal image for this version of Maas, or is it that we must upgrade Maas first? If so, we should probably have a way to remove the selection which breaks the gui when ticked.

1 Like

Looked a bit further, since attempting to deploy hosts using the bionic image was also failing saying that ServerError: 400 Bad Request (Deployment operating system ubuntu bionic is unavailable.).

Having updated the boot-source URL to match the default in the doc, seeing that as ‘custom’ in the GUI, then switching (via GUI) back to, the list of selections changed completely and the ‘focal’ option which I previously ticked was gone, replaced by ‘20.04’. I’m a little confused how that happened, but can only imagine it was some historical cache that needed clearing out. Anyway, all looks good now, and if there’s a bug report to be raised it’s about not updating the list of selections in boot-source rather than the selection breaking the GUI.

1 Like

Going to check on the Focal + 2.6.2 situation. Otherwise, glad you got things running.

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

So, if anyone faces this again, a cowboy patch of the fix ( done in
/usr/lib/python3/dist-packages/maasserver/utils/ and restart maas fixed this (on 2.8).