DNS issues - unable to create new DNS records -

About 2 weeks ago, my status checks started bombing, resulting in the following:

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/dns/ipv6.py", line 183, in inet_aton
    return binascii.unhexlify(text)
binascii.Error: Non-hexadecimal digit found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/dns/reversename.py", line 52, in from_address
    v6 = dns.ipv6.inet_aton(text)
  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/dns/ipv6.py", line 185, in inet_aton
    raise dns.exception.SyntaxError
dns.exception.SyntaxError: Text input is malformed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 47, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "management/status_checks.py", line 377, in run_domain_checks_on_domain
    check_primary_hostname_dns(domain, env, output, dns_domains, dns_zonefiles)
  File "management/status_checks.py", line 461, in check_primary_hostname_dns
    existing_rdns_v6 = query_dns(dns.reversename.from_address(env['PUBLIC_IPV6']), "PTR") if env.get("PUBLIC_IPV6") else None
  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/dns/reversename.py", line 61, in from_address
    byte for byte in dns.ipv4.inet_aton(text)]
  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/dns/ipv4.py", line 49, in inet_aton
    raise dns.exception.SyntaxError
dns.exception.SyntaxError: Text input is malformed.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "management/status_checks.py", line 1100, in <module>
    run_and_output_changes(env, pool)
  File "management/status_checks.py", line 945, in run_and_output_changes
    run_checks(True, env, cur, pool)
  File "management/status_checks.py", line 67, in run_checks
    run_domain_checks(rounded_values, env, output, pool, domains_to_check=domains_to_check)
  File "management/status_checks.py", line 351, in run_domain_checks
    ret = pool.starmap(run_domain_checks_on_domain, args, chunksize=1)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 274, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
dns.exception.SyntaxError: Text input is malformed.

Existing DNS records serve up just fine. Attempting to create a new DNS record via the web ui fails on the first attempt, yielding a message " Custom DNS (Error)

500 Internal Server Error

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

"

The following entry appears in syslog

Sep 28 08:38:12 mail start[2293]: Zone not read, error: Syntax error, could not parse the RR's rdata at /etc/nsd/zones/apmnerdery.com.txt line 33
Sep 28 08:38:12 mail start[2293]: [2022-09-28 08:38:12,027] ERROR in app: Exception on /dns/custom/test2.apmnerdery.com/A [POST]
Sep 28 08:38:12 mail start[2293]: Traceback (most recent call last):
Sep 28 08:38:12 mail start[2293]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
Sep 28 08:38:12 mail start[2293]:     response = self.full_dispatch_request()
Sep 28 08:38:12 mail start[2293]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
Sep 28 08:38:12 mail start[2293]:     rv = self.handle_user_exception(e)
Sep 28 08:38:12 mail start[2293]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
Sep 28 08:38:12 mail start[2293]:     rv = self.dispatch_request()
Sep 28 08:38:12 mail start[2293]:   File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
Sep 28 08:38:12 mail start[2293]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
Sep 28 08:38:12 mail start[2293]:   File "/home/amarsaudon/mailinabox/management/daemon.py", line 75, in newview
Sep 28 08:38:12 mail start[2293]:     return viewfunc(*args, **kwargs)
Sep 28 08:38:12 mail start[2293]:   File "/home/amarsaudon/mailinabox/management/daemon.py", line 387, in dns_set_record
Sep 28 08:38:12 mail start[2293]:     return do_dns_update(env) or "Something isn't right."
Sep 28 08:38:12 mail start[2293]:   File "/home/amarsaudon/mailinabox/management/dns_update.py", line 90, in do_dns_update
Sep 28 08:38:12 mail start[2293]:     sign_zone(domain, zonefile, env)
Sep 28 08:38:12 mail start[2293]:   File "/home/amarsaudon/mailinabox/management/dns_update.py", line 725, in sign_zone
Sep 28 08:38:12 mail start[2293]:     + all_keys
Sep 28 08:38:12 mail start[2293]:   File "/home/amarsaudon/mailinabox/management/utils.py", line 123, in shell
Sep 28 08:38:12 mail start[2293]:     ret = getattr(subprocess, method)(cmd_args, **kwargs)
Sep 28 08:38:12 mail start[2293]:   File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
Sep 28 08:38:12 mail start[2293]:     raise CalledProcessError(retcode, cmd)
Sep 28 08:38:12 mail start[2293]: subprocess.CalledProcessError: Command '['/usr/bin/ldns-signzone', '-e', '20221028', '-n', '/etc/nsd/zones/apmnerdery.com.txt', '/tmp/Kapmnerdery.com.+008+11224', '/tmp/Kapmnerdery.com.+008+00243', '/tmp/Kapmnerdery.com.+007+43368', '/tmp/Kapmnerdery.com.+007+38597', '/tmp/Kapmnerdery.com.+013+01897', '/tmp/Kapmnerdery.com.+013+38173']' returned non-zero exit status 1.
Sep 28 08:38:12 mail Exception on /dns/custom/test2.apmnerdery.com/A [POST]#012Traceback (most recent call last):#012  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app#012    response = self.full_dispatch_request()#012  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request#012    rv = self.handle_user_exception(e)#012  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request#012    rv = self.dispatch_request()#012  File "/usr/local/lib/mailinabox/env/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request#012    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)#012  File "/home/amarsaudon/mailinabox/management/daemon.py", line 75, in newview#012    return viewfunc(*args, **kwargs)#012  File "/home/amarsaudon/mailinabox/management/daemon.py", line 387, in dns_set_record#012    return do_dns_update(env) or "Something isn't right."#012  File "/home/amarsaudon/mailinabox/management/dns_update.py", line 90, in do_dns_update#012    sign_zone(domain, zonefile, env)#012  File "/home/amarsaudon/mailinabox/management/dns_update.py", line 725, in sign_zone#012    + all_keys#012  File "/home/amarsaudon/mailinabox/management/utils.py", line 123, in shell#012    ret = getattr(subprocess, method)(cmd_args, **kwargs)#012  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call#012    raise CalledProcessError(retcode, cmd)#012subprocess.CalledProcessError: Command '['/usr/bin/ldns-signzone', '-e', '20221028', '-n', '/etc/nsd/zones/apmnerdery.com.txt', '/tmp/Kapmnerdery.com.+008+11224', '/tmp/Kapmnerdery.com.+008+00243', '/tmp/Kapmnerdery.com.+007+43368', '/tmp/Kapmnerdery.com.+007+38597', '/tmp/Kapmnerdery.com.+013+01897', '/tmp/Kapmnerdery.com.+013+38173']' returned non-zero exit status 1.
Sep 28 08:38:12 mail start[2293]: 127.0.0.1 - - [28/Sep/2022 08:38:12] "#033[35m#033[1mPOST /dns/custom/test2.apmnerdery.com/A HTTP/1.0#033[0m" 500 -

Repeated the attempt to create the record appears to complete successfully, but the new record never starts resolving / becomes functional.

Any idea what could be causing this?

There is probably something wrong with the PUBLIC_IPV6 setting in /etc/mailinabox.conf. If this isn’t something you manually set, there could be an issue in how the box autodetects it during setup.

The entries for PUBLIC_IPV6 and PRIVATE_IPV6 both allign with the output from “curl ipv6.icanhazip.com”. Should that not be the case? I just let the setup wizard autodetect, but I would just as soon disable ipv6 entirely unless there is a compelling reason to be running it.

Yeah uh probably if it matches icanhazip then it’s probably correct, I agree, and yet there’s an error, so it’s hard to say. But not only is there no compelling reason to have IPv6, there are probably compelling reasons to turn it off, so if that’s an option for you, that is a good way to go.