Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initializing posix permissions handler: OSError: [Errno 95] Operation not supported #294

Closed
Shadow2091 opened this issue Mar 12, 2023 · 9 comments

Comments

@Shadow2091
Copy link

Hello.
I am trying to create the first share. Installed controller v0.2 via make deploy. Pod has been created but won't start.

Init container log:

_2023-03-12 10:58:58,457: INFO: Ensuring share path: /mnt/3ec9e0ab-30e7-4eda-935c-f5aee9774188
2023-03-12 10:58:58,457: INFO: Updating permissions if needed: /mnt/3ec9e0ab-30e7-4eda-935c-f5aee9774188
2023-03-12 10:58:58,457: INFO: Using initializing posix permissions handler
Traceback (most recent call last):
File "/usr/bin/samba-container", line 8, in
sys.exit(main())
File "/usr/lib/python3.10/site-packages/sambacc/commands/main.py", line 217, in main
cfunc(CommandContext(cli))
File "/usr/lib/python3.10/site-packages/sambacc/commands/initialize.py", line 91, in ensure_share_paths
perms_handler(share.permissions_config(), path).update()
File "/usr/lib/python3.10/site-packages/sambacc/permissions.py", line 143, in update
if self.status_ok():
File "/usr/lib/python3.10/site-packages/sambacc/permissions.py", line 136, in status_ok
sval = self._get_status()
File "/usr/lib/python3.10/site-packages/sambacc/permissions.py", line 152, in _get_status
value = xattr.get(path, self._xattr, nofollow=True)
File "/usr/lib/python3.10/site-packages/sambacc/xattr.py", line 58, in get
return xattr.get(item, name, **kwargs)
OSError: [Errno 95] Operation not supported

SmbShare:

apiVersion: samba-operator.samba.org/v1alpha1
kind: SmbShare
spec:
browseable: true
readOnly: true
storage:
pvc:
name: downloads-pvc

PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: downloads-pvc
status:
phase: Bound
accessModes:
- ReadWriteMany
capacity:
storage: 999Gi
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 999Gi
volumeName: downloads
storageClassName: static-nfs
volumeMode: Filesystem

@synarete
Copy link
Collaborator

@Shadow2091 What is the K8S cluster you are using? (minikube? openshift? other?)

@Shadow2091
Copy link
Author

Shadow2091 commented Mar 12, 2023

@synarete Vanilla K8S v1.25.4

@synarete
Copy link
Collaborator

@Shadow2091 Are you using nfs for your underlying pvc? If so, does your nfs export supports File System Extended Attributes ?

@Shadow2091
Copy link
Author

Shadow2091 commented Mar 12, 2023

@synarete Yes, I am using NFS. PV connected with options
mountOptions:
- hard
- nfsvers=4.1
The NFS source is Centos8Stream with options:
/storage/torrents/ k8s-worker01.home(rw,sync,no_subtree_check,no_root_squash)
And on K8S worker node:
/var/lib/kubelet/pods/c5b44445-731b-4ac0-bdc8-a9b5cd360b58/volumes/kubernetes.io~nfs/downloads from nfs.home:/storage/torrents/downloads
Flags: rw,relatime,vers=4.1,rsize=262144,wsize=262144,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.31,local_lock=none,addr=192.168.1.37

@synarete
Copy link
Collaborator

@Shadow2091 Extended attributes over nfs (RFC 8276) is a relatively new comer to linux nfs server, and I suspect that it is not supported in your CentOS8 machine. Please make sure that is supported, both by the underlying file system and via nfs export.

In order to validate extended-attributives support, try to do the following operations in both cases:

$ touch ./a
$ setfattr -n user.test -v 123456 ./a
$ getfattr -d ./a

@Shadow2091
Copy link
Author

@synarete After switching PV to NFS 4.2 everything worked. Thanks for the help!

@phlogistonjohn
Copy link
Collaborator

I'm glad you were able to get this to work. I do want to note that there are general issues when re-exporting NFS over SMB. I highly recommend looking over the Samba users's list and searching for NFS. There are other gotchas and performance issues that you might encounter. If these don't end up impacting you and everything works for your needs, great! I just want to make sure you are aware of the known issues.

@Shadow2091
Copy link
Author

Thanks for the warnings. Yes, I understand the performance issues, but I use multiple VMs on my home server for personal use. In fact, all VMs are served by one AMD Epyc CPU and a pair of NVMe PM983. To compact resources, I decided to transfer some applications from VM to k8s, for which I needed your excellent application.
P.S. Is it possible to create a share with anonymous access?

@phlogistonjohn
Copy link
Collaborator

Thanks for the warnings. Yes, I understand the performance issues, but I use multiple VMs on my home server for personal use. In fact, all VMs are served by one AMD Epyc CPU and a pair of NVMe PM983. To compact resources, I decided to transfer some applications from VM to k8s, for which I needed your excellent application.

OK, thank you!

P.S. Is it possible to create a share with anonymous access?

Not today IIRC. Please feel free to create a new issue to request and track this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants