[2.2b1] Cannot add a device from the dashboard

Bug #1659959 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Richard McCartney

Bug Description

Description
===========

When trying to add a device from the dashboard, it fails becuas the original hostname contains incorrect characters. However, once you change the hostname to have valid characters, it still thinks it has the old hostname.

Reproduce
=========
1. Go to the dashboard
2. Select a device
3. Change the hostname to a valid one.
4. Try to add, it will fail to validate.

raceback (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 824, 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 857, in callInContext
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 225, in wrapper
    result = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 685, in call_within_transaction
    return func_outside_txn(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 503, 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/websockets/handlers/device.py", line 298, in create
    data = super(DeviceHandler, self).create(params)
  File "/usr/lib/python3/dist-packages/maasserver/websockets/base.py", line 393, in create
    raise HandlerValidationError(form.errors)
maasserver.websockets.base.HandlerValidationError: {'hostname': ["Label contains disallowed characters: 'unknown-D-Link International-7d-d6-3f'."]}

Related branches

Changed in maas:
importance: Undecided → High
status: New → Confirmed
milestone: none → 2.2.0
Changed in maas:
status: Confirmed → Triaged
Changed in maas:
status: Triaged → In Progress
assignee: nobody → Richard McCartney (ricgard)
Changed in maas:
status: In Progress → Fix Committed
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

Remote bug watches

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