netaddr.core.AddrFormatError: failed to detect a valid IP address from None

Bug #1486489 reported by Andres Rodriguez
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Won't Fix
Critical
Mike Pontillo

Bug Description

When debugging the CI, I came accross the following issue.

The way i reproduced is because I noticed that dhcpd complained about not being able to write a new leases file. What I did was to remove the old leases file (rm -rf /var/lib/maas/dhcp/*.leases*) and restart maas-dhcpd so the new leases file are generated. However, when trying to deploy the following error is given.

This seems to be pretty critical because it seems that if there are no leases for a specific MAC/Interface, MAAS can't allocate an IP to an interface.

==> /var/log/maas/regiond.log <==
2015-08-19 02:00:51 [-] Error on request (29) node.action: failed to detect a valid IP address from None
        Traceback (most recent call last):
          File "/usr/lib/python2.7/threading.py", line 783, in __bootstrap
            self.__bootstrap_inner()
          File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
            self.run()
          File "/usr/lib/python2.7/threading.py", line 763, in run
            self.__target(*self.__args, **self.__kwargs)
        --- <exception caught here> ---
          File "/usr/lib/python2.7/dist-packages/twisted/python/threadpool.py", line 196, in _worker
            result = context.call(ctx, function, *args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callWithContext
            return func(*args,**kw)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 474, in call_within_transaction
            return func_outside_txn(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 301, in retrier
            return func(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 371, in inner
            return func(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/provisioningserver/utils/twisted.py", line 158, in wrapper
            return func(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 458, in call_within_transaction
            return func_within_txn(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 371, in inner
            return func(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/maasserver/websockets/base.py", line 332, in execute
            return m(params)
          File "/usr/lib/python2.7/dist-packages/maasserver/websockets/handlers/node.py", line 519, in action
            return action.execute(**extra_params)
          File "/usr/lib/python2.7/dist-packages/maasserver/node_action.py", line 317, in execute
            self.node.start(self.user)
          File "/usr/lib/python2.7/dist-packages/maasserver/utils/orm.py", line 458, in call_within_transaction
            return func_within_txn(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/django/db/transaction.py", line 371, in inner
            return func(*args, **kwargs)
          File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 2162, in start
            update_host_maps=update_host_maps)
          File "/usr/lib/python2.7/dist-packages/maasserver/models/node.py", line 1951, in claim_static_ip_addresses
            update_host_maps=update_host_maps)
          File "/usr/lib/python2.7/dist-packages/maasserver/models/macaddress.py", line 300, in claim_static_ips
            alloc_type, requested_address, fabric, user, update_host_maps)
          File "/usr/lib/python2.7/dist-packages/maasserver/models/interface.py", line 424, in claim_static_ips
            allocations = self._map_allocated_addresses(cluster_interfaces)
          File "/usr/lib/python2.7/dist-packages/maasserver/models/interface.py", line 323, in _map_allocated_addresses
            cluster_interfaces, IPAddress(sip.ip))
          File "/usr/lib/python2.7/dist-packages/netaddr/ip/__init__.py", line 307, in __init__
            'address from %r' % addr)
        netaddr.core.AddrFormatError: failed to detect a valid IP address from None

Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
importance: Undecided → Critical
status: New → Triaged
Revision history for this message
Cheryl Jennings (cherylj) wrote :

I got the "failed to detect a valid IP address from None" error when trying to juju bootstrap to a newly created vMAAS:

2015-11-19 03:16:56 ERROR cmd supercommand.go:448 failed to bootstrap environment: cannot start bootstrap instance: gomaasapi: got error back from server: 500 INTERNAL SERVER ERROR (failed to detect a valid IP address from None)

Full bootstrap with --debug: http://paste.ubuntu.com/13339974/
MAAS levels: http://paste.ubuntu.com/13339997/
dhcp.leases: http://paste.ubuntu.com/13340084/

I also get this error if I try to deploy a node from the GUI.

Is there any workaround?

Revision history for this message
Cheryl Jennings (cherylj) wrote :

I didn't have the static range defined in previous attempts. Once I added that in, I was able to deploy from the GUI and through a juju bootstrap.

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Ok, it seems that Cheryl didn't have a Static Range defined. There was only a dynamic range defined. It seems that MAAS is failing to deploy machines where there's no static IP addresses defined.

Revision history for this message
Cheryl Jennings (cherylj) wrote :

Traceback from the error: http://paste.ubuntu.com/13349302/

Revision history for this message
Mike Pontillo (mpontillo) wrote :

Here's the traceback from Cheryl's system: http://paste.ubuntu.com/13349302/

It looks like a similar (but slightly different) issue; in Cheryl's case, this is via claim_auto_ips(), whereas the original issue was via claim_static_ips().

Changed in maas:
importance: Critical → High
Changed in maas:
importance: High → Critical
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Dear user,

This is an automated message.

We believe this bug report is no longer an issue in the latest version of MAAS. For such reason, we are making this issue as Won't Fix. If you believe this issue is still present in the latest version of MAAS, please re-open this bug report.

Changed in maas:
status: Triaged → Won't Fix
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.