[2.3] get_enlist_preseed returns 127.0.0.1 for metadata_url

Bug #1743142 reported by Andreas Hasenack
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned

Bug Description

2.3.0-6434-gd354690-0ubuntu1~16.04.1

I'm debugging a problem where enlisting nodes get metadata_url=http://127.0.0.1:5240/MAAS/metadata/enlist when fetching MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed

This makes enlisting fail.

After some debugging, I found out that if you access that enlist-preseed URL like this, without a port number (10.0.5.5 is my maas server):

http://10.0.5.5/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed

You get:
metadata_url: http://127.0.0.1:5240/MAAS/metadata/enlist

in the response, which is incorrect.

But if you access the service directly on its port number, like this:
http://10.0.5.5:5240/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed

Then you get the correct response:
metadata_url: http://10.0.5.5:5240/MAAS/metadata/enlist

I believe the error happens because in the former case apache is proxying the request to localhost:5240, and then maas' get_source_address() is fed 127.0.0.1 and correctly returns 127.0.0.1.

That being said, I have two such maas servers: one a more recent install, and another one an old install that has been upgraded over time until it reached the 2.3.0 version. The enlisting problem is only happening in the old-upgraded-to-2.3.0 maas server. For some reason, there the cloud-config-url in the kernel command line is being set to the url without the port number:

cloud-config-url=http://10.96.0.10/MAAS/metadata/latest/enlist-preseed/?op=get_enlist_preseed

Which leads to the request being proxied by apache and then to the 127.0.0.1 ip in the metadata url that is returned.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I worked around it by setting the port number on both maas urls in /etc/maas/rackd.conf and /etc/maas/regiond.conf

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Andreas,

We believe this issue has now been fixed in the latest releases of MAAS. If you believe this is still an issue, please re-open this bug report.

Changed in maas:
status: New → Invalid
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.