'NoneType' object has no attribute 'endswith' with maas tag create CLI command

Bug #1931592 reported by David Andruczyk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
Undecided
Unassigned

Bug Description

I am trying to create tags via the CLI to debug issues with machines failing to commission.

Using the docs:
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'

using maas 2.9.2 from snap:
installed: 2.9.2-9165-g.c3e7848d1 (12555) 149MB -

Revision history for this message
David Andruczyk (dandruczyk) wrote :

Background: MaaS is configured as 3 HA region controllers as per MAAS documentation with haproxy+keepalived in front of it doing the SSL termination.

Revision history for this message
David Andruczyk (dandruczyk) wrote :

This is a blocker and is preventing testing to find out why commissioning failures are happening..

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

As you mentioned in the related discourse post, pointing the cli directly at a region server seems to work, with that in mind, would you mind sharing you're HAPRoxy config?

Changed in maas:
status: New → Incomplete
Revision history for this message
David Andruczyk (dandruczyk) wrote :

# This file is managed by Puppet
global
  maxconn 400
  stats socket /var/lib/haproxy/stats
  tune.ssl.default-dh-param 2048

defaults
  log global
  option redispatch
  option http-server-close
  retries 3
  stats enable

listen maas_frontend
  bind 10.40.148.65:443 ssl crt /etc/ssl/certs/REDACTED.combined.pem
  bind 10.40.148.65:80
  mode http
  balance source
  hash-type consistent
  http-request redirect scheme https unless { ssl_fc }
  option redispatch
  reqadd X-Forwarded-Proto:\ https
  retries 3
  server use1-maas-region-1 10.40.148.66:5240 check
  server use1-maas-region-2 10.40.148.7:5240 check
  server use1-maas-region-3 10.40.148.67:5240 check

Revision history for this message
David Andruczyk (dandruczyk) wrote :

If I login via the haproxy URL it works, but commands DO NOT

 maas login lb https://maas.REDACTED/MAAS/ <API_KEY>

You are now logged in to the MAAS server at
https://maas.REDACTED/MAAS/api/2.0/ with the profile name 'lb'.

Read commands (maas lb domains read) just give back the help message and
WWW-Authenticate

If I run the same command with the profile pointing directly at a rack controller it works fine

Revision history for this message
Alberto Donato (ack) wrote :

Could you please attach logs (regiond.log, rackd.log) from maas after trying to run CLI commands pointed at the haproxy url?

Also, I wonder if haproxy is for some reason stripping some headers from the original request, which make authentication fail.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

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