nfs4 mounts are not mapping userids, uses nobody/nogroup

Bug #976632 reported by Patola
60
This bug affects 13 people
Affects Status Importance Assigned to Milestone
nfs-utils (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I have:
machine A - NFS4 server, Ubuntu 11.10
machine B - NFS4 client, Ubuntu 11.10
machine C - NFS4 client, Ubuntu 12.04 (development)

All machines have the same userids and group ids.

Machine 4 exports are the following:

/export/dir1 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async)
/export/dir2 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async)
/export/dir3 10.0.0.0/24(rw,nohide,insecure,no_subtree_check,async)

On both Machine B and C, the mounts are defined in fstab as:

10.0.0.1:/dir1 /mnt/mydir nfs4 _netdev,soft,retry=2,auto 0 0
10.0.0.1:/dir2 /mnt/mydir2 nfs4 _netdev,soft,retry=2,auto 0 0
10.0.0.1:/dir3 /mnt/startrek nfs4 _netdev,soft,retry=2,auto 0 0

These NFS shares have been configured for about 6 months, no change to the configuration.

However, on the newly upgraded machine C, when the NFS4 filesystems are mounted, *all files* (with different users on machine A) map to nobody/nogroup. I even tried changing some options on machine A (like adding no_all_squash then re-exporting it) to no avail. I also tried manually mounting the filesystems using the "mount" command on machine C and the same thing happened. Before upgrading, the mounts were working correctly. On machine B with Ubuntu 11.10, they also work correctly.

mount is version 2.20.1-1ubuntu3, nfs-common (which has /sbin/mount.nfs4) is version 1:1.2.5-3ubuntu2.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: mount 2.20.1-1ubuntu3
ProcVersionSignature: Ubuntu 3.2.0-22.35-generic 3.2.14
Uname: Linux 3.2.0-22-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.0-0ubuntu4
Architecture: amd64
Date: Sun Apr 8 11:55:58 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110426)
SourcePackage: util-linux
UpgradeStatus: Upgraded to precise on 2012-04-06 (2 days ago)

Revision history for this message
Patola (patola) wrote :
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Does the issue go away if you boot machine C with the previous kernel version?

Changed in util-linux (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Patola (patola) wrote :

Just tested with kernel 3.0.0-17, the same that machine B is using (although on machine C it's a 64-bit kernel), and the issue remains, the userids are all mapped to anonymous. So it must not be a kernel issue...

Revision history for this message
Patola (patola) wrote :

(Just to make myself clear, yes, I rebooted machine C, with 64-bit kernel 3.0.0-17, for the test)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in util-linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Unai Uribarri (unaiur) wrote :

I've installed an Ubuntu Server 12.04 in both the client and the server and I 've the same problem. All the files are mapped to the nobody user and group.

Revision history for this message
Unai Uribarri (unaiur) wrote :

The kernel in the server and the client is:
Linux ubuntu 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Unai Uribarri (unaiur) wrote :

It seems that Ubuntu 12.04 has replaced NFSv3 with NFSv4 and the Ubuntu server guide isn't updated. Following the instructions at https://wiki.archlinux.org/index.php/NFSv4 I was able to configure it correctly.

Revision history for this message
Patola (patola) wrote :

How can that be the problem? I used nfs4 on Ubuntu 11.10 and user mapping was working.

Revision history for this message
Patola (patola) wrote :

Never mind what I said. Uncommenting the line "Domain = localdomain" on /etc/idmapd.conf solved the problem. It seems that Ubuntu 12.04 comes with different defaults; on my 11.10 client machine, this line is uncommented.

Revision history for this message
Reinhard (reinhard-fink) wrote :

i had the same problem today.

server: 11.04
  Domain = localdomain

client: 11.10
  Domain = localdomain
  => nfs4 ok

client: 12.04
  #Domain = localdomain
  => nfs4 NOT ok, because it uses new standard domain = FQHN - hostname

but:

client: 12.04
  Domain = localdomain
  => nfs4 ok

Conclusio:
we have to look, that server and clients will use the same domain.

Revision history for this message
Terry Jones (terry-taralga) wrote :

I have seen the same problem on a recent upgrade of a client from 10.04 to 12.04.

The server is still running 10.04 at this stage. To get the right ownership showing on the client I had to uncomment the
'Domain = localdomain'
line as suggested.

The interesting bit is that another client which has just had 12.04 installed as a new installation works correctly with teh same server out of the box with the
'Domain = localhost'
line commented out.

Perhaps there is some other configuration file that should be changed on upgrade from 10.04 to 12.04.

Any suggestions ?

Revision history for this message
Adriaan van Nijendaal (adriaan-choam) wrote :

I have a bunch of front-ends all running 12.04 (and all configured alike) and two NFS servers: one 12.04 (with this problem) and one 10.10 (that causes no problem). /etc/idmapd.conf on the 12.04 front-ends has the "Domain = localdomain" commented out.

Revision history for this message
Adriaan van Nijendaal (adriaan-choam) wrote :

Could this be related (or a duplicate) of: https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/966734

Revision history for this message
TJ (tj) wrote :

Experienced the same issue here and found a solution:

Server A: 12.04.1, 3.2.0-34-generic, NFSv4 exports to sub-net
Client B: 12.04.2, 3.6.0-030600rc4-generic
Client C: 12.04.2, 3.6.0-030600-generic

All systems have the same user accounts with identical IDs.

Client B would see the correct file ownership:

$ ls -al /home/all/Library/
total 40
drwxrwxr-x 10 tj users 4096 Jan 22 13:33 .
drwxrwxr-x 9 tj users 4096 Sep 19 14:59 ..
drwxrwxr-x 8 tj users 4096 Mar 8 2012 Backup
drwxrwxr-x 7 tj users 4096 Nov 22 22:40 BLOB
drwxrwxr-x 3 tj users 4096 Jan 22 14:29 Downloads
drwxrwxr-x 10 tj users 4096 Sep 29 20:56 iso-image
drwxrwxr-x 12 tj users 4096 Jul 24 2012 Media
drwxrwxr-x 5 tj users 4096 Jan 26 15:10 Projects
drwxrwxr-x 16 tj users 4096 Jan 30 22:35 SourceCode
drwxrwxr-x 3 tj users 4096 Aug 18 07:49 VirtualMachines

Client C would not:

$ ls -al /home/all/Library/
total 40
drwxrwxr-x 10 nobody users 4096 Jan 22 13:33 .
drwxrwxr-x 9 tj users 4096 Sep 19 14:59 ..
drwxrwxr-x 8 nobody users 4096 Mar 8 2012 Backup
drwxrwxr-x 7 nobody users 4096 Nov 22 22:40 BLOB
drwxrwxr-x 3 nobody users 4096 Jan 22 14:29 Downloads
drwxrwxr-x 10 nobody users 4096 Sep 29 20:56 iso-image
drwxrwxr-x 12 nobody users 4096 Jul 24 2012 Media
drwxrwxr-x 5 nobody users 4096 Jan 26 15:10 Projects
drwxrwxr-x 16 nobody users 4096 Jan 30 22:35 SourceCode
drwxrwxr-x 3 nobody users 4096 Aug 18 07:49 VirtualMachines

Server A has several LVs that are rbind-mounted to the NFS root via /etc/fstab:

/home/all/Library /srv/Library none defaults,rbind,noauto 0 0

and exported:

/srv 10.254.0.0/16(rw,sync,no_subtree_check,crossmnt,fsid=0)
/srv/Library 10.254.0.0/16(rw,sync,no_subtree_check,crossmnt)
/srv/Library/Backup 10.254.0.0/16(rw,sync,no_subtree_check)
/srv/Library/BLOB 10.254.0.0/16(rw,sync,no_subtree_check)
/srv/Library/Media 10.254.0.0/16(rw,sync,no_subtree_check,crossmnt)
/srv/Library/iso-image 10.254.0.0/16(rw,sync,no_subtree_check)
/srv/Library/VirtualMachines 10.254.0.0/16(rw,sync,no_subtree_check)
/srv/Library/SourceCode 10.254.0.0/16(rw,sync,no_subtree_check)
/srv/Library/Projects 10.254.0.0/16(rw,sync,no_subtree_check)

Clients B and C have identical /etc/fstab entries:

10.254.251.1:/Library /home/all/Library nfs4 _netdev,auto,exec 0 0

and /etc/idmapd.conf:

[General]
Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
Domain = lan.eddie.tj
[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup

Server A has the same idmapd.conf with the addition of:

[Translation]
Method = nsswitch

I found the solution here was to add the [Translation] stanza to client C's configuration (and restart the idmapd service).

I don't understand why client B can correctly translate the user IDs without having the [Translation] stanza, though.

Phillip Susi (psusi)
affects: util-linux (Ubuntu) → nfs-utils (Ubuntu)
Revision history for this message
Hamilton Turner (hamiltont-x) wrote :

Just experienced this issue. Used TJ's fix with success, but I had to also restart nfs on the server - multiple restarts of idmapd did nothing. I did not try restarting the client.

FWIW, here's my details. Primary difference is that my server is a CentOS box.

Client:
       Linux 3 3.11.0-23-generic #40~precise1-Ubuntu SMP Wed Jun 4 22:06:36 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
       nfs-common 1:1.2.5-3ubuntu3.1
       nfs4-acl-tools: 0.3.3-1
       nfswatch: 4.99.11-1

Server:
       Linux <snip> 2.6.32-431.5.1.el6.x86_64 #1 SMP Wed Feb 12 00:41:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
       nfs-utils-1.2.3-39.el6.x86_64
       nfs-utils-lib-1.1.5-6.el6.x86_64
       nfs4-acl-tools-0.3.3-6.el6.x86_64

Revision history for this message
Hamilton Turner (hamiltont-x) wrote :

Also, my client/server are sharing UIDs, which seems to imply this is independent of https://bugs.launchpad.net/ubuntu/+source/nfs-utils/+bug/966734

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.