Machines can't be deployed after deselecting all archs in the "Ubuntu extra architectures" package repo

Bug #1894116 reported by Victor Tapia
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Unassigned
2.7
Fix Committed
Medium
Victor Tapia
2.8
Fix Released
Medium
Victor Tapia
2.9
Fix Released
Medium
Victor Tapia
maas-ui
Fix Released
Unknown

Bug Description

Deselecting all archs in the "Ubuntu extra architectures"/ubuntu-ports package repo blocks new deployments from happening with the following error:

"Error:Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'"

When deselecting all archs and saving, the default archs are pulled in again (["amd64", "i386"]), which are filtered out by PackageRepository.get_ports_archive() because it looks for PORTS_ARCHES (["armhf", "arm64", "ppc64el", "s390x"]), triggering the error above.

The message doesn't give any information about the origin of the error. Given that this is a default repo, changing the archs pulled in when left empty or raising a warning when saving the changes seem to be good options for this bug.

Traceback from logs:

2020-11-25 16:29:01 maasserver.websockets.protocol: [critical] Error on request (49) machine.action: Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'
        Traceback (most recent call last):
          File "/usr/lib/python3.8/threading.py", line 870, in run
            self._target(*self._args, **self._kwargs)
          File "/snap/maas/10643/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 825, in worker
            return target()
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
            task()
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
            task()
        --- <exception caught here> ---
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
            result = inContext.theWork()
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
            inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/snap/maas/10643/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
            return func(*args,**kw)
          File "/snap/maas/10643/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 860, in callInContext
            return func(*args, **kwargs)
          File "/snap/maas/10643/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 192, in wrapper
            result = func(*args, **kwargs)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/utils/orm.py", line 737, in call_within_transaction
            return func_outside_txn(*args, **kwargs)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/utils/orm.py", line 540, in retrier
            return func(*args, **kwargs)
          File "/usr/lib/python3.8/contextlib.py", line 75, in inner
            return func(*args, **kwds)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/websockets/base.py", line 402, in prep_user_execute
            return self._call_method_track_queries(
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/websockets/base.py", line 426, in _call_method_track_queries
            result = method(params)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/websockets/handlers/machine.py", line 945, in action
            return action.execute(**extra_params)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/node_action.py", line 171, in execute
            self._execute(*args, **kwargs)
          File "/snap/maas/10643/lib/python3.8/site-packages/maasserver/node_action.py", line 540, in _execute
            raise NodeActionError("Failed to retrieve curtin config: %s" % e)
        maasserver.exceptions.NodeActionError: Failed to retrieve curtin config: 'NoneType' object has no attribute 'url'

Tags: sts ui

Related branches

Revision history for this message
Victor Tapia (vtapia) wrote :

Adding maas-ui because this could be fixed by setting a different set of default values or just showing an error message when left empty.

Revision history for this message
Lee Trager (ltrager) wrote :

A user can also remove repositories with the API. We should check if this bug is reproducible on the API. If so this should probably be fixed on the backend.

Revision history for this message
Bill Wear (billwear) wrote :

I can confirm that this behavior indeed occurs under the conditions given. Triaging this bug.

Changed in maas:
status: New → Triaged
Revision history for this message
Bill Wear (billwear) wrote :

Oops, noticed UI tag. Putting status back to new.

Changed in maas:
status: Triaged → New
Revision history for this message
Bill Wear (billwear) wrote :

From the CLI, I do not seem to be able to: (1) delete the repository (refused), disable the repository (refused), or change the list of architectures such that they are all blank ("not a valid architecture"). Someone else may know how to do this, but I can't seem to reproduce this with the CLI due to built-in protections.

Revision history for this message
Victor Tapia (vtapia) wrote :

This patch changes the default arches for PORTS_ARCHES to "armhf", "arm64", "powerpc" and "ppc64el"

tags: added: ui
no longer affects: maas
affects: maas-ui → maas
description: updated
Changed in maas-ui:
importance: Undecided → Unknown
Revision history for this message
Victor Tapia (vtapia) wrote :

Opened MR to backport patch to 2.7, 2.8 and 2.9 (f75199f7e in master)

Changed in maas:
status: New → Fix Committed
importance: Undecided → Medium
milestone: none → 2.10-beta1
Changed in maas:
status: Fix Committed → Fix Released
Changed in maas-ui:
status: New → Fix Released
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.