-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FreeIPA fails silently to add DNS record A #79
Comments
I did some digging in FreeIPA install code and it appears the as observed when the client installation failing to update the DNS is not fatal: It is only logged as an error in I was also able to reproduce the problem by creating a new clusters with 25 compute nodes. The higher number of nodes trying register their record at the same time appears to create some contingency on bind and some records are dropped. This means FreeIPA alone cannot be trusted and we will have to implement some mechanism to validate the records were created with Puppet. A complementary solution would be to populate |
It does not only happen for record A but for SSHFP records too. Closest issue I could find so far: |
On my last test, the time when nsupdate failed for three nodes (2 record A and 1 SSHFP) out of 25 was the same time a keytab was generated for Mokey. I will launch a new cluster with 25 nodes again but using MC 9.0 puppet environment to see if Mokey keytab generation could be the issue with 9.1. |
Rolling-back to 9.0 did not solve the problem, so Mokey is fortunately not the culprit. After decyphering a bit more the error message in ipaclient-install.log, I am now suspecting an entropy issue, because of these sort of log that precedes nsupdate not being able to update the DNS:
and the following analysis of what is happening in nsupdate client: A potential solution currently tested would be to make sure there is enough entropy to avoid having two nodes generating the same key by making sure the service |
Requiring
|
I suspect the issue has occured in previous version of MC, but until 8.3, sssd dynamic dns update was activated which would fix the missing A record automatically. |
The culprit is the key generate by the client in |
Latest approach is to wrap ipa-client-install in a small helper script The exit code will instruct puppet the client was not install, and puppet will try again after some sleep time. |
Bug summaryipa-client-install sometimes fails to create record in the DNS, sometime the A records are not registered, sometimes it is the SSHFP, sometime none of the records are registered, yet the installation return an exit code 0 meaning a successful installation. Culprit researchipa-client-installFreeIPA These functions cannot generate exception and return nothing. Failing of nsupdate for any reason is being logged but it is not fatal to the execution of ipa-client-install. This is why Puppet ignores the installation was partly unsuccessful and never tries to enroll the node again. nsupdate
nsupdate 9.11 uses the following code to generate the key:
where lib/isc/random.c:isc_random_get():
and initialize() -> initialize_rand():
Because every compute node is provisionned the same way at almost the same time, seeding the random-number generator with time and pid combination has a non-null probability of collision. Collisions have been observed on multiple occasions. To verify the existence of collision, we looked at
Furthermore, collisions generate a BADNAME answer from the DNS server when trying to update the records, which can also be found in SolutionsFix ipa-client-install to make sure dns recording failure is fatalSince we can check the log for error after running ipa-client-install, we can wrap the installer in a script that verifies the presence of BADNAME TKEY error in The wrapper script would look like this: #!/bin/bash
# keep previous installation logs
mv /var/log/ipaclient-install.log{,.$(ls /var/log/ipaclient-install.log* | wc -l)}
if /sbin/ipa-client-install "${@}"; then
if grep -q "BADNAME" /var/log/ipaclient-install.log; then
/sbin/ipa-client-install --uninstall -U
exit 1
else
exit 0
fi
else
exit $?
fi Upgrade nsupdateAccording to BIND9 changelog, since BIND 9.13.1, usage of Since the protocol to update the DNS records has not changed between BIND 9.11 and most recent version, it would be possible to update the BIND9 utils (dig, nsupdate, and nslookup) for a version >= 9.13.1. |
Implementation of ipa-client-install solution for issue #79
In MC 8.5 and 9.1 at least, it has been reported that ipa-client-install sometimes fail silently to add the record A.
The DNS update error can be found in /var/log/ipaclient-install.log and look like this:
The content of
/etc/ipa/.dns_update.txt
during the update would something like this:The text was updated successfully, but these errors were encountered: