Failure processing network information when adding a rack

Bug #1926171 reported by Alberto Donato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Medium
Björn Tillenius

Bug Description

With current master, if I add a snap-based rack controller from latest/edge (running in a LXD container), I get a failure processing network info from the commissioning output:

2021-04-26 15:35:27 metadataserver.api: [critical] m2.maas(qfyfhy): commissioning script '50-maas-01-commissioning' failed during post-processing.
        Traceback (most recent call last):
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/api.py", line 820, in signal
            target_status = process(node, request, status)
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/api.py", line 641, in _process_commissioning
            self._store_results(
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/api.py", line 529, in _store_results
            script_result.store_result(
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/models/scriptresult.py", line 384, in store_result
            signal_status = try_or_log_event(
        --- <exception caught here> ---
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/api.py", line 447, in try_or_log_event
            func(*args, **kwargs)
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/hooks.py", line 1027, in process_lxd_results
            update_node_interfaces(node, data)
          File "/snap/maas/x1/lib/python3.8/site-packages/provisioningserver/utils/twisted.py", line 202, in wrapper
            result = func(*args, **kwargs)
          File "/snap/maas/x1/lib/python3.8/site-packages/maasserver/utils/orm.py", line 721, in call_within_transaction
            return func_within_txn(*args, **kwargs)
          File "/usr/lib/python3.8/contextlib.py", line 75, in inner
            return func(*args, **kwds)
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py", line 91, in update_node_interfaces
            interface = update_interface(
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py", line 153, in update_interface
            return update_physical_interface(
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py", line 226, in update_physical_interface
            update_physical_links(node, interface, links, new_vlan, update_fields)
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py", line 233, in update_physical_links
            update_ip_addresses = update_links(node, interface, links)
          File "/snap/maas/x1/lib/python3.8/site-packages/metadataserver/builtin_scripts/network.py", line 653, in update_links
            if attached_nic.node.id != node.id:
        builtins.AttributeError: 'NoneType' object has no attribute 'id'

Note that changing the last line to compare node objects rather than IDs works.

I'm not exactly sure what's the test case triggering the issue, but if I add debug to print out the `links` dict passed to `update_links` I see thew following:

2021-04-26 15:35:27 stdout: [info] [{'address': '10.45.222.252',
2021-04-26 15:35:27 stdout: [info] 'family': 'inet',
2021-04-26 15:35:27 stdout: [info] 'gateway': '10.45.222.1',
2021-04-26 15:35:27 stdout: [info] 'mode': 'static',
2021-04-26 15:35:27 stdout: [info] 'netmask': '24',
2021-04-26 15:35:27 stdout: [info] 'scope': 'global'}]
2021-04-26 15:35:27 stdout: [info]
2021-04-26 15:35:27 stdout: [info] [{'address': '172.16.100.226',
2021-04-26 15:35:27 stdout: [info] 'family': 'inet',
2021-04-26 15:35:27 stdout: [info] 'gateway': None,
2021-04-26 15:35:27 stdout: [info] 'mode': 'static',
2021-04-26 15:35:27 stdout: [info] 'netmask': '24',
2021-04-26 15:35:27 stdout: [info] 'scope': 'global'}]

Changed in maas:
status: Triaged → Fix Committed
assignee: nobody → Björn Tillenius (bjornt)
milestone: 3.0.0 → 3.0.0-rc1
Changed in maas:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers