在FreeBSD 12.0-STABLE r345345上,当我通过NFS导出SVN存储库时,我的症状与this question相同:
svn: E155016: The working copy database at '/usr/src' is corrupt.
SVN存储库显示正常:
$ svnlite info /usr/src-12.0
Path: /usr/src-12.0
Working Copy Root Path: /usr/src-12.0
URL: svn://svn.example.com/base/stable/12
Relative URL: ^/stable/12
Repository Root: svn://svn.example.com/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 341836
Node Kind: directory
Schedule: normal
Last Changed Author: zeising
Last Changed Rev: 341831
Last Changed Date: 2018-12-11 13:01:38 -0800 (Tue, 11 Dec 2018)
我正在以相当典型的方式导出它,但是如果我错了,请纠正我:
$ cat /etc/exports
/usr/src-12.0 -ro -maproot=root -network 127.0.0.0/8
/usr/obj-12.0 -ro -maproot=root -network 127.0.0.0/8
$ showmount -e
Exports list on localhost:
/usr/src-12.0 127.0.0.0
/usr/obj-12.0 127.0.0.0
我最初在两个不同的主机之间发现了此问题,但是发现本地主机的导出和安装足以重现此问题。
如果我挂载了该NFS共享并检查了回购的NFS挂载副本,则svnlite
报告它已损坏:
# mount localhost:/usr/src-12.0 /mnt
# svnlite info /mnt
svn: E155016: The working copy database at '/mnt' is corrupt.
通过rsync
复制存储库或通过将存储库安装到客户端的nullfs复制都可以。
我已经通过使用mtree(8)
进行sha256验证来验证树中的所有文件和目录:
# mtree -K sha256 -cp /usr/src-12.0 > mtree.out
# mount localhost:/usr/src-12.0 /mnt
# mtree -p /mnt < mtree.out
.: flags ("uarch" is not "none")
# echo $?
2
mtree发现的唯一区别是/ mnt目录没有设置uarch
标志:
# ls -lod /mnt /usr/src-12.0
drwxr-xr-x 25 root wheel - 40 Apr 12 14:53 /mnt/
drwxr-xr-x 25 root wheel uarch 40 Apr 12 14:53 /usr/src-12.0/
因此,看来NFS导出本身正在使用SVN造成某种破坏。如何找到并解决问题?
编辑:添加后:
rpc_lockd_enable="YES"
rpc_statd_enable="YES"
到服务器的/etc/rc.conf
并重新启动服务器,sockstat显示:
# sockstat | grep rpc
root rpc.lockd 1051 3 dgram -> /var/run/logpriv
root rpc.statd 1043 4 udp6 *:611 *:*
root rpc.statd 1043 5 tcp6 *:611 *:*
root rpc.statd 1043 6 udp4 *:611 *:*
root rpc.statd 1043 7 tcp4 *:611 *:*
root rpc.statd 1043 9 dgram -> /var/run/logpriv
root rpcbind 1019 5 stream /var/run/rpcbind.sock
root rpcbind 1019 6 udp6 *:111 *:*
root rpcbind 1019 7 udp6 *:901 *:*
root rpcbind 1019 8 tcp6 *:111 *:*
root rpcbind 1019 9 udp4 *:111 *:*
root rpcbind 1019 10 udp4 *:681 *:*
root rpcbind 1019 11 tcp4 *:111 *:*
root rpcbind 1019 13 udp6 *:* *:*
但是客户仍然抱怨:
# umount /mnt
# mount localhost:/usr/src-12.0 /mnt
# svnlite info /mnt
svn: E155016: The working copy database at '/mnt' is corrupt.