kubernetes-csi / csi-driver-smb

This driver allows Kubernetes to access SMB Server on both Linux and Windows nodes.
Apache License 2.0
488 stars 132 forks source link

unable to mount share #523

Closed oksanabaranova closed 2 years ago

oksanabaranova commented 2 years ago

Hello!

I am having an error when trying to mount windows share using csi driver. Something is wrong with my mount options/mount folder name (the name contain a space character: [company.com/share_folder/[Decision\040Science/science]). How can I identify the space character in order to mount it properly?

Pod Description:

  Normal   Scheduled    12m                 default-scheduler  Successfully assigned mts/deployment-smb-5749bf75dc-xbphg to node4
  Warning  FailedMount  82s (x5 over 10m)   kubelet            Unable to attach or mount volumes: unmounted volumes=[smb], unattached volumes=[smb kube-api-access-4qk8q]: timed out waiting for the condition
  Warning  FailedMount  11s (x14 over 12m)  kubelet            MountVolume.MountDevice failed for volume "pv-smb" : rpc error: code = Internal desc = volume(cifs-volume) mount "//my-company.com/share_folder" on "/var/lib/kubelet/plugins/kubernetes.io/csi/pv/pv-smb/globalmount" failed with mount failed: fork/exec /bin/mount: invalid argument
Mounting command: mount
Mounting arguments: -t cifs -o dir_mode=0770,file_mode=0770,uid=1002,gid=1002,vers=2.0,noperm,nounix,iocharset=utf8,<masked> my-company.com/share_folder /var/lib/kubelet/plugins/kubernetes.io/csi/pv/pv-smb/globalmount

logs of the smb-controller:

I0802 14:55:22.758781       1 controllerserver.go:255] internally mounting //my-company.com/share_folder>
I0802 14:55:22.762421       1 nodeserver.go:201] NodeStageVolume: targetPath(/tmp/pvc-d5e4393e-cedf-4e13-b470>
<JupyterHub /tmp/pvc-d5e4393e-cedf-4e13-b470-e0cb7b435ffd)
E0802 14:55:22.764868       1 mount_linux.go:195] Mount failed: fork/exec /bin/mount: invalid argument
Mounting command: mount
Mounting arguments: -t cifs -o dir_mode=0770,file_mode=0770,vers=2.0,<masked> //my-company.com/share_folder>
Output:
E0802 14:55:22.765028       1 utils.go:81] GRPC error: rpc error: code = Internal desc = failed to mount smb >
Mounting command: mount
oksanabaranova commented 2 years ago

a right way to escape a space character is to use "\ " symbol to mount folder with space character in name. The issue can be closed.