Comment 1 for bug 1787381

Revision history for this message
Andres Rodriguez (andreserl) wrote : Re: [Bug 1787381] [NEW] GET metadata with MAAS built-in proxy enabled fails with "500 Internal Server Error"

Hi Stefan,

Thank you for you bug report. Can you please get some data for me:

maas <user> maas get-config name=maas_proxy_port

And attach /var/lib/maas/maas-proxy.conf

Once you do that, you can fix this by doing

maas <user> maas set-config name=maas_proxy_port value=8080

Thanks

On Thu, Aug 16, 2018 at 7:30 AM Stefan Fleischmann <
<email address hidden>> wrote:

> Public bug reported:
>
> I upgraded our MAAS server from 2.3.3 to 2.4.1 and cannot commission
> nodes anymore. On the commissioned node I can see that the retrieval of
> 'http://172.17.100.3:5240/MAAS/metadata/latest/by-
> id/asfery/?op=get_preseed' fails with status "500 Internal Server
> Error". In the log file /var/log/maas/regiond.log I see this:
>
> 2018-08-16 05:20:49 maasserver: [error] ################################
> Exception: %d format: a number is required, not NoneType
> ################################
> 2018-08-16 05:20:49 maasserver: [error] Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/django/core/handlers/base.py", line
> 185, in _get_response
> response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "/usr/lib/python3/dist-packages/maasserver/utils/views.py", line
> 277, in view_atomic_with_post_commit_savepoint
> return view_atomic(*args, **kwargs)
> File "/usr/lib/python3.6/contextlib.py", line 52, in inner
> return func(*args, **kwds)
> File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line
> 70, in __call__
> response = upcall(request, *args, **kwargs)
> File "/usr/lib/python3/dist-packages/django/views/decorators/vary.py",
> line 21, in inner_func
> response = func(*args, **kwargs)
> File "/usr/lib/python3/dist-packages/piston3/resource.py", line 190, in
> __call__
> result = self.error_handler(e, request, meth, em_format)
> File "/usr/lib/python3/dist-packages/piston3/resource.py", line 188, in
> __call__
> result = meth(request, *args, **kwargs)
> File "/usr/lib/python3/dist-packages/maasserver/api/support.py", line
> 310, in dispatch
> return function(self, request, *args, **kwargs)
> File "/usr/lib/python3/dist-packages/metadataserver/api.py", line 1149,
> in get_preseed
> preseed = get_preseed(node, region_ip)
> File "/usr/lib/python3/dist-packages/maasserver/preseed.py", line 616,
> in get_preseed
> default_region_ip=default_region_ip)
> File "/usr/lib/python3/dist-packages/maasserver/preseed.py", line 936,
> in render_preseed
> default_region_ip=default_region_ip))
> File "/usr/lib/python3/dist-packages/maasserver/preseed.py", line 864,
> in get_node_preseed_context
> default_region_ip=default_region_ip),
> File "/usr/lib/python3/dist-packages/maasserver/compose_preseed.py",
> line 435, in compose_preseed
> node, token, base_url, default_region_ip=default_region_ip)
> File "/usr/lib/python3/dist-packages/maasserver/compose_preseed.py",
> line 312, in compose_commissioning_preseed
> default_region_ip=default_region_ip)
> File "/usr/lib/python3/dist-packages/maasserver/compose_preseed.py",
> line 365, in _compose_cloud_init_preseed
> node.get_boot_rack_controller(), default_region_ip=default_region_ip)
> File "/usr/lib/python3/dist-packages/maasserver/compose_preseed.py",
> line 45, in get_apt_proxy
> url = "http://:%d/" % maas_proxy_port
> TypeError: %d format: a number is required, not NoneType
>
> 2018-08-16 05:20:49 regiond: [info] 172.17.100.123 GET
> /MAAS/metadata/latest/by-id/asfery/?op=get_preseed HTTP/1.1 --> 500
> INTERNAL_SERVER_ERROR (referrer: -; agent: Cloud-Init/18.3
> -9-g2e62cb8a-0ubuntu1~18.04.2)
>
> I quickly checked in a fresh container, installed MAAS from scratch and
> think I see the same there. If I go into settings and change the proxy
> from "MAAS Built-in proxy" to "Don't use a proxy" the problem disappears
> and I can commission nodes again. List of installed packages:
>
> # dpkg -l | egrep 'maas|cloud-init'
> ii cloud-init
> 18.3-9-g2e62cb8a-0ubuntu1~18.04.2 all Init scripts for cloud
> instances
> ii cloud-initramfs-copymods 0.40ubuntu1
> all copy initramfs modules into root filesystem for later use
> ii cloud-initramfs-dyn-netconf 0.40ubuntu1
> all write a network interface file in /run for BOOTIF
> ii maas
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all "Metal as a Service"
> is a physical cloud and IPAM
> ii maas-cli
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS client and
> command-line interface
> ii maas-common
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS server common files
> ii maas-dhcp
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS DHCP server
> ii maas-proxy
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS Caching Proxy
> ii maas-rack-controller
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all Rack Controller for
> MAAS
> ii maas-region-api
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all Region controller API
> service for MAAS
> ii maas-region-controller
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all Region Controller for
> MAAS
> ii python3-django-maas
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS server Django web
> framework (Python 3)
> ii python3-maas-client
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS python API client
> (Python 3)
> ii python3-maas-provisioningserver
> 2.4.1-7032-g11e4fa330-0ubuntu1~18.04.1 all MAAS server
> provisioning libraries (Python 3)
>
> ** Affects: maas
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to MAAS.
> https://bugs.launchpad.net/bugs/1787381
>
> Title:
> GET metadata with MAAS built-in proxy enabled fails with "500 Internal
> Server Error"
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/maas/+bug/1787381/+subscriptions
>
> Launchpad-Notification-Type: bug
> Launchpad-Bug: product=maas; status=New; importance=Undecided;
> assignee=None;
> Launchpad-Bug-Information-Type: Public
> Launchpad-Bug-Private: no
> Launchpad-Bug-Security-Vulnerability: no
> Launchpad-Bug-Commenters: sfleischmann
> Launchpad-Bug-Reporter: Stefan Fleischmann (sfleischmann)
> Launchpad-Bug-Modifier: Stefan Fleischmann (sfleischmann)
> Launchpad-Message-Rationale: Subscriber (MAAS)
> Launchpad-Message-For: andreserl
>
--
Andres Rodriguez (RoAkSoAx)
Ubuntu Server Developer
MSc. Telecom & Networking
Systems Engineer