[2.0prea2] django.core.exceptions.ValidationError: {'mac_address': ["'74:d4:35:89:bb:c' is not a valid MAC address."]}

Bug #1556358 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Expired
Undecided
Unassigned

Bug Description

2016-03-12 11:36:20 [-] Unhandled failure in updating lease.
        Traceback (most recent call last):
          File "/usr/lib/python3.5/threading.py", line 862, in run
            self._target(*self._args, **self._kwargs)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 794, 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 246, in inContext
            result = inContext.theWork()
          File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 262, in <lambda>
            inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 118, in callWithContext
            return self.currentContext().callWithContext(ctx, func, *args, **kw)
          File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 81, in callWithContext
            return func(*args,**kw)
          File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 197, in wrapper
            return func(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 448, in call_within_transaction
            return func_outside_txn(*args, **kwargs)
          File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 275, in retrier
            return func(*args, **kwargs)
          File "/usr/lib/python3.5/contextlib.py", line 30, in inner
            return func(*args, **kwds)
          File "/usr/lib/python3/dist-packages/maasserver/rpc/leases.py", line 99, in update_lease
            unknown_interface.save()
          File "/usr/lib/python3/dist-packages/maasserver/models/cleansave.py", line 28, in save
            self.full_clean()
          File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 1171, in full_clean
            raise ValidationError(errors)
        django.core.exceptions.ValidationError: {'mac_address': ["'74:d4:35:89:bb:c' is not a valid MAC address."]}

Related branches

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

What is the expected MAC address? I'm guessing we aren't getting the MAC in the format we expect:

    74:d4:35:89:bb:c

There are two possibilities here:

(1) The MAC is actually correct, and we're just interpreting it incorrectly. That would mean it should be:

    74:d4:35:89:bb:0c

(2) We have an off-by-one error somewhere, and there is a missing nibble at the end of the MAC. In that case the actual MAC is in the set:

    74:d4:35:89:bb:c[0-9a-f]

Changed in maas:
status: New → Incomplete
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Still inconclusive, but I checked "man 5 dhcp-eval" and found this; it doesn't specify whether or not the ASCII values are zero-filled.

       binary-to-ascii (numeric-expr1, numeric-expr2, data-expr1, data-expr2)
         Converts the result of evaluating data-expr2 into a text string containing one
         number for each element of the result of evaluating data-expr2. Each number
         is separated from the other by the result of evaluating data-expr1. The
         result of evaluating numeric-expr1 specifies the base (2 through 16) into
         which the numbers should be converted. The result of evaluating numeric-expr2
         specifies the width in bits of each number, which may be either 8, 16 or 32.

         As an example of the preceding three types of expressions, to produce the name
         of a PTR record for the IP address being assigned to a client, one could write
         the following expression:

               concat (binary-to-ascii (10, 8, ".",
                                        reverse (1, leased-address)),
                       ".in-addr.arpa.");

We use this in etc/maas/templates/dhcp/dhcpd.conf.template now to call the notifier.

I wonder -- if this fails, will DHCP crash?

Revision history for this message
LaMont Jones (lamont) wrote :

Left outstanding with my related branch is any understanding of exactly where the (perfectly valid but erroneously rejected by us) MAC address came from... if it was us, we should fix that code, if it was elsewhere, we can discuss whether or not they should get a bug filed against them...

Revision history for this message
LaMont Jones (lamont) wrote :

Hence, leaving this bug marked as "incomplete"

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for MAAS because there has been no activity for 60 days.]

Changed in maas:
status: Incomplete → Expired
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.