External Storage: Read only access whatever I set!

Nextcloud version : 28.0.1
Operating system and version : Debian Bookworm V12
Apache or nginx version : No idea
PHP version : 8.2.7

Hi all. Firstly, apologies for the very basic questions. Have searched around but couldn’t really get the answers I need.
I have a vanilla nextcloud install in a VM on Proxmox. Nothing additional, no extra config.
I have mounted NFS shares in /media/nextcloud/extnfsshare as follows:
As root in the cli, I can navigate into and manipulate file contents. No problem.
I have also configured these shares in the ;external storage’ area in NextCloud as follows:

[The problem]
In the webgui, I can see (view), but cannot seem to be able to undertake any write operations at all in any of these directories.
I recon this is either a permissions thing (Which I am not certain how to resolve) or an NFS Configuration thing (which may be very wrong): options: anongid=100, anonuid=100, insecure, no_root_squash, ro, rw, subtree_check

Its taken me a VERY long time to get to a place where I am happy with this setup, and I really don’t want to screw stuff up anymore. Any words of advice please??!

I very rarely use NFS, but why have you got both ro (read only) and rw (read/write) set? Which takes precedence?

The “ro” is wrong.
Second: Owner and group should be www-data:www-data, too, if I see it right.

1 Like

@fredu as said by @Mornsgrans the main issue in your case is the owner of each repertory…
Nextcloud uses the www-data UNIX user. The owner and group is not this user so the permissions used by nextcloud are the last 3 characters that are : r-x so you have only read and execute permissions available in nextcloud.

Brilliant, that’s got me a lot closer. Thanks
The ro,rw thing was a mistake on my part. Now corrected.

The setup is a little confusing. let me explain. I have OMV looking after both common shares to directories via NFS (for NextCloud), AND SMB (for windows)
NFS (as above) and SMB are setup pretty much the same (I hope)

So, I did the following (am praying its correct):
I can now at least add, update and delete directories and files from NextCloud
I can ‘also’ modify and delete files (from nextcloud) originating from an SMB source (Windows)

The next challenge is to allow my SMB Source to modify/delete content ‘Originating’ from NextCloud as well. This is not currently allowed for some odd reason.

Is this a setting at the nextcloud side, or the NFS Side? (I cant see anything on the SMB side to fiddle with, unless its got something to do with inheriting ACLs or permissions?

I stronly recommend, NOT to do that!
Nextcloud does not find those files, because the do not become added to the Nextcloud database. - Please use a WebDAV-connection instead.

Aah, another twist… Is WebDAV better (more performant) than NFS? Not honestly sure how I go about setting one up

All I need is reliable access to my shared files through NextCloud. Mostly reading tbh, but I will be sync’ing pictures etc. from our mobile phones, which will require tidying up - I will tend to do this from a Windows Laptop. So If I cant do this on NextCloud originated content, its going to be a sorry journey…

Either use WebDAV or the Nextcloud Desktop client.
I think, WebDAV is slower than NFS, but as written above, Nextcloud itself does not recognize SMB or NFS-transferred/modified/deleted files. So they will not appear in Netcloud using browser.

The desktop-app synchronizes the Nextcloud data files with a folder of your computer and/or mobile device.

@fredu it can be done with Samba but as said @Mornsgrans nextcloud does not automatically add these new files. There is an app called files_inotify to add this feature but I don’t know if it works with Samba share. if not you have to run this command (occ files:scan --all) each time you add files manually (without Webdav or nextcloud) or use cron to run it at certain times automatically.
Ensure the new files allow the www-data UNIX user to read, write and execute or you will have the same issue as the beginning.

1 Like

It might be possible, but it is not recommended, because the access will be used outside the Nextcloud specification.
On the other hand you might run into trouble, if the cronjob with the occ command will be executed while an upgrade of Nextcloud.
Next disadvantage: If there are many users with many files, the execution time of the occ command may take a longer time, so the server permanently is running occ and the users complain due to low server performance.

The safest way is WebDAV-access, as it was intended by the developers.

Thanks. Will have a go at installing WebDAV. I guess I can either install it from the OMV side (some cursory investigation tells me its not that mature on the OMV side), or have it in its own container in Proxmox…
Anyone ever done this? Probably Proxmox container is the way to do this. Not entirely sure where to even start here!

So, a follow-up to my conundrum. I ended up installing and enabling WebDav through my OMV client. Seems to work ok, but am really stuck on a permissioning issue now. I can’t seem to make any edits or file changes.

To explain:
NextCloud Side :
Same Username and password as configured in OMV

OMV Side - WebDav config:
user(Myself) → group (webdav-users)

Am not really sure how to configure permissions now. Any advice is gratefully recieved!