testing_master_previous Nightly PR 223 logs:
[ipatests.pytest_ipa.integration.host.Host.master.IPAOpenSSHTransport] RUN ['kinit', 'nonadmin'] [ipatests.pytest_ipa.integration.host.Host.master.cmd64] RUN ['kinit', 'nonadmin'] [ipatests.pytest_ipa.integration.host.Host.master.cmd64] Password for nonadmin@IPA.TEST: [ipatests.pytest_ipa.integration.host.Host.master.cmd64] Password expired. You must change it now. [ipatests.pytest_ipa.integration.host.Host.master.cmd64] Enter new password: [ipatests.pytest_ipa.integration.host.Host.master.cmd64] Enter it again: [ipatests.pytest_ipa.integration.host.Host.master.cmd64] kinit: Password has expired while getting initial credentials [ipatests.pytest_ipa.integration.host.Host.master.cmd64] Exit code: 1 ipa: ERROR: stderr: kinit: Password has expired while getting initial credentials
This is identical to: https://pagure.io/freeipa/issue/8271
See debug steps in the original ticket. We need to add KRB5_TRACE and wait for a repeat failure.
Metadata Update from @fcami: - Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/4773
PR for debugging linked. Please do not close the issue on merge.
master:
Metadata Update from @abbra: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
ipa-4-8:
Metadata Update from @rcritten: - Issue status updated to: Open (was: Closed)
Passing in https://github.com/freeipa-pr-ci2/freeipa/pull/238
Metadata Update from @pcech: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
@pcech apologies if it was not clear here, but as noted in https://pagure.io/freeipa/issue/8271 the issue is sporadic. Reopening.
Metadata Update from @fcami: - Issue status updated to: Open (was: Closed)
@rharwood we have a failure with debug: logs
bug
Also happened in PR 265, with logs
Also happened in test_adtrust_install in PR #688
Also happened in [testing_master_previous] Nightly PR #798 , report
Failure observed also in [testing_ipa-4.9_latest_selinux] Nightly PR #841 , report
Failure observed in [testing_ipa-4.9_latest_selinux] Nightly PR #856, report
Failures observed in [testing_master_pki] Nightly PR #1035 , report
Also affecting test_ipa_user_s4u2self_pac in the same test suite. [testing_ipa-4.9_latest] Nightly PR #1075 , report
test_ipa_user_s4u2self_pac
Another failure in PR #1111, report
TL;DR kpasswd_server should be set in kerberos conf.
kpasswd_server
Note: I skip here any log files for readability.
I have the issue with ipatests/test_integration/test_adtrust_install.py::TestIpaAdTrustInstall::test_add_agent_not_allowed with identical symptom.
ipatests/test_integration/test_adtrust_install.py::TestIpaAdTrustInstall::test_add_agent_not_allowed
The reproducer script:
#!/bin/bash -eu kdestroy -A export KRB5_TRACE=/dev/stdout export SSSD_KRB5_LOCATOR_DEBUG=1 echo Secret123 | kinit admin ipa user-del nonadmin ||: systemctl restart dirsrv@IPA-TEST.service echo -e Secret123\\nSecret123 | ipa user-add nonadmin \ --first nonadmin --last nonadmin --password echo -e Secret123\\nSecret123\\nSecret123 | kinit nonadmin
What is going on: 1 . The previous test step test_samba_config_file executes ipa-adtrust-install, which in turn, triggers the restart of systemd's instance of dirsrv.
test_samba_config_file
ipa-adtrust-install
2 . ns-slapd for dropping privileges calls getpwnam with dirsrv user
getpwnam
dirsrv
3 . nsswitch.conf points passwd db to sss service
passwd
sss
4 . sss tries to resolve user dirsrv there is a difference between Fedora 34 and ALTLinux. SSSD for Fedora 34 is configured with --enable-files-domain at compile time, which stands for
--enable-files-domain
If this feature is enabled, then SSSD always enables a domain with id_provider=files even if the domain is not specified in the config file
while ALTLinux is configured with the default one (off).
off
Fedora 34 : dirsrv@implicit_files is resolved by sss and SSSD doesn't even touch the IPA provider, SSSD assumes IPA online at this point (actually, offline).
dirsrv@implicit_files
IPA
ALTLinux: sss tries to resolve dirsrv in IPA provider (which is off during 389-ds restart) and marks this provider as offline (retry time 85sec if IIRC).
This can be checked with getent passwd -s sss dirsrv.
getent passwd -s sss dirsrv
Important note: as of Fedora 35 SSSD is configured with the default one: https://fedoraproject.org/wiki/Changes/FlexibleLocalUserCache
So, the issue will be seen and for the recent Fedora too.
5 . since the provider IPA offline the SSSD's locator plugin for libkrb5 (https://linux.die.net/man/8/sssd_krb5_locator_plugin) can do nothing about this:
[sssd_krb5_locator] sssd_krb5_locator_init called [sssd_krb5_locator] open failed [/var/lib/sss/pubconf/kdcinfo.IPA.TEST][2][No such file or directory]. [sssd_krb5_locator] get_krb5info failed. [sssd_krb5_locator] sssd_krb5_locator_close called
and fallbacks to the standard libkrb5 algorithm (man 5 krb5.conf).
man 5 krb5.conf
6 . krb5.conf on IPA server doesn't include kpasswd_server and kinit fallbacks to DNS way. DNS (URI or SRV) RRs don't preserve any order and kinit may contact either master or replica kpasswd servers.
master
replica
7 . two possible outcomes due to replication delay: - password was changed on replica but was not replicated to master(kinit->master(initial)->replica(kpassw)->master(initial)) - new user wasn't replecated to replica before password change requested on replica (kinit->master(initial)->replica(kpasswd))
Note: master_kdc(primary_kdc) doesn't help here because it is only used if the initial credentials obtaining fail (see krb5_get_init_creds_password in libkrb5) and not password change.
master_kdc
primary_kdc
krb5_get_init_creds_password
I propose to supply FreeIPA's configuration for libkrb5 with kpasswd_server.
Ok, Fedora 35 will not be affected by --disable-files-domain and passwd: sss files => passwd: files sss exactly for described above scenario, but this doesn't change the fact that the IPA provider can be offline at any moment (and this happens during the tests).
--disable-files-domain
passwd: sss files
passwd: files sss
reproducer for F34(sporadic failure, server+at least 1 replica required):
#!/bin/bash -eu kdestroy -A export KRB5_TRACE=/dev/stdout export SSSD_KRB5_LOCATOR_DEBUG=1 echo Secret123 | kinit admin ipa user-del nonadmin ||: systemctl stop sssd echo -e Secret123\\nSecret123 | ipa user-add nonadmin --first nonadmin --last nonadmin --password echo -e Secret123\\nSecret123\\nSecret123 | kinit nonadmin
ipa-4-9:
Metadata Update from @frenaud: - Issue close_status updated to: fixed - Issue status updated to: Closed (was: Open)
Metadata Update from @frenaud: - Issue assigned to slev