# NFS4 + portage-2.1 == weird warnings [SOLVED]

## yoosty69

I have 2 laptops connected to a wired server. One of the many things I have my server doing is exporting the portage directory for the laptops through NFS4. 

In portage 2.0.x everything worked fine on my network. 

In portage 2.1 everything WORKS, but my /var/log/messages gets spammed with HUNDREDS of warnings everytime I emerge something:

```
Jul 11 11:04:53 laptop nfs4: couldn't resolve gid 250 to string
```

It also spits out a few:

```
Jul 11 11:26:03 laptop nfs: couldn't resolve uid 0 to string
```

  towards the end of an emerge.

Another symptom is that the distfiles permissions get changed to root:nobody during an emerge from the laptop.

I've spent about 5 hours trying to find something related to why this might not work, and I haven't really come up with much. I've tried the userfetch, userprive, and usersandbox options for portage; running idmapd on the laptop (not required before); changing the export options to anonuid=0 anongid=250; updated to the latest nfs-utils and libnfsidmap (1.0.8 and 0.16 respectively); and changing the anonymous IDs in idmapd.conf to portage (pretty much just grasping for anything at this point).

Not really sure where to go from here...

Here are the relevant export options:

```
/mnt/nfs 192.168.0.5(rw,sync,fsid=0,no_root_squash)

/mnt/nfs/portage 192.168.0.5(rw,sync,no_root_squash)

```

Relevant rpc.idmapd -vvv output from the server during "/etc/init.d/nfsmount start;emerge --oneshot zip" on the laptop:

```

Jul 11 11:24:13 server rpc.idmapd[23514]: libnfsidmap: using domain: localdomain

Jul 11 11:24:13 server rpc.idmapd[23514]: libnfsidmap: using translation method: nsswitch

Jul 11 11:24:13 server rpc.idmapd[23515]: Expiration time is 600 seconds.

Jul 11 11:24:13 server rpc.idmapd[23515]: Opened /proc/net/rpc/nfs4.nametoid/channel

Jul 11 11:24:13 server rpc.idmapd[23515]: Opened /proc/net/rpc/nfs4.idtoname/channel

Jul 11 11:24:13 server rpc.statd[23518]: Version 1.0.8 Starting

Jul 11 11:24:19 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=user

Jul 11 11:24:19 server rpc.idmapd[23515]:  Server: (user) id "1002" -> name "samba@localdomain"

Jul 11 11:24:19 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=group

Jul 11 11:24:19 server rpc.idmapd[23515]:  Server: (group) id "100" -> name "users@localdomain"

Jul 11 11:24:19 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=user

Jul 11 11:24:19 server rpc.idmapd[23515]:  Server: (user) id "0" -> name "root@localdomain"

Jul 11 11:24:19 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=group

Jul 11 11:24:19 server rpc.idmapd[23515]:  Server: (group) id "0" -> name "root@localdomain"

Jul 11 11:25:46 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=group

Jul 11 11:25:46 server rpc.idmapd[23515]:  Server: (group) id "65534" -> name "nobody@localdomain"

Jul 11 11:25:49 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=group

Jul 11 11:25:49 server rpc.idmapd[23515]:  Server: (group) name "nobody" -> id "65534"

Jul 11 11:25:51 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=user

Jul 11 11:25:51 server rpc.idmapd[23515]: nss_getpwnam: name 'nobody' domain 'localdomain': resulting localname '(null)'

Jul 11 11:25:51 server rpc.idmapd[23515]: nss_getpwnam: name 'nobody' does not map into domain 'localdomain'

Jul 11 11:25:51 server rpc.idmapd[23515]:  Server: (user) name "nobody" -> id "65534"

Jul 11 11:25:51 server rpc.idmapd[23515]: nfsdcb: authbuf=192.168.0.5 authtype=user

Jul 11 11:25:51 server rpc.idmapd[23515]:  Server: (user) id "65534" -> name "nobody@localdomain"

```

The server is running 2.6.16-gentoo-r6 and the laptop is running 2.6.16-suspend2-r8

One weird thing to note is that it resolves other gids (users, samba) during nfsmount, but not the portage gid during an emerge...

And although the permissions and warning spams aren't that big of a deal (like I said, everything still works), I would rather have everything work without warnings/errors.Last edited by yoosty69 on Tue Nov 21, 2006 7:09 pm; edited 1 time in total

----------

## chris.c.hogan

 *Quote:*   

> Jul 11 11:24:13 server rpc.idmapd[23514]: libnfsidmap: using domain: localdomain 

 

Just wondering, did you edit /etc/idmapd.conf and add your domain name? Does it match on both the client, server, and in /etc/conf.d/domainname?

----------

## yoosty69

yup, that all matches

----------

## yoosty69

still does it on both laptops even after an 'emerge -e world'

----------

## yoosty69

ehm... anybody?

----------

## BrightSide

I experienced this problem today as I upgraded from NFSv3 to NFSv4 but they were not related directly to portage, as copying a file to the share resulted in the same type of lookup failure in system log. After some experimenting I realised that rpc.idmapd was running on the server but none of the new rpc services were started up on the client computer as I only used the nfsmount init script on the client and it didnt load the rpc services needed for NFSv4. The nfs init script does start up these services but also started up the nfs server-related services which I didnt use so running it gave a failure starting the nfsd. So I ended up modifying the nfs script which did the trick for me  :Smile: 

Heres my modified init script:

```

#!/sbin/runscript

# /etc/init.d/nfs4mount

#---------------------------------------------------------------------------

# This script starts/stops the following

#   rpc.statd if necessary (also checked by init.d/nfs and init.d/nfsmount)

#   rpc.gssd

#   rpc.svcgssd

#   rpc.idmapd

#--------------------------------------------------------------------------- 

# The binary locations

    gssd=/usr/sbin/rpc.gssd

  idmapd=/usr/sbin/rpc.idmapd

   statd=/sbin/rpc.statd

 svcgssd=/usr/sbin/rpc.svcgssd

depend() {

   use ypbind net

   need portmap

   after nfsmount

}

mkdir_nfsdirs() {

   local d

   for d in /var/lib/nfs/{rpc_pipefs,v4recovery,v4root} ; do

      [[ ! -d ${d} ]] && mkdir -p "${d}"

   done

}

mount_pipefs() {

   mkdir_nfsdirs

   if grep -q rpc_pipefs /proc/filesystems ; then

      if ! grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then

         ebegin "Mounting RPC pipefs"

         mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs

         eend $?

      fi

   fi

}

umount_pipefs() {

   if grep -q "rpc_pipefs /var/lib/nfs/rpc_pipefs" /proc/mounts ; then

      ebegin "Unmounting RPC pipefs"

      umount /var/lib/nfs/rpc_pipefs

      eend $?

   fi

}

start_gssd() {

   [[ ! -x ${gssd} || ! -x ${svcgssd} ]] && return 0

   local ret1 ret2

   ebegin "Starting gssd"

   ${gssd} ${RPCGSSDDOPTS}

   ret1=$?

   eend ${ret1}

   ebegin "Starting svcgssd"

   ${svcgssd} ${RPCSVCGSSDDOPTS}

   ret2=$?

   eend ${ret2}

   return $((${ret1} + ${ret2}))

}

stop_gssd() {

   [[ ! -x ${gssd} || ! -x ${svcgssd} ]] && return 0

   local ret

   ebegin "Stopping gssd"

   start-stop-daemon --stop --quiet --exec ${gssd}

   ret1=$?

   eend ${ret1}

   ebegin "Stopping svcgssd"

   start-stop-daemon --stop --quiet --exec ${svcgssd}

   ret2=$?

   eend ${ret2}

   return $((${ret1} + ${ret2}))

}

start_idmapd() {

   mount_pipefs

   [[ ! -x ${idmapd} ]] && return 0

   ebegin "Starting idmapd"

   ${idmapd} ${RPCIDMAPDOPTS}

   eend $?

}

stop_idmapd() {

   [[ ! -x ${idmapd} ]] && return 0

   local ret

   ebegin "Stopping idmapd"

   start-stop-daemon --stop --quiet --exec ${idmapd}

   ret=$?

   eend ${ret}

   umount_pipefs

   return ${ret}

}

start_statd() {

   # Don't start rpc.statd if already started by init.d/nfsd or init.d/nfsmount

   killall -0 rpc.statd &>/dev/null && return 0

   ebegin "Starting NFS statd"

   start-stop-daemon --start --quiet --exec \

      $statd -- $RPCSTATDOPTS 1>&2

   eend $? "Error starting NFS statd"

}

stop_statd() {

   # Don't stop rpc.statd if it's in use by init.d/nfsd or init.d/nfsmount

   mount -t nfs | grep -q . || mount -t nfs4 | grep -q . && return 0

   # Make sure it's actually running

   killall -0 rpc.statd &>/dev/null || return 0

   # Okay, all tests passed, stop rpc.statd

   ebegin "Stopping NFS statd"

   start-stop-daemon --stop --quiet --exec $statd 1>&2

   eend $? "Error stopping NFS statd"

}

start() {

   start_idmapd

   start_gssd

   start_statd

   ebegin "Mounting NFS4 filesystems"

   mount -a -t nfs4

   eend $? "Error mounting NFS4 filesystems"

}

stop() {

   ebegin "Unmounting NFS4 filesystems"

   umount -a -t nfs4

   eend $? "Error unmounting NFS4 filesystems"

   stop_statd

   stop_gssd

   stop_idmapd

   return 0

}

```

----------

## yoosty69

hoooooly sweetness it works! (after emerging nfs-utils-1.0.10)

Thank you!!

----------

