RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1796989 - SSSDConfig.save_domain(domain) does not always remove all entries removed from domain
Summary: SSSDConfig.save_domain(domain) does not always remove all entries removed fro...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: sssd
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.2
Assignee: Pavel Březina
QA Contact: sssd-qe
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks: 1790886
TreeView+ depends on / blocked
 
Reported: 2020-01-31 17:04 UTC by François Cami
Modified: 2020-11-04 02:08 UTC (History)
16 users (show)

Fixed In Version: sssd-2.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1790886
Environment:
Last Closed: 2020-11-04 02:04:37 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github SSSD sssd issues 5107 0 None closed SSSDConfig::save_domain() weird behavior 2020-09-21 09:04:00 UTC
Red Hat Product Errata RHBA-2020:4569 0 None None None 2020-11-04 02:05:06 UTC

Description François Cami 2020-01-31 17:04:07 UTC
+++ This bug was initially created as a clone of Bug #1790886 +++

Description of problem:
If you repeatedly install and uninstall automount using ipa-client-automount, installation stops working.

Version-Release number of selected component (if applicable):
# cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.2 Beta (Ootpa)

# rpm -q ipa-client
ipa-client-4.8.4-2.module+el8.2.0+5265+c70de5c4.x86_64


How reproducible:
Always

Steps to Reproduce:
1. Execute commands:
ipa-client-automount --location default -U; echo $?
ipa-client-automount --uninstall -U; echo $?
ipa-client-automount --location default -U; echo $?
ipa-client-automount --uninstall -U; echo $?
ipa-client-automount --location default -U; echo $?


Actual results:
...
Searching for IPA server...
IPA server: DNS discovery
Location: default
Configured /etc/idmapd.conf
An automount location is already configured
3

Expected results:
Searching for IPA server...
IPA server: DNS discovery
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
0

Additional info:

The bug is not present in 
 - RHEL8.1 (release RHEL-8.1.0-20191015.0, ipa-client-4.8.0-11.module+el8.1.0+4247+9f3fd721.x86_64)
 - Fedora 30 (freeipa-client-4.8.3-1.fc30.x86_64) 

Full output of reproducer script:
[root@master1 vagrant]# ipa-client-automount --location default -U; echo $?
Searching for IPA server...
IPA server: DNS discovery
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
0
[root@master1 vagrant]# ipa-client-automount --uninstall -U; echo $?
Restoring configuration
0
[root@master1 vagrant]# ipa-client-automount --location default -U; echo $?
Searching for IPA server...
IPA server: DNS discovery
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
0
[root@master1 vagrant]# ipa-client-automount --uninstall -U; echo $?
Restoring configuration
0
[root@master1 vagrant]# ipa-client-automount --location default -U; echo $?
Searching for IPA server...
IPA server: DNS discovery
Location: default
Configured /etc/idmapd.conf
An automount location is already configured
3

--- Additional comment from anuja on 2020-01-27 08:18:08 UTC ---

Also downstream bash:ipa-clirent-automount is failing.
Adding regression label.

--- Additional comment from François Cami on 2020-01-28 12:35:45 UTC ---

Taking for investigation.

--- Additional comment from François Cami on 2020-01-30 12:45:33 UTC ---

This is due to ipa-client-automount not removing the following line from sssd.conf:

ipa_automount_location = default

Removing this line and launching "ipa-client-automount --location default -U" works.

--- Additional comment from François Cami on 2020-01-30 17:14:29 UTC ---

The issue (ipa_automount_location configuration entry not removed from sssd.conf) is also present upstream.

The following patch fixes it on my RHEL 8.2 Beta test system:

diff --git a/ipaclient/install/ipa_client_automount.py b/ipaclient/install/ipa_client_automount.py
index 3ef257a43..fdf974d0d 100644
--- a/ipaclient/install/ipa_client_automount.py
+++ b/ipaclient/install/ipa_client_automount.py
@@ -355,9 +355,10 @@ def uninstall(fstore, statestore):
                         continue
                     if provider == "ipa":
                         domain.remove_option('ipa_automount_location')
+                        sssdconfig.save_domain(domain)
                         domain.remove_provider('autofs')
+                        sssdconfig.save_domain(domain)
                         break
-                sssdconfig.save_domain(domain)
                 sssdconfig.write(paths.SSSD_CONF)
                 sssd = services.service('sssd', api)
                 sssd.restart()

Switching to ASSIGNED. This requires adapting ipatests properly.

Comment 1 François Cami 2020-01-31 17:05:20 UTC
This is reproductible without using IPA.
The upstream issue at https://pagure.io/SSSD/sssd/issue/4149#comment-623734 contains a reproducer: a sample configuration file and the associated code snippet.

Comment 2 Pavel Březina 2020-02-14 11:41:32 UTC
* `master`
    * 2014d8f52ea6a9d086b25f8f0c5b8e6b1e1c161d - Update __init__.py.in

Comment 9 Niranjan Mallapadi Raghavender 2020-07-07 19:07:58 UTC
Versions: sssd-2.3.0-4.el8.x86_64

ipa-client-automount --location default -U --server master.testrealm.test
IPA server: master.testrealm.test
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
Exit code: 0

ipa-client-automount --uninstall -U --server master.testrealm.test
Restoring configuration
Exit code: 0

ipa-client-automount --location default -U --server master.testrealm.test
IPA server: master.testrealm.test
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
Exit code: 0

ipa-client-automount --uninstall -U --server master.testrealm.test
Restoring configuration
Exit code: 0

ipa-client-automount --location default -U --server master.testrealm.test
IPA server: master.testrealm.test
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
Exit code: 0

ipa-client-automount --uninstall -U --server master.testrealm.test
Restoring configuration
Exit code: 0

ipa-client-automount --location default -U --server master.testrealm.test
RUN ipa-client-automount --location default -U --server master.testrealm.test
IPA server: master.testrealm.test
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
Exit code: 0

ipa-client-automount --uninstall -U --server master.testrealm.test
Restoring configuration
Exit code: 0

ipa-client-automount --location default -U --server master.testrealm.test
IPA server: master.testrealm.test
Location: default
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs
Exit code: 0

ipa-client-automount --uninstall -U --server master.testrealm.test
Restoring configuration
Exit code: 0

Comment 12 errata-xmlrpc 2020-11-04 02:04:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (sssd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4569


Note You need to log in before you can comment on or make changes to this bug.