Default reactive certificate handlers may crash during update-status due to dns failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Base Layer |
Fix Released
|
High
|
Unassigned | ||
charm-ovn-central |
Fix Released
|
High
|
Unassigned |
Bug Description
As exemplified by this trace from the ovn-central charm the layer-openstack code 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/
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.
summary: |
- ovn-central crashed during update-status due to dns failure + Default reactive certificate handlers may crash during update-status due + to dns failure |
description: | updated |
Changed in charm-ovn-central: | |
status: | New → Triaged |
importance: | Undecided → High |
status: | Triaged → In Progress |
Changed in layer-openstack: | |
status: | In Progress → Fix Released |
Changed in charm-ovn-central: | |
milestone: | none → 22.04 |
Changed in charm-ovn-central: | |
status: | Fix Committed → Fix Released |
This looks like the default reactive handlers from layer-openstack to me?
https:/ /github. com/openstack/ charm-layer- openstack/ blob/5999eeaa5d 007b6ae8dc12753 976ef11f76684ee /reactive/ layer_openstack .py#L126- L137
Perhaps we should solve this for all of our reactive charms by guarding the default handlers with the is-update- status- hook flag?