truenas / charts

TrueNAS SCALE Apps Catalogs & Charts
BSD 3-Clause "New" or "Revised" License
300 stars 288 forks source link

If I create a new dataset nested in webdav share dataset the container doesn't be aware #2508

Open sync-by-unito[bot] opened 4 months ago

sync-by-unito[bot] commented 4 months ago

Hi,

I found a wrong behaviour in webdav container related to dataset use.

Suppose I create a webdav app related to a dedicated dataset (for example “webdav-share”). I set the state of the container in Running.

I’m able to use webdav withotu any kind of problem. After a while I decide to create a new dataset under the first one (for example “webdav-share/nested”).

The container see the directory that will be created but it doesn’t access the nested dataset.

So if I try to upload a file in “webdav-share” dir all works fine.

If change directory in my webdav client and I go in “webdav-share/nested” when I upload a file I receive “500 internale server error” and I cannot do it.

No way to write in that directory.

Only if I restart the container the container became aware of the second dataset and only after that I can write/upload in.

┆Attachments: immagine-20240524-151346.png

stavros-k commented 4 months ago

Hello, what user/group ID do you run webdav as? Does this user/group have access to the nested dataset? Do you have the "Fix permissions" enabled?

sync-by-unito[bot] commented 4 months ago

➤ Rosario Pagano commented:

Is a local user which with uid 3322 and gid 3322.

The dataset ha rwx for that uid, --- for that gid and --- for others

obviously the nested dataset has the same identical permissions

“Fix permissions” is unset (but looking at the guide it should set permissions only during deploynig phase)

using other protocols the same user can write without any kind of problem.

sync-by-unito[bot] commented 4 months ago

➤ Rosario Pagano commented:

I forgot to say the obviously user and group of webdav container are 3322 3322

sync-by-unito[bot] commented 4 months ago

➤ Rosario Pagano commented:

A second point (I don’t know if you prefer to create a new ticket) is that after container is aware of the subdataset I cannot delete it (in this case “nested”).

I had to stop webdav, delete dataset “nested” and after that start again the webdav.

Seems like webdav doesn’t permit to manage/make any change in dataset structure. I cannot add, modify or remove any sub-dataset related to share dataset.

sync-by-unito[bot] commented 4 months ago

➤ Stavros Kois commented:

I expect that you have the same issue on all apps. Considering it is a new filesystem, containers are not picking it up. There might be “knobs” in kubernetes to turn to make that happen, but this will need to be investigated first for side effects.

I’ll let you know once I have more details.

sync-by-unito[bot] commented 4 months ago

➤ Rosario Pagano commented:

Hi,

I can confirm that only webdav is impacted by this behaviour.

I executed a new test turning on a smb share on the same webdav-share dataset and activeting ssh service (to be able to connect using sftp) for the user 3322 (home dir obviously is always the same).

In this way I had 3 services for the same user (3322:3322) that use the same dataset (with approprieted permissions).

After that I created a new dataset under webdav-share (webdav-share\test-services) and I tried to upload some files.

For sftp I used FileZilla and I was able to upload a file.

For smb I connected a new drive on my windows laptop and I was able to copy a file

For webdav instead I received error

!immagine-20240524-151346.png|width=559,height=346,alt="immagine-20240524-151346.png"!

I suppose you can replicate the behaviour in you lab.

This may depends on the fact that smb and ssh/sftp are system services but webdav is an app on kubernetes. Probably other k8s apps my result in the same behaviour.

sync-by-unito[bot] commented 3 months ago

➤ Rosario Pagano commented:

Hi,

any news on this task?

I would like to inform you that this problem impact also snapshot.

If a take a normal snapshot of the dataset provided to weddav and try to access it the app isn’t able to go in.

I must stop and start the app. After that I can navigate .zfs dir

Another problem more relevant is that there is no way to delete the snapshot. Even if I stop the app I always receive “dataset is busy”.

The only way to do it is to go in a shell and umount manually the snapshot. After that I’m able to delete snapshot.

This is a big problem because I cannot use API to umount a snap and I cannot access by shell every time I want to delete a snapshot.

Regards

Rosario