[2.1] mDNS label contains disallowed characters

Bug #1623878 reported by Gavin Panella
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
Critical
Mike Pontillo

Bug Description

At home I have a device on my network with the name "Living room". This is escaped by Avahi to "Living\032room", but this is rejected by MAAS.

1. This name ought to be accepted by MAAS.

2. Properly invalid names should not cause a crash like this.

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File ".../provisioningserver/utils/twisted.py", line 790, in worker
    return target()
  File ".../twisted/_threads/_threadworker.py", line 46, in work
    task()
  File ".../twisted/_threads/_team.py", line 190, in doWork
    task()
--- <exception caught here> ---
  File ".../twisted/python/threadpool.py", line 246, in inContext
    result = inContext.theWork()
  File ".../twisted/python/threadpool.py", line 262, in <lambda>
    inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
  File ".../twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File ".../twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File ".../provisioningserver/utils/twisted.py", line 823, in
  callInContext
    return func(*args, **kwargs)
  File ".../maasserver/utils/orm.py", line 603, in
  call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File ".../maasserver/utils/orm.py", line 422, in retrier
    return func(*args, **kwargs)
  File "/usr/lib/python3.5/contextlib.py", line 30, in inner
    return func(*args, **kwds)
  File ".../maasserver/regiondservices/networks_monitoring.py", line 60,
  in recordMDNSEntriesIntoDatabase
    region_controller.report_mdns_entries(mdns)
  File ".../maasserver/models/node.py", line 4041, in
  report_mdns_entries
    interface.update_mdns_entry(entry)
  File ".../maasserver/models/interface.py", line 1225, in
  update_mdns_entry
    interface=self, ip=ip, hostname=hostname)
  File ".../django/db/models/manager.py", line 127, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File ".../django/db/models/query.py", line 348, in create
    obj.save(force_insert=True, using=self.db)
  File ".../maasserver/models/cleansave.py", line 28, in save
    self.full_clean()
  File ".../django/db/models/base.py", line 1171, in full_clean
    raise ValidationError(errors)
django.core.exceptions.ValidationError: {'hostname': ["Label contains
disallowed characters: 'Living\\\\032room'."]}

Related branches

Changed in maas:
milestone: none → 2.1.0
importance: High → Critical
Changed in maas:
status: Triaged → Fix Committed
summary: - mDNS label contains disallowed characters
+ [2.1] mDNS label contains disallowed characters
Changed in maas:
status: Fix Committed → Fix Released
Changed in maas:
assignee: nobody → Mike Pontillo (mpontillo)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.