Invalid option in RPCNFSDCOUNT causes nfsconvert.py error

Bug #1992358 reported by jferguson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

I got install conversion errors until I read your very kind note on upgrading to jammy and discovered that this config file was the problem:

john@Nvidia:/etc/default$ cat nfs-kernel-server

# Number of servers to start up
RPCNFSDCOUNT="-V 2 8"

# Runtime priority of server (see nice(1))
RPCNFSDPRIORITY=0

# Options for rpc.mountd.
# If you have a port-based firewall, you might want to set up
# a fixed port here using the --port option. For more information,
# see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS
# To disable NFSv4 on the server, specify '--no-nfs-version 4' here
RPCMOUNTDOPTS="-V 2 --manage-gids"

# Do you want to start the svcgssd daemon? It is only required for Kerberos
# exports. Valid alternatives are "yes" and "no"; the default is "no".
NEED_SVCGSSD=""

# Options for rpc.svcgssd.
RPCSVCGSSDOPTS=""

tags: added: foundations-triage-discuss
Revision history for this message
Brian Murray (brian-murray) wrote :

Are you referring to the release notes at https://discourse.ubuntu.com/t/jammy-jellyfish-release-notes/24668 ?

Changed in nfs-utils (Ubuntu):
status: New → Incomplete
tags: removed: foundations-triage-discuss
Revision history for this message
Brian Murray (brian-murray) wrote (last edit ):

Ah, I get it now you read the release notes and the conversion script failed and your reported a bug per the instructions in the release notes. The Foundations team will leave this task for the server team to look at given they wrote the release note entry about wanting bug reports.

Changed in nfs-utils (Ubuntu):
status: Incomplete → New
importance: Undecided → Medium
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This is the error:

# /usr/share/nfs-common/nfsconvert.py
Error running nfs-conf tool:
 /usr/sbin/nfsconf: invalid option -- 'V'
Usage: /usr/sbin/nfsconf [-v] [--file filename.conf] ...
Options:
 -v Increase Verbosity
 --file filename.conf Load this config file
     (Default config file: /etc/nfs.conf
 --modified "info" Use "info" in file modified header
Modes:
  --dump [outputfile]
      Outputs the configuration to the named file
  --get [--arg subsection] {section} {tag}
      Output one specific config value
  --entry [--arg subsection] {section} {tag}
      Output the uninterpreted config entry
  --isset [--arg subsection] {section} {tag}
      Return code indicates if config value is present
  --set [--arg subsection] {section} {tag} {value}
      Set and Write a config value
  --unset [--arg subsection] {section} {tag}
      Remove an existing config value

Args: ['/usr/sbin/nfsconf', '--file', '/etc/nfs.conf.d/local.conf', '--set', 'nfsd', 'threads', '-V 2 8']

Conversion failed. Please correct the error and try again.

The RPCNFSDCOUNT is meant to be only a number. "-V 2" is an invalid option there. This worked in previous ubuntu releases because even though the parameter is called RPCNFSDCOUNT (i.e., a count, expecting a number), it was just passed straight to the rpc.nfsd command line.

I'll see if there is an update to this conversion script to handle that, but in the meantime, please remove the "-V 2" from RPCNFSDCOUNT and adjust your preferences in /etc/nfs.conf and /etc/nfs.conf.d/local.conf after the conversion script is run.

Changed in nfs-utils (Ubuntu):
status: New → Confirmed
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Looking at the old /usr/lib/systemd/scripts/nfs-utils_env.sh[1] script, it looks like another variable was reserved for NFSD command-line arguments (RPCNFSDOPTS):

(...) (line 12)
echo RPCNFSDARGS=\"$RPCNFSDOPTS ${RPCNFSDCOUNT:-8}\"
                    ^^^^^^^^^^^

And RPCNFSDOPTS is handled by the conversion script[2], and the "-V" option is valid for it:
# options for nfsd found in RPCNFSDOPTS
OPTS_NFSD = 'dH:p:rR:N:V:stTuUG:L:'

So to amend my previous comment, you should remove "-V 2" from RPCNFSDCOUNT in /etc/default/nfs-kernel-server and move it to a new entry:

RPCNFSDOPTS="-V 2"

And then upgrade nfs-kernel-server/nfs-common again and the conversion script should finish the job. This will correctly translate the "-V 2 8" you had before to:

[nfsd]
vers2 = y
threads = 8

1. https://git.launchpad.net/ubuntu/+source/nfs-utils/tree/debian/nfs-utils_env.sh?h=applied/ubuntu/focal-devel#n12
2. https://git.launchpad.net/ubuntu/+source/nfs-utils/tree/debian/nfsconvert.py?h=applied/ubuntu/jammy-devel#n15

Changed in nfs-utils (Ubuntu):
importance: Medium → Low
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

The correct fix would be for /etc/default/nfs-kernel-server to have RPCNFSDOPTS exposed in it, as an empty string, and a comment saying what it is for. Changing that in a stable release is suboptimal, because it can very easily lead to a dpkg conf prompt during the upgrade and we tend to avoid triggering those whenever possible. We would then also have to update the md5sums[1] we check for in jammy and later...

1. https://git.launchpad.net/ubuntu/+source/nfs-utils/tree/debian/nfs-common.postinst?h=ubuntu/jammy-devel#n29

summary: - existing 20.04 nfs-kernel-sever default which did not convert
+ Invalid option in RPCNFSDCOUNT causes nfsconvert.py error
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.