Bug 1287468

Summary: Unable to start nfs server.service if any of the client is down and dns unable to resolve the client name
Product: Red Hat Enterprise Linux 7 Reporter: Rinku <rkothiya>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.2CC: akrherz, aneogi, dshaw, dwysocha, eguan, jkachuck, smeyer, steved
Target Milestone: rcKeywords: EasyFix, Patch, TestCaseProvided
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.24.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-04 05:02:01 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:    
Bug Blocks: 1203710, 1295577, 1313485    

Comment 4 Steve Dickson 2016-01-16 17:32:36 UTC
The two needed upstream commits:

commit 076dd803330d93819c6e7862f515a8fa3997a83b
Author: Henrique Martins <linux>
Date:   Tue Nov 4 15:12:16 2014 -0500

    exportfs: changes handling of unresolvable entries

commit 612581573ba104404b86242ca35c2ff35abd5e72
Author: Rinku Kothiya <rkothiya>
Date:   Sat Jan 16 12:19:40 2016 -0500

    Set right error after getaddrinfo fails

Comment 5 Yongcheng Yang 2016-02-15 03:01:14 UTC
Reproduced in latest RHEL-7.2 with nfs-utils-1.3.0-0.21.el7.
Will generate automatic case later.

[root@hp-dl380pg8-01 ~]# cat /etc/exports
/export_test   *(rw,sync,no_root_squash)
/mnt    non-exist.com(rw,sync,no_root_squash)
[root@hp-dl380pg8-01 ~]# service nfs restart
Redirecting to /bin/systemctl restart  nfs.service
Job for nfs-server.service failed because the control process exited with error code. See "systemctl status nfs-server.service" and "journalctl -xe" for details.
[root@hp-dl380pg8-01 ~]# echo $?
1
[root@hp-dl380pg8-01 ~]# service nfs status -l
Redirecting to /bin/systemctl status  -l nfs.service
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2016-02-15 10:58:22 CST; 40s ago
  Process: 15403 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)
  Process: 15400 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 15398 ExecStop=/usr/sbin/rpc.nfsd 0 (code=exited, status=0/SUCCESS)
  Process: 15223 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0/SUCCESS)
  Process: 15443 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
 Main PID: 15223 (code=exited, status=0/SUCCESS)

Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com systemd[1]: Starting NFS server and services...
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com exportfs[15443]: exportfs: Failed to resolve non-exist.com
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com exportfs[15443]: exportfs: Failed to resolve non-exist.com
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com systemd[1]: nfs-server.service: control process exited, code=exited status=1
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com systemd[1]: Failed to start NFS server and services.
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com systemd[1]: Unit nfs-server.service entered failed state.
Feb 15 10:58:22 hp-dl380pg8-01.rhts.eng.pek2.redhat.com systemd[1]: nfs-server.service failed.
[root@hp-dl380pg8-01 ~]# exportfs -v
/export_test  	<world>(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
[root@hp-dl380pg8-01 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.21.el7.x86_64
[root@hp-dl380pg8-01 ~]#

Comment 7 Steve Dickson 2016-04-26 18:39:51 UTC
*** Bug 1314200 has been marked as a duplicate of this bug. ***

Comment 10 Yongcheng Yang 2016-05-17 07:15:38 UTC
Move to VERIFIED according to comment 9.

Will continue to run the automatic case in the future.

Comment 11 Yongcheng Yang 2016-05-30 09:52:40 UTC
(In reply to Steve Dickson from comment #4)
> The two needed upstream commits:
> 
> commit 076dd803330d93819c6e7862f515a8fa3997a83b
> Author: Henrique Martins <linux>
> Date:   Tue Nov 4 15:12:16 2014 -0500
> 
>     exportfs: changes handling of unresolvable entries
> 

Please NOTE this patch has introduced a regression.

Already filed Bug 1340788 to trace it and will keep this one as VERIFIED.

Just list the  description of this regression following:

Previously if there is nothing to export and execute "exportfs -a/-r", the Return Code is 0. But now it will emit an ERROR and return 1.

Previously with nfs-utils-1.3.0-0.21.el7
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[root@hp-dl385pg8-08 ~]# ls /etc/exports.d/
[root@hp-dl385pg8-08 ~]# cat /etc/exports
[root@hp-dl385pg8-08 ~]# exportfs -a
[root@hp-dl385pg8-08 ~]# echo $?
0
[root@hp-dl385pg8-08 ~]# exportfs -r
[root@hp-dl385pg8-08 ~]# echo $?
0
[root@hp-dl385pg8-08 ~]# exportfs -v
[root@hp-dl385pg8-08 ~]# 
[root@hp-dl385pg8-08 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.21.el7.x86_64
[root@hp-dl385pg8-08 ~]# 

But now, with this version nfs-utils-1.3.0-0.24.el7
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[root@hp-dl385pg8-08 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.24.el7.x86_64
[root@hp-dl385pg8-08 ~]# exportfs -a
exportfs: No file systems exported!  <<<<<<<<<<<<<<
[root@hp-dl385pg8-08 ~]# echo $?
1      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[root@hp-dl385pg8-08 ~]# exportfs -r
exportfs: No file systems exported!  <<<<<<<<<<<<<<
[root@hp-dl385pg8-08 ~]# echo $?
1      <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[root@hp-dl385pg8-08 ~]# exportfs -v
[root@hp-dl385pg8-08 ~]# 

And what's even worse, it return this ERROR even if
using extra export.d files to export:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[root@hp-dl385pg8-08 ~]# echo "/tmp *(rw,no_root_squash)" > /etc/exports.d/test.exports
[root@hp-dl385pg8-08 ~]# exportfs -a
exportfs: No file systems exported!
[root@hp-dl385pg8-08 ~]# echo $?
1
[root@hp-dl385pg8-08 ~]# exportfs -v
/tmp          	<world>(rw,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash)
[root@hp-dl385pg8-08 ~]#

Comment 13 errata-xmlrpc 2016-11-04 05:02:01 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://rhn.redhat.com/errata/RHBA-2016-2383.html

Comment 14 Yongcheng Yang 2016-11-15 06:31:01 UTC
*** Bug 1395062 has been marked as a duplicate of this bug. ***