Comment 0 for bug 1655049

Distro: Ubuntu 16.04
MAAS version:

For some node MAC addresses (I have a relatively old servers) I am unable to open MAAS dashboard page or Nodes page due to

"list index out of range"


2017-01-09T15:39:21+0100 [maasserver.websockets.websockets#debug] Opening connection with IPv6Address(TCP, '::1', 53172)
2017-01-09T15:39:21+0100 [maasserver.websockets.protocol#critical] Error on request (18) machine.list: list index out of range

Traceback (most recent call last):
  File "/usr/lib/python3.5/", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/", line 824, in worker
    return target()
  File "/usr/lib/python3/dist-packages/twisted/_threads/", line 46, in work
  File "/usr/lib/python3/dist-packages/twisted/_threads/", line 190, in doWork
--- <exception caught here> ---
  File "/usr/lib/python3/dist-packages/twisted/python/", line 246, in inContext
    result = inContext.theWork()
  File "/usr/lib/python3/dist-packages/twisted/python/", line 262, in <lambda>
    inContext.theWork = lambda:, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/lib/python3/dist-packages/twisted/python/", line 81, in callWithContext
    return func(*args,**kw)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/", line 857, in callInContext
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/", line 225, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/", line 603, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/", line 422, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/", line 30, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/", line 182, in list
    return super(MachineHandler, self).list(params)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/", line 358, in list
    for obj in objs
  File "/usr/lib/python3/dist-packages/maasserver/websockets/", line 358, in <listcomp>
    for obj in objs
  File "/usr/lib/python3/dist-packages/maasserver/websockets/", line 205, in full_dehydrate
    return self.dehydrate(obj, data, for_list=for_list)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/", line 187, in dehydrate
    obj, data, for_list=for_list)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/", line 118, in dehydrate
    data["pxe_mac_vendor"] = obj.get_pxe_mac_vendor()
  File "/usr/lib/python3/dist-packages/maasserver/models/", line 3021, in get_pxe_mac_vendor
    return get_vendor_for_mac(boot_interface.mac_address.get_raw())
  File "/usr/lib/python3/dist-packages/maasserver/utils/", line 20, in get_vendor_for_mac
    return data.oui.registration().org
  File "/usr/lib/python3/dist-packages/netaddr/eui/", line 478, in oui
    return OUI(self.value >> 24)
  File "/usr/lib/python3/dist-packages/netaddr/eui/", line 98, in __init__
    self._parse_data(data, offset, size)
  File "/usr/lib/python3/dist-packages/netaddr/eui/", line 145, in _parse_data
    record['org'] = line.split(None, 2)[2]
builtins.IndexError: list index out of range

For now I have worked around the issue by catching IndexError in "/usr/lib/python3/dist-packages/maasserver/utils/". After this workaround the Nodes page started working but Dashboard page required similar fix in "/usr/lib/python3/dist-packages/provisioningserver/utils/" in line 923

But this probably needs some investigation and fix - without the workaround I cannot use MAAS.