Nextcloud 21.0.1
Operating system and version Ubuntu 20 & Windows 10/Server 2019
Apache 2.4.41
PHP version 7.4.3
Windows Server 2019 has the folder “D:\NextcloudData” - Shared as ‘NextcloudData’.
NextcloudData share is mounted in Ubuntu under /mnt/nextclouddata using FStab.
/mnt/nextclouddata is used as external storage for my nextcloud.
Google Backup and Sync (Now called Google Drive for Desktop) backs up D:\NextcloudData to google drive.
The idea is that
- Desktop clients sync with my nextcloud server
2 The data is accessible in my windows environment under D:\NextcloudData - The data also automatically uploaded/backed up to Google Drive.
This setup has worked fine for years. The only issue that occurred was when I shared a folder in google drive - It would sync back down to my NextcloudData folder and break the permissions in Ubuntu, and removing write access from www-data… I learnt to deal with this, as typically after I’d shared a folder the data in it was finalised anyway so write access wasn’t a big deal.
The issue I’m facing now is that after upgrading from ‘Backup and Sync’ to Google drive for desktop’, which I expected to work exactly the same way, the permissions break regardless of whether a folder is shared on google drive or not.
Steps to replicate it and then fix it, then break it again:
- Create folder/file on windows client machine (or via nextcloud web gui).
- Receive error from windows nextcloud client, saying that it cannot sync that folder/file because it doesnt have permission.
- Go on windows server, exit/quit Google Drive
- ssh into ubuntu and run chmod -R 755 /mnt/nextclouddata
- Check back on folder/file with permissions error - Working as expected.
- Folders and file continue to sync as expected without permission issues.
- Go back on windows server, open/turn Google Drive back on
- Create folder/file on windows client machine (or via nextcloud web gui).
9 . Recieve permissions error.
**Output from ls -l in my nextclouddata folder when broken and Google Drive active -
dr-xr-x— 2 www-data www-data 0 Sep 14 20:04 ‘Media Projects’
**Output after turning off Google Drive, and chmod the permissions -
drwxrwx— 2 www-data www-data 0 Sep 14 20:04 ‘Media Projects’
**Turn Google Drive back on, wait for it’s initial file scan to finish after starting -
dr-xr-x— 2 www-data www-data 0 Sep 14 20:37 ‘Media Projects’
I’m really not sure what to do… I know this isn’t Nextcloud’s fault, but why Google Drive, installed in a windows environment is affecting folder permissions mounted in Ubuntu is absolutely stupid.