[2.0] No error message is displayed when failed to add a domain

Bug #1550081 reported by Andres Rodriguez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Fix Released
High
Unassigned
2.0
Won't Fix
Critical
Unassigned

Bug Description

Trying to add Domains via the WebUI that are duplicated result in not being able to add the domain, however, the issue is that NO error message is displayed. The error is displayed in the UI. This needs to be sanitized as well:

2016-02-25 20:11:12 [-] Error on request (195) domain.create: {"name": ["Domain with this Name already exists."]}
        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/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/websockets/base.py", line 361, in create
            obj.save()
          File "/usr/lib/python3/dist-packages/maasserver/models/domain.py", line 263, in save
            super(Domain, self).save(*args, **kwargs)
          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: {'name': ['Domain with this Name already exists.']}

Changed in maas:
milestone: none → 2.0.0
importance: Undecided → High
status: New → Triaged
summary: - No error message is displayed when failed to add a domain
+ [2.0] No error message is displayed when failed to add a domain
tags: added: error-surface
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.