[solved][2.4]having difficulty deleting a dns record


#1

I have maas installed on a single ubuntu 18.04, I have one domain that is being managed with maas dns. I made a mistake the other day adding an entry and can’t remove it.

Essentially I have a domain like: home.{domain}.com being managed by maas.
I mistakenly added an A entry of: ad.home.{domain>}.com which translated to: ad.home..com.home.{domain}.com
When I try to remove it in the GUI no errors, just doesn’t remove it. In journalctl there is this entry that coincides with trying to remove the entry:

Dec 26 14:21:28 aiomaas sh[1187]: 2018-12-26 14:21:28 maasserver.websockets.protocol: [critical] Error on request (13) domain.delete_address_record: {"__all__": ["Invalid dnsresource name: ad.home.{domain}.com."]}
Dec 26 14:21:28 aiomaas sh[1187]:         Traceback (most recent call last):
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3.6/threading.py", line 864, in run
Dec 26 14:21:28 aiomaas sh[1187]:             self._target(*self._args, **self._kwargs)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 850, in worker
Dec 26 14:21:28 aiomaas sh[1187]:             return target()
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/_threads/_threadworker.py", line 46, in work
Dec 26 14:21:28 aiomaas sh[1187]:             task()
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/_threads/_team.py", line 190, in doWork
Dec 26 14:21:28 aiomaas sh[1187]:             task()
Dec 26 14:21:28 aiomaas sh[1187]:         --- <exception caught here> ---
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 250, in inContext
Dec 26 14:21:28 aiomaas sh[1187]:             result = inContext.theWork()
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/python/threadpool.py", line 266, in <lambda>
Dec 26 14:21:28 aiomaas sh[1187]:             inContext.theWork = lambda: context.call(ctx, func, *args, **kw)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 122, in callWithContext
Dec 26 14:21:28 aiomaas sh[1187]:             return self.currentContext().callWithContext(ctx, func, *args, **kw)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/twisted/python/context.py", line 85, in callWithContext
Dec 26 14:21:28 aiomaas sh[1187]:             return func(*args,**kw)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 883, in callInContext
Dec 26 14:21:28 aiomaas sh[1187]:             return func(*args, **kwargs)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/provisioningserver/utils/twisted.py", line 232, in wrapper
Dec 26 14:21:28 aiomaas sh[1187]:             result = func(*args, **kwargs)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 756, in call_within_transaction
Dec 26 14:21:28 aiomaas sh[1187]:             return func_outside_txn(*args, **kwargs)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/maasserver/utils/orm.py", line 563, in retrier
Dec 26 14:21:28 aiomaas sh[1187]:             return func(*args, **kwargs)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3.6/contextlib.py", line 52, in inner
Dec 26 14:21:28 aiomaas sh[1187]:             return func(*args, **kwds)
Dec 26 14:21:28 aiomaas sh[1187]:           File "/usr/lib/python3/dist-packages/maasserver/websockets/handlers/domain.py", line 176, in delete_address_record
Dec 26 14:21:28 aiomaas sh[1187]:             raise ValidationError(form.errors)
Dec 26 14:21:28 aiomaas sh[1187]:         django.core.exceptions.ValidationError: {'__all__': ['Invalid dnsresource name: ad.home.{domain}.com.']}
Dec 26 14:21:28 aiomaas sh[1187]:         

Could I delete it directly from the /etc/bind/maas/zone.home.{domain}.com file? or are there other locations that it would need to be removed from manually?


#2

You should be able to delete the dnsresource from the command line using the dnsresource id.

Once you have logged in to MAAS on the command line you should be able to run maas SESSION dnsresources read to list all the dnsresources with their ids and then run maas SESSION dnsresource delete ID to delete your unwanted dnsresource.

Cheers,
Lloyd


#3

That worked great, thanks.