In Production System throwing "Your data directory is not writable"

System Info

Ubuntu 20.04.4 always updated
Apache current Ubuntu Version
MySQL 8.0.29
PHP 7.4.3 with opcache

Nextcloud 22.2.8
Traditional install, not a Snap or container install.
Lives on Digital Ocean.
Web app on droplet. 16 GB Memory / 8 AMD vCPUs / 160 GB Disk Almost never reach 100% of anything.
Data folder on mounted drive. 500 GB 1/2 full
In production, 6+ months.

Substituted subdomain and domain for actual.

Problem:
Everything works as it should except for this error generating an email every 5 minutes.
Email content below.
I can’t add more details, it just started happening.
I was in the middle of moving other unrelated servers and had to put it on ignore.
I read everything I could find, and I figure it is something simple I am not seeing.
I could go in and wack the code, but that is not usually my style.

Any help would be greatly appreciated.

92661970{“reqId”:“7GhG6xCinIlKIiUcoiCE”,“level”:3,“time”:“2022-07-08T11:50:02+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"",“url”:"–",“message”:“fopen(/mnt/wavecloud_data/data/data_dir_writability_test_62c819ea3126c.tmp): failed to open stream: Permission denied at /var/www/subdomain.domain.net/public_html/lib/private/legacy/OC_Util.php#791”,“userAgent”:"–",“version”:“22.2.3.0”,“exception”:{“Exception”:“Error”,“Message”:“fopen(/mnt/wavecloud_data/data/data_dir_writability_test_62c819ea3126c.tmp): failed to open stream: Permission denied at /var/www/subdomain.domainco.net/public_html/lib/private/legacy/OC_Util.php#791”,“Code”:0,“Trace”:[{“function”:“onError”,“class”:“OC\Log\ErrorHandler”,“type”:"::"},{“file”:"/var/www/subdomain.domain.net/public_html/lib/private/legacy/OC_Util.php",“line”:791,“function”:“fopen”},{“file”:"/var/www/subdomain.domain.net/public_html/lib/base.php",“line”:656,“function”:“checkServer”,“class”:“OC_Util”,“type”:"::"},{“file”:"/var/www/subdomain.domain.net/public_html/lib/base.php",“line”:1089,“function”:“init”,“class”:“OC”,“type”:"::"},{“file”:"/var/www/subdomain.domain.net/public_html/cron.php",“line”:42,“args”:["/var/www/subdomain.domain.net/public_html/lib/base.php"],“function”:“require_once”}],“File”:"/var/www/subdomain.domainco.net/public_html/lib/private/Log/ErrorHandler.php",“Line”:92,“CustomMessage”:"–"}}
Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See Installation wizard — Nextcloud latest Administration Manual latest documentation.

{“reqId”:“7GhG6xCinIlKIiUcoiCE”,“level”:3,“time”:“2022-07-08T11:50:02+00:00”,“remoteAddr”:"",“user”:"–",“app”:“PHP”,“method”:"",“url”:"–",“message”:“fopen(/mnt/wavecloud_data/data/nextcloud.log): failed to open stream: Permission denied at /var/www/subdomain.domain.net/public_html/lib/private/Log/File.php#84”,“userAgent”:"–",“version”:“22.2.3.0”}

What are the permissions on the data dir? Are any sub folders or files not owned and writable by your www user?

/mnt                 drwxr-xr-x   root:root
/mnt/wavecloud_data  drwxrwxr-x   root:www-data

was root:root, but I changed it to see if it might change the error.


/mnt/wavecloud_data/data/ drwxrwx---  www-data:www-data

All subfolder permissions are drwxr-xr-x www-data:www-data
All file permissions are -rw-r--r-- www-data:www-data
I can create new users in the data directory.

Truncated nextcloud.log. Really should put it in log rotate.
Updated to Nextcloud 22.2.9.
There is nothing in the nextcloud.log.
Ran this to double-check my statements above and found one folder but contents were correct.
find /mnt/wavecloud_data/data ( ! -user www-data -o ! -group www-data ) -print
/mnt/wavecloud_data/data/Arnold/files/Insurance/Generic Insurance Brochure/Generic Insurance Brochure to Homeowner
from … /public_html# sudo -u www-data php -r ‘fopen("/mnt/wavecloud_data/data/data_dir_writability_test_62cc1ffd533d4.tmp",“w”);’
works
Still no joy.