Comment 4 for bug 1774529

Revision history for this message
zw.paper (zw-paper) wrote : Re: [2.4] Cannot delete some instances of model 'Domain' because they are referenced through a protected foreign key

Hi Andres,

I met this error in my env too.

I do not create any rack controller because this is a domain for testing or some internal using.

Here is what I did:
1. Install a MAAS.
2. Create a domain: test.com
3. Create an A record: host.test.com -> 10.10.10.10
4. Delete the A record

Then I can not delete the domain test.com
the same error msg as James.

What I found:
When deleting the record:
1. MAAS deleted the record from maasserver_dnsresource_ip_addresses in PG.
2. There is one more record in maasserver_dnsresource in PG

When I was trying to delete the domain
1. the record in maasserver_dnsresource has the foreign key pointing to maasserver_domain.