Nextcloud doesn't "write-through" to NFS external storage

Nextcloud version (eg, 20.0.5): 22.2.5
Operating system and version (eg, Ubuntu 20.04): Debian 10
Apache or nginx version (eg, Apache 2.4.25): 2.4.38
PHP version (eg, 7.4): 7.3.31

The issue you are facing:

I have Nextcloud running in a privileged LXC container in Proxmox using the Turnkey template. I would like to use the External Storage app to access an NFS share from another system.

I am able to successfully mount the NFS share and can create/delete files as the www-data user from the shell. These changes are visible from the system hosting the NFS share as well. I’m also able to configure the mounted folder as a Local external storage option.

The issue arises when I try to create a file or folder inside of the external folder via the Files view in Nextcloud. While the file is created successfully, the contents of the actual directory do not change. Oddly enough, the change is only visible after unmounting the NFS share from the filesystem (at which point the files show up in the unmounted directory).

Any ideas? Thanks in advance!

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Create a mount directory: mkdir /mnt/data
  2. Mount an NFS share to the Nextcloud container: mount -t nfs nas:/some-share /mnt/data
  3. Verify permissions: chown www-data:www-data /mnt/data && chmod 770 /mnt/data
  4. Try creating a file via the shell: runuser --user www-data -- touch /mnt/data/test
  5. Create a local external storage configuration named “data” with a Configuration value of /mnt/data`
  6. Browse to the new data folder in the Files view
  7. Create a new file
  8. Verify the file doesn’t exist in the filesystem: ls -la /mnt/data
  9. Unmount the NFS share: umount /mnt/data
  10. Verify the file now shows in the filesystem: ls -la /mnt/data