Replication not working with unprivileged user

Status
Not open for further replies.

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
I recently started having this strange problem that I can't figure out. I'm using a program called znapzend for zfs send/recv and in the past has worked very well for me. Recently I started having this strange problem that I believe somehow has something to do with 'zfs allow' permissions.

The reason this problem is very strange is I am using the identical set up on 3 different computers, and in the past I have used this setup on the same computer I'm having the problem with, except this time it has caused an issue.

I want to run my send receive as a user 'replicator' with limited permissions. I am sending my datasets to datasets underneath 'tank/replication/' where I have set 'zfs allow' to:

Code:
zfs allow tank/replication
---- Permissions on tank/replication ---------------------------------
Local+Descendent permissions:
	user replicator compression,create,destroy,diff,mount,mountpoint,readonly,receive,release,send,userprop
	user  create,destroy,diff,mount,readonly,receive,release,send,userprop



I am sending from my laptop to data sets with this setting where I am able to use the user replicator with no problems

Code:
zfs allow tank/replication/Tesla
---- Permissions on tank/replication ---------------------------------
Local+Descendent permissions:
	user replicator compression,create,destroy,diff,mount,mountpoint,readonly,receive,release,send,userprop
	user  create,destroy,diff,mount,readonly,receive,release,send,userprop 


I have the same setup sending to this dataset, however only able to do it as a root.

Code:
zfs allow tank/replication/Atreides
---- Permissions on tank/replication ---------------------------------
Local+Descendent permissions:
	user replicator compression,create,destroy,diff,mount,mountpoint,readonly,receive,release,send,userprop
	user  create,destroy,diff,mount,readonly,receive,release,send,userprop


When I try doing it as the user replicator I end up with:

Code:
cannot unmount  Operation not permitted warning: cannot send zfs 


I did try running it as root and then switching to the replicator user but that gave me a stream of errors looking like this:


Code:

Nov  2 00:56:32 lilan collectd[3529]: statvfs(/mnt/tank/replication/Atreides/vault/home/john/dotfiles/config) failed: No such file or directory



I have set the dataset to be owned by the user replicator and the group replicator the same on both datasets. The properties on both computers are effectively identical. Does anyone have some idea what might be happening and what I could do to fix this problem? I'd rather not be sending as the root user
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Now this wont go away, even as root:

Code:
Nov  2 02:00:17 lilan collectd[3529]: statvfs(/mnt/tank/replication/Atreides/vault/home/john/local) failed: No such file


I have tried deleting the dataset on freenas and starting over it even happens when I replicate to another dataset!

It ONLY occurs on these datasets:

Code:
NAME							  USED  AVAIL  REFER  MOUNTPOINT
vault/home/john/dotfiles/config  2.13G   290G   209M  /home/john/.config
vault/home/john/dotfiles/local   4.40M   290G   476K  /home/john/.local
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Replicator doesn't have permission to unmount, which is what the first error is telling you.

The statvfs error means that the dataset isn't mounted, and therefore the stats can't be pulled for the collection script.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Replicator doesn't have permission to unmount, which is what the first error is telling you.

The statvfs error means that the dataset isn't mounted, and therefore the stats can't be pulled for the collection script.
So, to fix the first I give it unmount permissions, what about statvfs? Why is it staying unmounted always? No other datasets are...
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I don't know, but I've seen this error from others posted recently. And they were using FreeNAS replication. Maybe it's related.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Well, I seem to a fixed amount Problem by adding Sysctl vfs.usermount=1. As for the other problem, I am still lost as to what I need to do to get rid of the air.

What I really don't understand is why this is only happening to me on one computer, and it was working before, and is still working now on all my other computers.
 

STREBLO

Patron
Joined
Oct 23, 2015
Messages
245
Replicator doesn't have permission to unmount, which is what the first error is telling you.

The statvfs error means that the dataset isn't mounted, and therefore the stats can't be pulled for the collection script.
Also, I don't think this is the problem because the data set IS mounted. In fact, I've actually found that if I unmount it the errors go away. I think it has something to do with FreeNAS not liking the replication happening while the dataset is mounted
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
I think it has something to do with FreeNAS not liking the replication happening while the dataset is mounted
This is quite possible. I believe that freenas unmounts the replication target sometime (or the whole time) during replication.
 
Status
Not open for further replies.
Top