Hundreds of data_dir_writability_test errors in logs

Nextcloud version: 19.0.4
Operating system and version: Debian 10 Buster
Apache or nginx version: NGINX 1.14.2
PHP version: 7.4.11-FPM

The issue you are facing:
My logs are huge, sitting at gigabytes in size… They mostly contain the following error hundreds of thousands of times. I am not sure what is causing this as I have checked the permissions on the filesystem and Nextcloud has full access.

Is this the first time you’ve seen this error?: N

Steps to replicate it:

  1. Move Data dir to an NFS share (This is the only thing I changed recently that I can think might cause the issue)

The output of your Nextcloud log in Admin > Logging:

{"reqId":"XdVzk37ceugmREgMZD4f","level":3,"time":"2020-10-22T10:55:27+00:00","remoteAddr":"10.1.2.2","user":"--","app":"PHP","method":"GET","url":"/index.php/204","message":{"Exception":"Error","Message":"unlink(/mnt/nextcloud//data_dir_writability_test_5f91651f4c74c.tmp): No such file or directory at /mnt/www/nextcloud/lib/private/legacy/OC_Util.php#800","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/mnt/www/nextcloud/lib/private/legacy/OC_Util.php","line":800,"function":"unlink"},{"file":"/mnt/www/nextcloud/lib/base.php","line":661,"function":"checkServer","class":"OC_Util","type":"::"},{"file":"/mnt/www/nextcloud/lib/base.php","line":1094,"function":"init","class":"OC","type":"::"},{"file":"/mnt/www/nextcloud/index.php","line":35,"args":["/mnt/www/nextcloud/lib/base.php"],"function":"require_once"}],"File":"/mnt/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.13.1","version":"19.0.4.2","id":"5f918381e4525"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '-------------------',
  'passwordsalt' => '--------------------------------',
  'secret' => '----------------------------------',
  'trusted_domains' => 
  array (
    0 => '-----------',
    1 => '-----------',
  ),
  'datadirectory' => '/mnt/nextcloud/',
  'dbtype' => 'mysql',
  'version' => '19.0.4.2',
  'overwrite.cli.url' => '----------',
  'dbname' => 'nextcloud',
  'dbhost' => '10.1.0.5:3307',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => '---------',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mail_from_address' => 'no-reply',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => '------------',
  'mail_smtpsecure' => 'tls',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '---------',
  'mail_smtpport' => '587',
  'mail_smtpname' => '--------',
  'mail_smtppassword' => '----------',
  'has_rebuilt_cache' => true,
  'maintenance' => false,
  'debug' => false,
  'loglevel' => 2,
  'app_install_overwrite' => 
  array (
    0 => 'activitylog',
  ),
  'updater.release.channel' => 'stable',
  'theme' => '',
);

I think that is the problem. But i can not help.
Similar issue solved with Nextcloud 15: Improve data directory write checking for NFS mounts by rcdailey · Pull Request #13237 · nextcloud/server · GitHub

Interesting. Thank you very much for the info. Hopefully I can find something :slight_smile:
Glad to know I am not the only one having this issue. It looks like this is more of a PHP problem than a Nextcloud problem.

I just found this after searching for the same issue but in relation to PHP instead of Nextcloud.

Very interesting issue…

Perhaps “answer 2” with different UIDs is the problem. Test and if differ change it.

The UIDs appear to be the same, my www-data user on the NFS server and Client are 33