Symptoms

When trying to add or remove DNS record for the domain the following error is thrown:

Internal error: APSC: Resource for domain XXXXX is not found.

or:

Could not persist APS entity "http://parallels.com/aps/types/pa/dns/zone/1.0"

Cause

APS representation of DNS zone is absent. It's either was not properly created or removed manually.

Resolution

Use attached script to find and fix all affected domains:

1. Download it to Management Node

2. Run with --dry-run flag to find if there are any affected items

3. Run without any flags to fix all affected items or with flag --domain-to-fix $domain_name to fix items of particular domain