且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将git存储库移动到nfs会导致权限错误

更新时间:2023-02-25 20:49:09

整个事情很奇怪。最后,我使用了虚拟vdi磁盘,该磁盘存储在Windows服务器上的一个文件夹中,该文件夹由ubuntu通过SMB共享和安装(至 / srv / shareSMB )。然后,vdi再次被Ubuntu安装到原来的 / srv / share 。这是有效的。



我认为这个问题导致unix和Windows世界在文件结构,尤其是链接方面存在差异。 Gitolite似乎与链接工作很多,这可能是所有邪恶的根源,这样所有的gitolite回购都被打破了,我需要重新安装它。


Im running a redmine server with the redmine-git-hosting plugin to control git repos. The repository dir points to a separate hard drive mounted at /srv/share. Now the setup is changing and I'm trying to move the repos to a nfs share on another server.

The mount works fine, I simply replaced the entry in the fstab file from /etc/sdb1 to ip:/share. Now I had some permission problems beforehand since the drive is accessed by redmine (user www-data) and gitolite (user git) at the same time, so I ran a chmod -R 777 on the whole drive to deal with this.

I set the Windows NFS server to the same umask (It's 000 there, for some reason it's inverted) and in fact both users can read and write to the drive. But now when trying to create a new repository with redmine, error 500 pops up. The unhelpful log entry says Rugged::NetworkError (unpacking the sent packfile failed on the remote):

Now there are git repos already configured on the server and when I try to commit something to one of them the following error pops up

Total 3 (delta 0), reused 0 (delta 0)
POST git-receive-pack (397 bytes)
remote: fatal: error when closing sha1 file: Permission denied

Any ideas what to do here?

nfs client, redmine and git server: ubuntu server 14.04.4 LTS
nfs server: haneWin nfs server on Windows Server 2012R2

So this entire thing is pretty weird. In the end I went with a virtual vdi disk which is stored on a folder on the Windows server which is shared and mounted by ubuntu through SMB (to /srv/shareSMB). The vdi is then again mounted by ubuntu to the original /srv/share. This works.

I think the problem(s) resulted in the differences between the unix and the Windows world when it comes to file structures, especially links. Gitolite seems to work with links quite a lot, that might have been the root of all evil, that way all the gitolite repos were broken and I needed to reinstall it.