MaaS 2.6.1 - Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'

What could be causing the error above? I’ve taken a cursory look at the code. Here’s the full dump:

2019-10-07 19:40:01 maasserver.websockets.protocol: [critical] Error on request (165) machine.action: Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'
        Traceback (most recent call last):
          File "/usr/lib/python3.6/threading.py", line 864, in run
            self._target(*self._args, **self._kwargs)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 852, in worker
            return target()
          File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
            task()
          File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
            task()
        --- <exception caught here> ---
          File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
            result = inContext.theWork()
          File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
            inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
            return func(*args,**kw)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 885, in callInContext
            return func(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 234, in wrapper
            result = func(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 756, in call_within_transaction
            return func_outside_txn(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 563, in retrier
            return func(*args, **kwargs)
          File "/usr/lib/python3.6/contextlib.py", line 52, in inner
            return func(*args, **kwds)
          File "/usr/lib/python3/dist-packages/maasserver/websockets/base.py", line 402, in prep_user_execute
            method_name, method, params)
          File "/usr/lib/python3/dist-packages/maasserver/websockets/base.py", line 421, in _call_method_track_queries
            result = method(params)
          File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/machine.py", line 891, in action
            return action.execute(**extra_params)
          File "/usr/lib/python3/dist-packages/maasserver/node_action.py", line 172, in execute
            self._execute(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/maasserver/node_action.py", line 510, in _execute
            "Failed to retrieve curtin config: %s" % e)
        maasserver.exceptions.NodeActionError: Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'

request is an HttpRequest object going into the try, but url is missing for some reason. The if condition is getting skipped (on check for None) because request is not None; only request.url is seemingly missing.

The self object and self.request object contain:

=> /var/log/maas/regiond.log <==
2019-10-08 18:32:21 stdout: [info] { 'endpoint': 1,
2019-10-08 18:32:21 stdout: [info]   'node': <Machine: qhytrx (njdcsbcpu01)>,
2019-10-08 18:32:21 stdout: [info]   'request': <HttpRequest>,
2019-10-08 18:32:21 stdout: [info]   'user': <User: user>}
2019-10-08 18:32:21 stdout: [info] { 'COOKIES': {},
2019-10-08 18:32:21 stdout: [info]   'FILES': <MultiValueDict: {}>,
2019-10-08 18:32:21 stdout: [info]   'GET': <QueryDict: {}>,
2019-10-08 18:32:21 stdout: [info]   'META': { 'HTTP_USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X '
2019-10-08 18:32:21 stdout: [info]                                '10_14_6) AppleWebKit/537.36 (KHTML, like '
2019-10-08 18:32:21 stdout: [info]                                'Gecko) Chrome/77.0.3865.90 Safari/537.36',
2019-10-08 18:32:21 stdout: [info]             'REMOTE_ADDR': '::ffff:105.210.153.254',
2019-10-08 18:32:21 stdout: [info]             'SERVER_NAME': 'URL.io',
2019-10-08 18:32:21 stdout: [info]             'SERVER_PORT': 5240},
2019-10-08 18:32:21 stdout: [info]   'POST': <QueryDict: {}>,
2019-10-08 18:32:21 stdout: [info]   '_post_parse_error': False,
2019-10-08 18:32:21 stdout: [info]   'content_params': None,
2019-10-08 18:32:21 stdout: [info]   'content_type': None,
2019-10-08 18:32:21 stdout: [info]   'method': None,
2019-10-08 18:32:21 stdout: [info]   'path': '',
2019-10-08 18:32:21 stdout: [info]   'path_info': '',
2019-10-08 18:32:21 stdout: [info]   'resolver_match': None,
2019-10-08 18:32:21 stdout: [info]   'user': <User: cms>}

Obviously, HttpRequest.url is None, but the check only exists on checking request for None. It is still not clear yet why request.url is None.

Error:Failed to retrieve curtin config: ‘NoneType’ object has no attribute ‘url’ is oce oucurring in our instance of 2.8.1 … did you ever figure out what was going on with 2.6?

This could well be missing archive mirrors? Do you have a main and ports archive configured in the MAAS settings? http://your-maas.5240/MAAS/r/settings/repositories

It has been so long since that happened. I don’t recall what I did now, but I’ll bet I created a ticket. I’ll see if I can find one. If I can, I’ll post it here.

Here’s the bug report:

1 Like