Unable to access local TrueNAS datasets from NextCloud

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
NextCloud error: OCA\DAV\Connector\Sabre\Exception\Forbidden: No read permissions
NextCloud was installed as a plugin from the TrueNAS UI.

I was following this guide:
Interestingly, the dataset's content is visible, but not accessible.
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
Does anyone have any idea? My NextCloud setup is pretty much useless without the ability to mount my TrueNAS datasets. The NextCloud instance is running in jails.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
I am unsure if i understand what your question is. What do you mean with "datasets"? If you install Nextcloud as a plugin, it creates the dataset itself and sets up the database. I just looked at the guide and it is very old. You do normally not need to set up mount points after installing the plugin from the GUI. I have done several NC plugin installs and never did that. If you want to add external storage on a fixed dataset, as described in the tutorial, please make sure that user and group are both www. Can you check that?
 
Last edited:

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
Are you trying to mount the datasets via SMB? Don't do that. Go to the jail settings and create proper mountpoints. Then add the directories to Nextcloud as external storage.
 

ddaenen1

Patron
Joined
Nov 25, 2019
Messages
318
Are you trying to mount the datasets via SMB? Don't do that. Go to the jail settings and create proper mountpoints. Then add the directories to Nextcloud as external storage.

I think that is what he is trying to do @Patrick M. Hausen. I just think he hasn't assigned the right owner credentials to the dataset. NC will not allow him to add it if the user:group is not www:www, right?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
His path with the backslashes ("\") looks like SMB to me, that's why I asked. Only the OP will be able to tell us :wink:
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
Hi All and thanks for your responses! So this is what happens:

I've been using TrueNAS for more than a year. All my data is stored on a few local ZFS datasets (family media, movies, documents, etc.). It's been working nicely so far except the inconvenience of having to sync the data from various devices manually. So, at some point I decided to make the next big step and ditch my public cloud accounts altogether and migrate to the NextCloud solution. The NextCloud plugin setup was a breeze, but the issue I am facing now is inability to mount my existing datasets with my existing data to my NextCloud instance. I don't wanna recreate it from scratch inside the dedicated NextCloud dataset (as well as copy all the data manually).

So what I was trying to do is the follows (pretty much what @Patrick M. Hausen described):

1. Create a mountpoint in NextCloud's jail settings pointing to one of my datasets (let's call it Movies). It will point to a new folder inside jails' NextCloud path: /...my-pool.../iocage/jails/nextcloudjail/root/usr/local/www/nextcloud/movies
2. Grant user 'www' full rights in Movies' ACL.
3. Add it as local external storage in NextCloud settings.

As a result, I can access the .../iocage/jails/nextcloudjail/root/usr/local/www/nextcloud/movies folder as 'www' user as well as any underlying subfolder, so this part is working fine. But, when I am trying to access it from NextCloud, I get the following message: "This operation is forbidden".
And the error in the nextcloud's log states the following:
FatalwebdavOCA\DAV\Connector\Sabre\Exception\Forbidden: No read permissions
  1. /usr/local/www/nextcloud/apps-pkg/dav/lib/Connector/Sabre/CommentPropertiesPlugin.php - line 72:
    OCA\DAV\Connector\Sabre\Directory->getChildren()

Hope it clarifies the situation a bit.

It is worth mentioning that the files from movies DS do appear in NextCloud's 'recent' category and can be even downloaded! I can't open it for view though, it would just show a blank screen and a spinning circle icon.
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
I am unsure if i understand what your question is. What do you mean with "datasets"? If you install Nextcloud as a plugin, it creates the dataset itself and sets up the database. I just looked at the guide and it is very old. You do normally not need to set up mount points after installing the plugin from the GUI. I have done several NC plugin installs and never did that. If you want to add external storage on a fixed dataset, as described in the tutorial, please make sure that user and group are both www. Can you check that?
Yes, I did that (added www:www in dataset's ACL). I can access the mount point from jails after impersonating 'www' (sudo -m www) just fine.
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
Same happens when I am trying to access my_nextcloud_ip/public.php/webdav:

FatalwebdavOCA\DAV\Connector\Sabre\Exception\Forbidden: No read permissions

Internal Server Error
The server was unable to complete your request.

If this happens again, please send the technical details below to the server administrator.

More details can be found in the server log.

So the issue is prob related to the NextCloud's webdav configuration using 3rd party app called Sabre. Google search doesn't give any clues.
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
It appears the preview (thumbnails) as well as the download requests are sent via 'index.php/core/preview' as GET. When I open an item inside NextCloud, it is loaded with “remote.php” (WebDAV) as PROPFIND request causing 'No read permissions'. Looking for advice.
 
Last edited:

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
An update: I was able to add another, NFS based dataset after applying "chown -R www:www root_folder" on the mount point. So it looks like the issue occurs with SMB based datasets only.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,740
What is an "SMB based dataset"? You should use local mountpoints, not SMB ...
 

Cyrilik

Cadet
Joined
Mar 6, 2021
Messages
9
What is an "SMB based dataset"? You should use local mountpoints, not SMB ...

I meant local dataset with SMB sharing. Looks like I was able to fix the issue by applying extended ACL permissions to the original dataset (some of them were prob required). Thanks for your efforts!
 

profzelonka

Explorer
Joined
Mar 29, 2020
Messages
67
I meant local dataset with SMB sharing. Looks like I was able to fix the issue by applying extended ACL permissions to the original dataset (some of them were prob required). Thanks for your efforts!
A little late but, care to provide what extended ACL permissions you needed to set? I think I'm encountering the same issue and 775 is apparently not enough.
 
Top