Returned Errors

In many conditions the core will return an array with an error key when an error occurred during an task. Depending on which layer this error occurred the array may look different. See the examples below of an system error and an (dns) validation error when importing zones.

System Error
array() {
  ["error"]=>
  array() {
    ["code"] => "5001"
    ["desc"] => "Nameserver database unavailable."
  }
}
Please note DNS errors may be returned together with an success array when multiple rows are edited at once.
DNS Error
array() {
  ["errors"]=>
  array() {
    [0]=>
    array() {
      ["record"]=>
      array() {
        ["type"] => "A"
        ["content"] => "192.168.2.999"
        ["name"] => "example.com"
        ["prio"] => "0"
        ["ttl"] => "3600"
      }
      ["code"] => "INVALID_IPV4"
      ["field"] => "content"
      ["desc"] => "IPv4 address does not seem to be valid."
    }
  }
}

Exceptions

The PHP engine might also return errors. When in debug mode all notices, warnings and fatal errors are printed on screen. If debug mode is disabled only fatal errors are returned as catchable exception. For this reason we strongly recommend to surround any operations within an try/catch block to facilitate the catching of potential exceptions.

use solutedns\Dns\Zones;

try {

	$zones = new Zones();
	$zones->session();

	$zones->add('example.com');
	$zones->nsec3('example.com');
	$zones->rectify('example.com');

} catch (Exception $ex) {

	echo 'Caught exception: ',  $ex->getMessage(), "\n";

}

Error Codes

Zone Errors
3000
Zone already exists.
3001
Zone could not be found.
3002
Invalid zone name provided.
3003
Slave zone cannot be edited directly.
3004
No zone name has been provided.
Records Errors
4000
Maximum allowed records has been reached.
System Errors
5000
License failure, see the returned license array to troubleshoot this issue.
5001
Nameserver database is unavailable.
5002
Maximum licensed zones has been reached.
DNSsec Errors
6000
Unable to login or connect to the SSH service.
6001
An incorrect SSH session was provided.
6002
An SSH error occured: {error-message}
6003
Failed to secure zone.
6004
Unexpected SSH Answer.
Health Errors
7000
One or more nameservers failed to report.
7001
Not all nameservers agree on the SOA serial for this zone.
7002
The registry returned one or more unknown nameservers.
7003
There are NS records in this zone which are not known by the registry.
7004
There is one or more nameservers which do not seem to be authoritative for this zone.
7005
It seems the domain is using an different DNS cluster.
7006
There is one or more record(s) with errors in this zone.
7007
There is one or more record(s) with warnings in this zone.
Validation Errors
NO_DATABASE
Validation not possible. Database connection not available.
ZONE_NOT_FOUND
Zone has not been found.
RECORD_NOT_FOUND
Record has not been found.
DOMAIN_NOT_IN_NAME
The name field must contain the domain name. field
ZONE_NAME_INVALID
Zone name is not an FQHN.
INVALID_FQHN
A <type> record must contain a valid hostname, do not end with a dot (.). field
NOT_UNIQUE
Similar record already exists.
NON_ALIAS_TARGET
You cannot refer a NS or MX record to a CNAME record.
TYPE_EMPTY
Record type cannot be empty. field
INVALID_TYPE
Record type is not recognized. field
TYPE_UNALLOWED
Record type is not allowed. field
INVALID_TTL
The TTL value must be numeric. field
CONTENT_TOO_LONG
The entered content value is to long and cannot contain more then 4096 characters. field
INVALID_IPV4
IPv4 address does not seem to be valid. field
INVALID_IPV6
IPv6 address does not seem to be valid. IPv4 addresses in IPv6 notation are not supported. field
RECORD_NO_PRIORITY
A MX record requires you to specify a numeric priority. field
RECORD_INVALID_PRIORITY
A MX record requires you to specify a numeric priority. field
INVALID_ARPA
Reverse name not valid. field
SOA_PARTS_MISSING
The SOA record must contain: {primary-ns} {hostmaster} {serial} {refresh} {retry} {expire} {default_ttl}
SOA_PART_0_INVALID
Primary nameserver domain is not valid.
SOA_PART_1_INVALID
Hostmaster e-mail address is not valid.
SOA_PART_INVALID
SOA record part <int> must be a valid numeric. part
INVALID_NOT_QUOTED
A <type> record must contain a quoted string. field
NAPTR_PARTS_MISSING
A NAPTR record must contain (including the quotes and trailing dot): {order} {preference} “{flags}” “{service}” “{regexp}” replacement.
NAPTR_PART_INVALID
Record part <int> must be numeric. part
NAPTR_PART_QUOTE_INVALID
Record part <int> must be quoted. part
NAPTR_PART_FLAGS_INVALID
Record part <int> contains invalid characters. This part may only contain alphanumeric characters. part
NAPTR_PART_EX_FLAGS_INVALID
Record part <int> contains too many FLAGS (S, A, U). Only one can be used each time. part
NAPTR_PART_TERMINAL_FLAG_INVALID
A SERVICE (record part <int>) must be specified if the FLAGS including a terminal flag. part
NAPTR_PART_SERVICE_INVALID
SERVICE (record part <int>) seems to be invalid. part
NAPTR_PART_DELIMITER_INVALID
The POSIX replacement regexp (record part <int>) is invalid. Delimiter may not be: ‘i’, ” or be a digit. part
NAPTR_PART_MISSING_INVALID
The POSIX replacement regexp (record part <int>) is invalid. Not all required parts were specified. part
NAPTR_PART_BACKREF_INVALID
The POSIX replacement regexp (record part <int>) is invalid. Only one back reference can be used, and should be like: ‘1’. part
NAPTR_PART_FLAG_INVALID
The POSIX regexp flag of (record part <int>) is invalid. Optionally it may contain ‘i’, or nothing at all. part
NAPTR_PART_EMPTY_INVALID
Record part <int> is invalid and must be a record pointer or single dot. part
NAPTR_PART_SIM_INVALID
REGEXP and REPLACEMENT variable (record part <int>) cannot be used simoustaneously. part
NAPTR_PART_REPLACEMENT_INVALID
REPLACEMENT variable (record part <int>) must be either ‘.’ or a valid domain. part
RP_PARTS_MISSING
RP records must have: {mailbox name} {more info pointer}
RP_PART_0_INVALID
The mailbox name has to be an email address with the atsign (@) replaced for a dot (.).
RP_PART_1_INVALID
The more-info pointer must be a valid domain name.
TLSA_PARTS_MISSING
A TLSA record must contain a: {usage} {selector} {type} {fingeprint}
TLSA_PART_0_INVALID
Either a: 0 (PKIX-TA), 1 (PKIX-EE), 2 (DANE-TA) or 3 (DANE-EE) usage field must be provided.
TLSA_PART_1_INVALID
Either: 0 (Match full certificate) or 1 (Match only SubjectPublicKeyInfo) selector field must be provided.
TLSA_PART_2_INVALID
Either: 0 (Exact match), 1 (SHA-256 hash) or 2 (SHA-512 hash) matching type field must be provided.
TLSA_PART_3_INVALID
A SHA-256 fingerprint with 64 character ASCII hexadecimal must be provided.
TLSA_PART_4_INVALID
A SHA-512 fingerprint with 128 character ASCII hexadecimal must be provided.
CAA_PARTS_MISSING
CAA records must have: <flag> <tag> <value>. field
CAA_PART_0_INVALID
The flag (part 1) must be numeric and between 0-255. field
CAA_PART_1_INVALID
The tag (part 2) must be: issue, issuewild or iodef. field
CAA_PART_2_INVALID
The value (part 3) must be quoted. field
SSHFP_PARTS_MISSING
A SSHFP record must contain a: {algorithm} {fp-type} {fingeprint}
SSHFP_PART_O_INVALID
Either a: 1 (RSA), 2 (DSA) or 3 (ECDSA) algorithm, must be provided.
SSHFP_PART_1_INVALID
Either: 1 (SHA-1) or 2 (SHA-256) as fp-type, must be provided.
SSHFP_PART_2_INVALID
A SHA-1 fingerprint with 40 character ASCII hexadecimal must be provided.
SSHFP_PART_3_INVALID
A SHA-256 fingerprint with 64 character ASCII hexadecimal must be provided.
SRV_MISSING_PRIORITY
A priority must be provided. field
SRV_PARTS_MISSING
The SRV record must contain: {weight} {port} {service}
SRV_PART_WEIGHT_INVALID
Part <int> (Weight) must be numeric. part
SRV_PART_PORT_INVALID
Part <int> (Port) must be numeric. part
SRV_PART_SERVICE_INVALID
A SRV record must contain a valid domain as service. part
HINFO_INVALID
The HINFO content field contains an invalid value.
ZONE_KEY_INVALID_FLAG
Flag is invalid.
ZONE_KEY_INVALID_BITS
Bits are invalid.
ZONE_KEY_INVALID_ALGORITHM
Algorithm is invalid.