nfs-server.service fails with error "exportfs: duplicated export entries"

This document (000021106) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 
NFS Server

Situation

  • /etc/exports contains duplicate entries, meaning that one path is being exported twice to the same client.  In the example below, the hostname "nfs-client" resolves to IP 192.168.56.101, making these duplicate entries:
# cat /etc/exports
/testnfs        nfs-client(rw,root_squash,sync,no_subtree_check)
/testnfs        192.168.56.101(rw,root_squash,sync,no_subtree_check)
  • exportfs command on it's own is successful; however it reports a warning:
# exportfs -rav
exportfs: duplicated export entries:
exportfs:       192.168.56.101:/testnfs
exportfs:       nfs-client:/testnfs
exporting nfs-client.example.com:/testnfs
  • An error is shown during start (or restart) of nfs-server.service, after which nothing is exported:
$ systemctl restart nfs-server
Job for nfs-server.service canceled.
  • Status of nfs-server.service is shown as:
$ systemd -l status nfs-server.service
● nfs-server.service - NFS server and services
     Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor preset: disabled)
    Drop-In: /usr/lib/systemd/system/nfs-server.service.d
             └─nfsserver.conf, options.conf
             /run/systemd/generator/nfs-server.service.d
             └─order-with-mounts.conf
     Active: failed (Result: exit-code) since Thu 2023-06-15 07:03:52 UTC; 10s ago
    Process: 25105 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
    Process: 25106 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
    Process: 25107 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)

    Jun 15 07:03:52 nfs-server systemd[1]: Starting NFS server and services...
Jun 15 07:03:52 nfs-server exportfs[25105]: exportfs: duplicated export entries:
Jun 15 07:03:52 nfs-server exportfs[25105]: exportfs:         192.168.56.101:/testnfs
Jun 15 07:03:52 nfs-server exportfs[25105]: exportfs:         nfs-client:/testnfs
Jun 15 07:03:52 nfs-server systemd[1]: nfs-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 15 07:03:52 nfs-server systemd[1]: nfs-server.service: Failed with result 'exit-code'.
Jun 15 07:03:52 nfs-server systemd[1]: Stopped NFS server and services.

 

Resolution

The duplication can be manually removed from /etc/exports, and then the service can be manually restarted with:
systemctl restart nfs-server

The nfs-kernel-server package is also being updated to prevent nfs-server from treating this duplication as a fatal condition.  The following versions will avoid the failure:
Distribution
Minimum version of nfs-kernel-server with the fix
SLES 15 SP5
  2.1.1-150500.22.3.1
SLES 15 SP4
  2.1.1-150100.10.37.1
SLES 15 SP3 LTSS
  2.1.1-150100.10.37.1
SLES 15 SP2 LTSS
  2.1.1-150100.10.37.1
SLES 15 SP1 LTSS
  2.1.1-150100.10.37.1
 

Cause

As the error message suggests, exportfs has identified a duplicate entry in /etc/exports file.  The error message is new within the nfs packages that come with SLES 15 (see Additional Information section).  It is the error message that causes nfs-server.service to fail.  Before the message was added, duplicate entries themselves did not cause a failure.

Additional Information

Whether using IP address or hostname, no entries should be duplicated in the exports configuration file.

This duplicate warning message appears to be new in the exportfs binary which comes in nfs-utils package version 2.x.  SLES 12 used nfs-utils 1.3.0.  (nfs-utils is the source package from which nfs-kernel-server and nfs-client packages are built.)

"nfs-server.service" has an alias called "nfsserver.service" which is very often used.  The alias will (in turn) run nfs-server.service.  However, the alias will not report (on screen or in a "status" query) the error or failure.  You must check "nfs-server.service" directly so see those. 

For more information about exports and the correct syntax, please refer to the man page for "exports":
man exports

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021106
  • Creation Date: 05-Oct-2023
  • Modified Date:05-Oct-2023
    • SUSE Linux Enterprise Server
    • SUSE Linux Enterprise Server for SAP Applications
    • NFS Protocol

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center