The ovn-central charm is doing DNS lookups during the update-status hook and this crashed the charm. Although it's a reactive charm, it probably shouldn't be doing this much work, and should certainly handle a DNS lookup failure better than just crashing:
2021-12-13 16:42:36 ERROR juju-log Hook error:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-ovn-central-0/charm/reactive/layer_openstack.py", line 134, in default_request_certificates
for cn, req in instance.get_certificate_requests().items():
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charms_openstack/charm/classes.py", line 290, in get_certificate_requests
return cert_utils.get_certificate_request(
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charmhelpers/contrib/openstack/cert_utils.py", line 142, in get_certificate_request
req.add_hostname_cn()
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charmhelpers/contrib/openstack/cert_utils.py", line 93, in add_hostname_cn
'cn': get_hostname(ip),
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charmhelpers/contrib/network/ip.py", line 523, in get_hostname
result = ns_query(rev)
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/charmhelpers/contrib/network/ip.py", line 479, in ns_query
answers = dns.resolver.query(address, rtype)
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/dns/resolver.py", line 1100, in query
return get_default_resolver().query(qname, rdtype, rdclass, tcp, source,
File "/var/lib/juju/agents/unit-ovn-central-0/.venv/lib/python3.8/site-packages/dns/resolver.py", line 898, in query
raise NoNameservers(request=request, errors=errors)
dns.resolver.NoNameservers: All nameservers failed to answer the query 158.0.16.172.in-addr.arpa. IN PTR: Server 127.0.0.53 UDP port 53 answered SERVFAIL
This happened on ServerStack which does have a known propensity for DNS lookup failures.
The ovn-central charm is doing DNS lookups during the update-status hook and this crashed the charm. Although it's a reactive charm, it probably shouldn't be doing this much work, and should certainly handle a DNS lookup failure better than just crashing:
2021-12-13 16:42:36 ERROR juju-log Hook error: juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charms/ reactive/ __init_ _.py", line 74, in main dispatch( restricted= restricted_ mode) juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charms/ reactive/ bus.py" , line 390, in dispatch other_handlers) juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charms/ reactive/ bus.py" , line 359, in _invoke invoke( ) juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charms/ reactive/ bus.py" , line 181, in invoke _action( *args) juju/agents/ unit-ovn- central- 0/charm/ reactive/ layer_openstack .py", line 134, in default_ request_ certificates get_certificate _requests( ).items( ): juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charms_ openstack/ charm/classes. py", line 290, in get_certificate _requests get_certificate _request( juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charmhelpers/ contrib/ openstack/ cert_utils. py", line 142, in get_certificate _request add_hostname_ cn() juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charmhelpers/ contrib/ openstack/ cert_utils. py", line 93, in add_hostname_cn juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charmhelpers/ contrib/ network/ ip.py", line 523, in get_hostname juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ charmhelpers/ contrib/ network/ ip.py", line 479, in ns_query query(address, rtype) juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ dns/resolver. py", line 1100, in query resolver( ).query( qname, rdtype, rdclass, tcp, source, juju/agents/ unit-ovn- central- 0/.venv/ lib/python3. 8/site- packages/ dns/resolver. py", line 898, in query request= request, errors=errors) NoNameservers: All nameservers failed to answer the query 158.0.16. 172.in- addr.arpa. IN PTR: Server 127.0.0.53 UDP port 53 answered SERVFAIL
Traceback (most recent call last):
File "/var/lib/
bus.
File "/var/lib/
_invoke(
File "/var/lib/
handler.
File "/var/lib/
self.
File "/var/lib/
for cn, req in instance.
File "/var/lib/
return cert_utils.
File "/var/lib/
req.
File "/var/lib/
'cn': get_hostname(ip),
File "/var/lib/
result = ns_query(rev)
File "/var/lib/
answers = dns.resolver.
File "/var/lib/
return get_default_
File "/var/lib/
raise NoNameservers(
dns.resolver.
This happened on ServerStack which does have a known propensity for DNS lookup failures.