3

I'm using a QNAP NAS as storage server for my Ubuntu home directory. Everything seems to work fine, so far I did not encounter any problems with file permissions. The output line of mount is:

192.168.0.200:/homes/myuser on /home/myuser type nfs (rw,relatime,vers=3,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=192.168.0.200,mountvers=3,mountport=30000,mountproto=udp,local_lock=none,addr=192.168.0.200)

However, when I try to clone a git repository into my home directory, I get the following output and error messages:

myuser@ubuntu ~/test % git clone -v https://github.com/robbyrussell/oh-my-zsh.git
Cloning into 'oh-my-zsh'...
POST git-upload-pack (140 bytes)
remote: Counting objects: 17463, done.
fatal: Unable to create temporary file '/home/myuser/test/oh-my-zsh/.git/objects/pack/tmp_pack_XXXXXX': Permission denied
fatal: index-pack failed

After running the command, the directory test doesn't even contain a subdirectory named oh-my-zsh. It is still empty.

getfacl of the directory /home/myuser/test/ shows the following output:

 myuser@ubuntu ~/test % getfacl .
# file: .
# owner: myuser
# group: mygroup
 user::rwx
 user:nobody:---
 user: myuser:rwx
 group::rwx
 mask::rwx
 other::---
 default:user::rwx
 default:user:nobody:---
 default:user: myuser:rwx
 default:group::rwx
 default:mask::rwx
 default:other::---

So actually there should be no permission problems, as myuser has all permissions on the directory. So is there something permission-related that I am missing? Or is this a NFS-related problem and how can I solve this?

MiH
  • 91
  • 7

2 Answers2

1

Same problem. I guess there's 2 ways.

  1. Turn off Advanced ACL in QNAP-NAS. Go to Control Panel > Privilege > Shared Folders > Advanced Permissions > Uncheck [] Enable Advanced Folder Permissions

or

  1. Add noacl option in /etc/fstab like follows. Options may differ depending on your preferences.

    192.168.0.200:/homes/myuser /home/myuser nfs defaults,_netdev,noacl 1 2

I did the latter and it worked.

Edit: If you want to keep using advanced ACL, make sure that NFSv4 is active on your NAS. NFSv4 supports ACL, but NFSv3 probably not.

Edit: I don't recommend the first way. I tried it, and it resulted in a nightmare. All permissions were overwritten, folders 777, files 666. So you should leave the NAS option as it is now, and change client's NFS config only.

aximov
  • 11
  • 2
0

I was having a similar problem with git on an nfs mount from a QNAP. I had a different error message though:

Cloning into 'tileserver-gl'...
remote: Counting objects: 2179, done.
remote: Compressing objects: 100% (813/813), done.
remote: Total 2179 (delta 1357), reused 2179 (delta 1357)
Receiving objects: 100% (2179/2179), 3.04 MiB | 22.72 MiB/s, done.
fatal: premature end of pack file, 83 bytes missing
warning: die() called many times. Recursion error or racy threaded death!
fatal: premature end of pack file, 81 bytes missing
fatal: index-pack failed

The fix was different of aximov's answer. The solution was adding the sync option to the mount options in /etc/fstab.

With that added the git clone works as expected.

SimonAlfie
  • 101
  • 1