0

I recently started using MaaS 3.0.0 (up from 2.4). I was able to enlist, commission, and deploy nodes up until today when I started getting the following when I tried to enlist some nodes:

Can not apply stage config, no datasource found! Likely bad things to come!

I eventually traced it down to the enlist-preseed URL (http://x.x.x.1:5240/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed) giving a 500 error to the client, this is the output when I browse to it in Chrome:

name 'metadata_enlist_url' is not defined at line 8 column 22 in file /var/snap/maas/15003/preseeds/enlist

I still have my 2.4 version up and I get the following when I go to the same path:

#cloud-config
datasource:
  MAAS:
    timeout : 50
    max_wait : 120
    # there are no default values for metadata_url or oauth credentials
    # If no credentials are present, non-authed attempts will be made.
    metadata_url: http://x.x.2.4:5240/MAAS/metadata/enlist

output: {all: '| tee -a /var/log/cloud-init-output.log'}

I tried creating/editing /var/snap/maas/15003/preseeds/enlist on my 3.0 maas with my 2.4 version but the 3.0 webpage never returns anything useful, just that same error.

Does anyone have an insight into what is going on/how to fix it?

3 Answers 3

0

So I'm not sure how it got into this state but for some reason MaaS didn't like the {{metadata_enlist_url}} variable anymore, and even including it in a comment like

# metadata_url: {{metadata_enlist_url}}

MaaS was trying to do a replacement giving me the error. Once I removed that variable and hard coded metadata_url: http://x.x.x.1:5240/MAAS/metadata/enlist things I can now at least get into the enlist workflow (still running into some other issues though...)

1
  • I eventually just uninstalled MaaS and reinstalled it to fix all my problems. Not sure how it got in that state.
    – Doug
    Commented Aug 18, 2021 at 16:27
0

Try setting the metadata_url value in preseeds/enlist to:

    metadata_url: http://{{server_host}}:5240/MAAS/metadata

I have tested this with MAAS 2.9.

0

I upgraded from MAAS 2.6 and found the same problem, but I managed to find a solution for this that works in MAAS 3.0+. I tried the methods mentioned above, but they did not work for me.

When I queried this URL: http://x.x.x.2:5240/MAAS/metadata/enlist-preseed/?op=get_enlist_preseed through my browser

I got this result:

Unrecognised signature: method=GET op=get_enlist_preseed

I then installed a brand new instance of MAAS 3.3 on a test server and figured out that the "/etc/maas/preseeds/enlist" or /snap/maas/24685/etc/maas/preseeds/enlist file in my new install was completely different to my production install.

File on production server:

$ cat /etc/maas/preseeds/enlist
#cloud-config
datasource:
  MAAS:
    timeout : 50
    max_wait : 120
    # there are no default values for metadata_url or oauth credentials
    # If no credentials are present, non-authed attempts will be made.
    metadata_url: {{metadata_enlist_url}}

output: {all: '| tee -a /var/log/cloud-init-output.log'}

File on the test server:

$ cat /etc/maas/preseeds/enlist

{{preseed_data}}

I made a backup of the old enlist file on the production server and changed it to be the same as the enlist file on my test server and now it's working again and it's enlisting new machines.

Now when I query the same URL, I get this:

#cloud-config
apt:
  preserve_sources_list: false
  primary:
  - arches:
    - amd64
    - i386
    uri: http://archive.ubuntu.com/ubuntu
  - arches:
    - default
    uri: http://ports.ubuntu.com/ubuntu-ports
  proxy: http://x.x.x.2:8000/
  security:
  - arches:
    - amd64
    - i386
    uri: http://archive.ubuntu.com/ubuntu
  - arches:
    - default
    uri: http://ports.ubuntu.com/ubuntu-ports
  sources_list: 'deb $PRIMARY $RELEASE main restricted multiverse universe

    # deb-src $PRIMARY $RELEASE main restricted multiverse universe

    deb $PRIMARY $RELEASE-updates main restricted multiverse universe

    # deb-src $PRIMARY $RELEASE-updates main restricted multiverse universe

    deb $PRIMARY $RELEASE-backports main restricted multiverse universe

    # deb-src $PRIMARY $RELEASE-backports main restricted multiverse universe

    deb $SECURITY $RELEASE-security main restricted multiverse universe

    # deb-src $SECURITY $RELEASE-security main restricted multiverse universe

    '
datasource:
  MAAS:
    metadata_url: http://x.x.x.2:5240/MAAS/metadata/
manage_etc_hosts: true
packages:
- python3-yaml
- python3-oauthlib
power_state:
  condition: test ! -e /tmp/block-poweroff
  delay: now
  mode: poweroff
  timeout: 1800
rsyslog:
  remotes:
    maas: x.x.x.2:5247

Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .