'NoneType' object has no attribute 'endswith' with CLI

I am trying to debug why some nodes are failing to commssion, PXE boot works, but Metadata fetch from maas is failing every time…

So trying to add tags to ad debugging serial console blows up with the CLI failing to accept it…

root@use1-maas-region-1:~# maas admin tags create name='debug_console' comment='debug serial console' kernel_opts="console=tty0 console=ttyS1,115200n8"
usage: maas [-h] COMMAND ...

optional arguments:
  -h, --help      show this help message and exit

drill down:
  COMMAND
    login         Log in to a remote API, and remember its description and credentials.
    logout        Log out of a remote API, purging any stored credentials.
    list          List remote APIs that have been logged-in to.
    refresh       Refresh the API descriptions of all profiles.
    init          Initialise MAAS in the specified run mode.
    config        View or change controller configuration.
    status        Status of controller services.
    migrate       Perform migrations on connected database.
    apikey        Used to manage a user's API keys. Shows existing keys unless --generate or --delete is
                  passed.
    configauth    Configure external authentication.
    createadmin   Create a MAAS administrator account.
    changepassword
                  Change a MAAS user's password.
    admin         Interact with https://maas.<REDACTED>/MAAS/api/2.0/

http://maas.io/

'NoneType' object has no attribute 'endswith'

This feels like a python-twisted issue again…
I filed bug https://bugs.launchpad.net/maas/+bug/1931592 for this as this is a blocker for me.

I found a workaround. if I login to the LOADBALANCED URL (https://maas.REDACTED>/MAAS/, commands fail, if I point it at a specific region controller, it works.