Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1732529

Summary: repeated uninstallation of ipa-client-samba crashes
Product: Red Hat Enterprise Linux 8 Reporter: Sergey Orlov <sorlov>
Component: ipaAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: abokovoy, contribs, extras-qa, fcami, frenaud, ipa-maint, jcholast, jhrozek, ksiddiqu, pvoborni, rcritten, ssorce, tscherf, twoerner
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.8.0-5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1732524 Environment:
Last Closed: 2019-11-05 20:53:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1732524, 1732528    
Bug Blocks:    

Description Sergey Orlov 2019-07-23 15:19:02 UTC
+++ This bug was initially created as a clone of Bug #1732524 +++

Description of problem:
When "ipa-client-samba --uninstall" is uninstalled twice, it crashes

Version-Release number of selected component (if applicable):
freeipa-client-samba-4.8.0-1.fc30.x86_64

How reproducible:
Always

Steps to Reproduce:
1. ipa-client-samba -U 
2. ipa-client-samba -U --uninstall
3. ipa-client-samba -U --uninstall

Actual results:
Traceback (most recent call last):
  File "/usr/sbin/ipa-client-samba", line 15, in <module>
    sys.exit(ipa_client_samba.run())
  File "/usr/lib/python3.7/site-packages/ipaclient/install/ipa_client_samba.py", line 524, in run
    uninstall(fstore, statestore, options)
  File "/usr/lib/python3.7/site-packages/ipaclient/install/ipa_client_samba.py", line 437, in uninstall
    fstore.restore_file(paths.SMB_CONF)
  File "/usr/lib/python3.7/site-packages/ipalib/install/sysrestore.py", line 201, in restore_file
    raise ValueError("No such file name in the index")
ValueError: No such file name in the index


Expected results:
Samba domain member is not configured yet

Additional info:

Comment 1 Sergey Orlov 2019-07-23 15:21:21 UTC
+++ This bug was initially created as a clone of Bug #1732528 +++

Description of problem:
After samba installation and uninstallation ipa-client-samba refuses to reinstall samba.

Version-Release number of selected component (if applicable):
freeipa-client-samba-4.8.0-1.fc30.x86_64

How reproducible:
Always

Steps to Reproduce:
1. ipa-client-samba -U
2. ipa-client-samba -U --uninstall
3. ipa-client-samba -U

Actual results:
Samba domain member is already configured

Expected results:
Samba is configured

Additional info:

Comment 2 Alexander Bokovoy 2019-07-23 15:23:10 UTC
These two issues are in the same place -- processing of the datastore at uninstall, so it makes sense to handle them as a single bug.

Comment 5 Sergey Orlov 2019-09-02 12:49:31 UTC
Verified for RHEL8.1 nightly compose using automatic test ipatests/test_integration/test_smb.py from https://github.com/freeipa/freeipa/pull/3576.

cat /etc/redhat-release 
Red Hat Enterprise Linux release 8.1 Beta (Ootpa)

rpm -q ipa-client-samba
ipa-client-samba-4.8.0-5.module+el8.1.0+3809+d28f8357.x86_64

ipa-run-tests-3 ipatests/test_integration/test_smb.py -v
...
============================================================================================================ test session starts ============================================================================================================
platform linux -- Python 3.6.8, pytest-3.4.2, py-1.5.4, pluggy-0.6.0 -- /usr/bin/python3
cachedir: ipatests/.pytest_cache
rootdir: /home/sorlov/work/FREEIPA-3351-verify-samba/freeipa/ipatests, inifile:
plugins: profiling-1.6.0, sourceorder-0.5, multihost-3.0
collected 11 items                                                                                                                                                                                                                          

ipatests/test_integration/test_smb.py::TestSMB::test_samba_uninstallation_without_installation PASSED                                                                                                                                 [  9%]
ipatests/test_integration/test_smb.py::TestSMB::test_install_samba PASSED                                                                                                                                                             [ 18%]
ipatests/test_integration/test_smb.py::TestSMB::test_samba_service_listed PASSED                                                                                                                                                      [ 27%]
ipatests/test_integration/test_smb.py::TestSMB::test_smb_access_for_ipa_user_at_ipa_client PASSED                                                                                                                                     [ 36%]
ipatests/test_integration/test_smb.py::TestSMB::test_smb_access_for_ad_user_at_ipa_client PASSED                                                                                                                                      [ 45%]
ipatests/test_integration/test_smb.py::TestSMB::test_smb_mount_and_access_by_different_users PASSED                                                                                                                                   [ 54%]
ipatests/test_integration/test_smb.py::TestSMB::test_smb_mount_fails_without_kerberos_ticket PASSED                                                                                                                                   [ 63%]
ipatests/test_integration/test_smb.py::TestSMB::test_uninstall_samba PASSED                                                                                                                                                           [ 72%]
ipatests/test_integration/test_smb.py::TestSMB::test_repeated_uninstall_samba PASSED                                                                                                                                                  [ 81%]
ipatests/test_integration/test_smb.py::TestSMB::test_samba_reinstall PASSED                                                                                                                                                           [ 90%]
ipatests/test_integration/test_smb.py::TestSMB::test_cleanup PASSED                                                                                                                                                                   [100%]

======================================================================================================== 11 passed in 708.24 seconds ========================================================================================================

Comment 8 errata-xmlrpc 2019-11-05 20:53:27 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, 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-2019:3348