FreeIPA 4.12.2-24.el10 (AlmaLinux 10), also confirmed present in upstream master.
ipa-ods-exporter enters an infinite crash loop after enabling DNSSEC via ipa-dns-install --dnssec-master. The crash is caused by a bare assert in localhsm.py:Key.__init__() that fails when SoftHSM contains objects with zero-length CKA_ID.
ipa-ods-exporter
ipa-dns-install --dnssec-master
assert
localhsm.py:Key.__init__()
FreeIPA's DNSSEC setup creates ipaSecretKeyObject LDAP entries (wrapped master key copies) without setting ipk11Id. When ipa-dnskeysyncd syncs these to SoftHSM, the objects get empty CKA_ID attributes. localhsm.py line 38 asserts len(cka_id) != 0 and crashes the process.
ipaSecretKeyObject
ipk11Id
ipa-dnskeysyncd
localhsm.py
len(cka_id) != 0
The crash is in find_keys() → Key.__init__(), which means one malformed key prevents enumeration of ALL keys in the token.
find_keys()
Key.__init__()
File "/usr/libexec/ipa/ipa-ods-exporter", line 720 master2ldap_zone_keys_sync(ldapkeydb, localhsm) File "/usr/libexec/ipa/ipa-ods-exporter", line 425 pubkeys_local = localhsm.zone_pubkeys File "ipaserver/dnssec/localhsm.py", line 114, in find_keys key = Key(self.p11, h) File "ipaserver/dnssec/localhsm.py", line 38, in init assert len(cka_id) != 0, 'ipk11id length should not be 0' AssertionError: ipk11id length should not be 0
Cleaning SoftHSM tokens and re-running --dnssec-master reproduces the same crash — the bug is in the setup code path, not stale data.
--dnssec-master
LocalHSM.__del__() crashes with AttributeError: 'LocalHSM' object has no attribute 'p11' when __init__ fails (e.g., missing SoftHSM token after cleanup).
LocalHSM.__del__()
AttributeError: 'LocalHSM' object has no attribute 'p11'
__init__
The LDAP counterpart ldapkeydb.py:_get_key_dict() already handles missing ipk11Id gracefully with raise ValueError — but localhsm.py uses a bare assert for the equivalent check.
ldapkeydb.py:_get_key_dict()
raise ValueError
PR forthcoming. The fix: 1. Replaces bare assert with _ipap11helper.NotFound exception 2. Adds try/except in find_keys() to log and skip malformed keys 3. Fixes __del__ AttributeError with hasattr guard
_ipap11helper.NotFound
__del__
hasattr
Metadata Update from @dhanina: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/8309