Bug 1676981

Summary: ipa-client-automount exception backing up /etc/sysconfig/nfs
Product: Red Hat Enterprise Linux 8 Reporter: Scott Poore <spoore>
Component: ipaAssignee: François Cami <fcami>
Status: CLOSED CURRENTRELEASE QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0CC: abokovoy, dpal, fcami, fdc, frenaud, jwboyer, ksiddiqu, mmcgrath, pvoborni, rcritten, spoore, tscherf
Target Milestone: rcKeywords: Regression
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.7.1-11.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-14 01:45:53 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:

Description Scott Poore 2019-02-13 17:38:33 UTC
Description of problem:

When running ipa-client-automount, I see failures.  In debug mode I see this:

Backing up system configuration file '/etc/sysconfig/nfs'
-> Not backing up - '/etc/sysconfig/nfs' doesn't exist
Raised exception [Errno 2] No such file or directory: '/etc/sysconfig/nfs'
Loading StateFile from '/var/lib/ipa-client/sysrestore/sysrestore.state'
Loading StateFile from '/var/lib/ipa-client/sysrestore/sysrestore.state'
IPA server: host-8-252-16.testrelm.test
Location: nis
Installation failed. Rolling back changes.
IPA automount is not configured on this system

If I touch /etc/sysconfig/nfs beforehand, it works.

Version-Release number of selected component (if applicable):
ipa-client-4.7.1-7.module+el8+2554+7a4ca32b.x86_64
nfs-utils-2.3.3-13.el8.x86_64

How reproducible:
Always. At least in some test environments.

Steps to Reproduce:
1.  Setup IPA server and some automount map entries
2.  ipa-client-automount --debug --server=$SERVER --location=$LOCATION -U

Actual results:
Fails

Expected results:
Works and sets up client properly.

Additional info:

Comment 1 Scott Poore 2019-02-13 20:01:16 UTC
FYI, I think this is related to the fix in bug #1673685

Comment 2 François Cami 2019-02-18 13:54:31 UTC
We should backup /etc/nfs.conf instead if I remember correctly.

Comment 3 François Cami 2019-02-18 14:13:08 UTC
Cloned upstream: https://pagure.io/freeipa/issue/7868

Comment 7 Florence Blanc-Renaud 2019-02-21 14:57:20 UTC
Upstream ticket:
https://pagure.io/freeipa/issue/7868

Comment 8 François Cami 2019-02-26 16:37:18 UTC
nfs-utils-2.3.3-5.rc2.fc30 ( https://koji.fedoraproject.org/koji/buildinfo?buildID=1208012 ) introduced that change for Fedora:

* Mon Feb 11 2019 Steve Dickson <steved> 2.3.3-5.rc2
 - Do not install /etc/sysconfig/nfs (bz 1668836)
 - Change nfsconvert.sh not to set the immutable bit (bz 1668836)
 - Change nfsconvert.py not to create the new dummy /etc/sysconfig/nfs (bz 1668836)

Comment 13 François Cami 2019-02-26 17:14:45 UTC
WIP PR: https://github.com/freeipa/freeipa/pull/2862

Comment 16 François Cami 2019-02-27 20:46:05 UTC
Fixed upstream
master:
https://pagure.io/freeipa/c/c69875c8afdd877baf7139c0cd5241f70105cbd4

Comment 18 François Cami 2019-02-27 22:34:20 UTC
Fixed upstream
ipa-4-7:
https://pagure.io/freeipa/c/2ee160d189042a356c1ba9bb91214f2a495cc10d

Comment 19 Scott Poore 2019-02-28 00:28:02 UTC
Verified

Version::

ipa-client-4.7.1-11.module+el8+2843+a16c4825.x86_64

Results::

# ipa-client-install --principal admin --password Secret123 -U
This program will set up IPA client.
Version 4.7.1

Discovery was successful!
Client hostname: rhel8-2.example.com
Realm: EXAMPLE.COM
DNS Domain: example.com
IPA Server: rhel8-1.example.com
BaseDN: dc=example,dc=com

Synchronizing time
No SRV records of NTP servers found and no NTP server or pool address was provided.
Using default chrony configuration.
Attempting to sync time with chronyc.
Time synchronization was successful.
Successfully retrieved CA cert
    Subject:     CN=Certificate Authority,O=EXAMPLE.COM
    Issuer:      CN=Certificate Authority,O=EXAMPLE.COM
    Valid From:  2019-02-27 23:34:18
    Valid Until: 2039-02-27 23:34:18

Enrolled in IPA realm EXAMPLE.COM
Created /etc/ipa/default.conf
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
Configured /etc/krb5.conf for IPA realm EXAMPLE.COM
Systemwide CA database updated.
Hostname (rhel8-2.example.com) does not have A/AAAA record.
Missing reverse record(s) for address(es): 192.168.122.82.
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
WARNING: The configuration pre-client installation is not managed by authselect and cannot be backed up. Uninstallation may not be able to revert to the original state.
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring example.com as NIS domain.
Client configuration complete.
The ipa-client-install command was successful


# ipa automountlocation-find
----------------------------
1 automount location matched
----------------------------
  Location: default
----------------------------
Number of entries returned 1
----------------------------

# ipa-client-automount --location=default --server=rhel8-1.example.com
IPA server: rhel8-1.example.com
Location: default
Continue to configure the system with these values? [no]: yes
Configured /etc/idmapd.conf
Restarting sssd, waiting for it to become available.
Started autofs


# file /etc/sysconfig/nfs
/etc/sysconfig/nfs: cannot open `/etc/sysconfig/nfs' (No such file or directory)