Skip to content

Commit

Permalink
Chg: Issues List
Browse files Browse the repository at this point in the history
Fix: Adding / Removing Records
  • Loading branch information
tsiedsma committed Jul 15, 2019
1 parent 684090e commit 1c1e612
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
12 changes: 4 additions & 8 deletions ISSUES.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
## Issues List: ##
1) Deleting a Site deletes the zone and then tries to delete records but they were already deleted with the zone
2) Creating MX records just doesn't work
3) Deleting records seems to fail at $id = $this->getRecordId($record);

ERROR : Failed to transfer DNS records from PowerDNS - try again later. Response code: 404
I know that's generated in the zoneAxfr method, but not sure why it happens during delete.


### Issue 1 ###
I know the "ERROR" is generated in the zoneAxfr method, but not sure why it happens during delete.
```ERROR : Failed to transfer DNS records from PowerDNS - try again later. Response code: 404
DEBUG : 0.68447: Dns_Module -> _delete
DEBUG : 0.04320: Mysql_Module -> _delete
DEBUG : 0.00006: Ipinfo_Module -> _delete
DEBUG : Service config `billing' disabled for site - disabling calling hook `_delete' on `Billing_Module'
DEBUG : Service config `pgsql' disabled for site - disabling calling hook `_delete' on `Pgsql_Module'
DEBUG : 0.00054: Site_Module -> _delete
ERROR : Failed to transfer DNS records from PowerDNS - try again later. Response code: 404```
ERROR : Failed to transfer DNS records from PowerDNS - try again later. Response code: 404

Seems to be trying to delete records after deleting the zone which deletes the records...
Seems to be trying to delete records after deleting the zone which deletes the records...
25 changes: 14 additions & 11 deletions src/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function formatRecord(Record $r): ?array
case 'MX':
$priority = (int) $r->getMeta('priority');
$content = sprintf(
'%d%s',
'%d %s',
$r->getMeta('priority'),
$this->canonical($r->getMeta('data'))
);
Expand Down Expand Up @@ -238,7 +238,7 @@ private function renderMessage(ClientException $e): string
public function remove_record(string $zone, string $subdomain, string $rr, string $param = null): bool
{
$zone = trim($zone, '.');
if (! $this->canonicalizeRecord($zone, $subdomain, $rr, $param))
if (! $canonicalZone = $this->canonicalizeRecord($zone, $subdomain, $rr, $param))
{
return false;
}
Expand All @@ -247,23 +247,26 @@ public function remove_record(string $zone, string $subdomain, string $rr, strin
'name' => $subdomain,
'rr' => $rr,
'parameter' => $param,
'ttl' => self::DNS_TTL,
]);

// Not sure how this is used
// $id = $this->getRecordId($record);

if ($record['name'] === '@')
{
$record['name'] = '';
$record['name'] = $this->canonical($zone);
} else {
$record['name'] = $this->canonical(implode('.', [$subdomain, $zone]));
}

$api = $this->makeApi();

$id = $this->getRecordId($record);
if (! $id)
{
$fqdn = implode('.', [$subdomain, $zone]);

return error("Record '%s' (rr: '%s', param: '%s') does not exist", $fqdn, $rr, $param);
}
// if (! $id)
// {
// $fqdn = implode('.', [$subdomain, $zone]);
//
// return error("Record '%s' (rr: '%s', param: '%s') does not exist", $fqdn, $rr, $param);
// }

$rrsets[] = [
'records' => '',
Expand Down

0 comments on commit 1c1e612

Please sign in to comment.