NC 19.5 Scanner.php logs consuming all space on drive

[/details]

Nextcloud version : Nextcloud version 19.0.5
Operating system : Red Hat Enterprise Linux Server release 7.9
Apache or nginx version : Apache 2.4.34
PHP version (eg, 7.1): 7.3.11

Since upgrading to version 19.0.5 we have started having /var/log/messages get filled with scanner.php error messages.

Each log entry is quite large but I think this is the problematic part of the log:

Undefined index: mimetype at /var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php#167

full log message below

Nov 30 08:26:49 ServerName Nextcloud[2299]: {"reqId":"VctkdRB0qBwIoU0zcDqP","level":3,"time":"2020-11-30T08:26:49+11:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"{\"Exception\":\"Error\",\"Message\":\"Undefined index: size at /var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php#433\",\"Code\":0,\"Trace\":[{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":433,\"function\":\"onError\",\"class\":\"OC\\\\Log\\\\ErrorHandler\",\"type\":\"::\",\"args\":[8,\"Undefined index: size\",\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",433,{\"path\":\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices/device:17\",\"recursive\":2,\"reuse\":3,\"folderId\":114832640,\"lock\":true,\"size\":12288,\"existingChildren\":[],\"newChildren\":[{\"mimetype\":\"application/octet-stream\",\"mtime\":1606549509,\"size\":4096,\"etag\":\"5fc41219a90e0\",\"storage_mtime\":1606549509,\"permissions\":11,\"name\":\"uevent\",\"scan_permissions\":27},{\"mimetype\":\"httpd/unix-directory\",\"mtime\":1606549509,\"size\":-1,\"etag\":\"5fc41219aadad\",\"storage_mtime\":1606549509,\"permissions\":15,\"name\":\"power\",\"scan_permissions\":31},{\"mimetype\":\"application/octet-stream\",\"mtime\":1606549509,\"size\":4096,\"etag\":\"5fc41219ac73e\",\"storage_mtime\":1606549509,\"permissions\":11,\"name\":\"adr\",\"scan_permissions\":27},{\"mimetype\":\"application/octet-stream\",\"mtime\":1606549509,\"size\":4096,\"etag\":\"5fc41219ae0d0\",\"storage_mtime\":1606549509,\"permissions\":11,\"name\":\"path\",\"scan_permissions\":27},{\"scan_permissions\":null,\"permissions\":0}],\"exceptionOccurred\":false,\"childQueue\":{\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices/device:17/power\":114840609},\"newChildNames\":[\"uevent\",\"power\",\"adr\",\"path\",null],\"fileMeta\":{\"scan_permissions\":null,\"permissions\":0},\"file\":null,\"child\":\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices/device:17/\",\"existingData\":false,\"data\":{\"scan_permissions\":null,\"permissions\":0,\"parent\":114832640,\"fileid\":-1,\"oldSize\":0,\"encrypted\":false}}]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":388,\"function\":\"handleChildren\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices/device:17\",2,3,114832640,true,12288]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":391,\"function\":\"scanChildren\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices/device:17\",2,3,114832640,true]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":391,\"function\":\"scanChildren\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem/devices\",2,3,114832512,true]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":391,\"function\":\"scanChildren\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69/subsystem\",2,3,114832454,true]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":340,\"function\":\"scanChildren\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69\",2,3,90186897,true]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":506,\"function\":\"scan\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69\",2,3]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":517,\"function\":\"OC\\\\Files\\\\Cache\\\\{closure}\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[\"*** sensitive parameters replaced ***\"]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Cache/Scanner.php\",\"line\":505,\"function\":\"runBackgroundScanJob\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[{\"__class__\":\"Closure\"},\".wine/dosdevices/z:/proc/self/root/sys/class/thermal/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/thermal_zone2/subsystem/cooling_device1/device/firmware_node/subsystem/devices/device:69\"]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/Files/Utils/Scanner.php\",\"line\":186,\"function\":\"backgroundScan\",\"class\":\"OC\\\\Files\\\\Cache\\\\Scanner\",\"type\":\"->\",\"args\":[]},{\"file\":\"/var/www/html/nextcloud-19.0.5/apps/files/lib/BackgroundJob/ScanFiles.php\",\"line\":83,\"function\":\"backgroundScan\",\"class\":\"OC\\\\Files\\\\Utils\\\\Scanner\",\"type\":\"->\",\"args\":[\"\"]},{\"file\":\"/var/www/html/nextcloud-19.0.5/apps/files/lib/BackgroundJob/ScanFiles.php\",\"line\":111,\"function\":\"runScanner\",\"class\":\"OCA\\\\Files\\\\BackgroundJob\\\\ScanFiles\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\User\\\\User\"}]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/BackgroundJob/Job.php\",\"line\":62,\"function\":\"run\",\"class\":\"OCA\\\\Files\\\\BackgroundJob\\\\ScanFiles\",\"type\":\"->\",\"args\":[null]},{\"file\":\"/var/www/html/nextcloud-19.0.5/lib/private/BackgroundJob/TimedJob.php\",\"line\":57,\"function\":\"execute\",\"class\":\"OC\\\\BackgroundJob\\\\Job\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\BackgroundJob\\\\JobList\"},{\"__class__\":\"OC\\\\Log\"}]},{\"file\":\"/var/www/html/nextcloud-19.0.5/cron.php\",\"line\":126,\"function\":\"execute\",\"class\":\"OC\\\\BackgroundJob\\\\TimedJob\",\"type\":\"->\",\"args\":[{\"__class__\":\"OC\\\\BackgroundJob\\\\JobList\"},{\"__class__\":\"OC\\\\Log\"}]}],\"File\":\"/var/www/html/nextcloud-19.0.5/lib/private/Log/ErrorHandler.php\",\"Line\":91,\"CustomMessage\":\"--\"}","userAgent":"--","version":"19.0.5.2"}

I am not sure what I need to do to fix this perror

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

Steps to replicate it:

  1. This issue occurs constantly after the server starts.

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

<?php
$CONFIG = array (
  'instanceid' => '****',
  'passwordsalt' => '***',
  'trusted_domains' => 
  array (
    0 => '********',
  ),
  'datadirectory' => '/var/www/html/owncloud-data/data',
  'dbtype' => 'pgsql',
  'version' => '19.0.5.2',
  'dbname' => 'clouddb',
  'dbhost' => '127.0.0.1',
  'dbtableprefix' => 'oc_',
  'dbuser' => '****',
  'dbpassword' => '***',
  'installed' => true,
  'ldapIgnoreNamingRules' => false,
  'log_type' => 'syslog',
  'log_authfailip' => true,
  'logtimezone' => 'Australia/Melbourne',
  'forcessl' => true,
  'theme' => '',
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'mail_domain' => '*****',
  'mail_smtpdebug' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtphost' => '*****',
  'mail_smtpport' => '25',
  'mail_smtptimeout' => 10,
  'maintenance' => false,
  'share_folder' => '/Shared',
  'mail_from_address' => '*****',
  'secret' =>
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'filelocking.enabled' => 'true',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
    'password' => '***',
  ),
  'loglevel' => 2,
  'trashbin_retention_obligation' => 'auto',
  'ldapProviderFactory' => '\\OCA\\User_LDAP\\LDAPProviderFactory',
  'overwrite.cli.url' => 'https://*****',
  'default_language' => 'en',
  'default_locale' => 'en_US',
  'auth.bruteforce.protection.enabled' => false,
  'ldapUserCleanupInterval' => 51,
  'blacklisted_files' => 
  array (
    0 => '.htaccess',
  ),
  'mail_sendmailmode' => 'smtp',
);

To narrow down the problem I would ask you to explain where the Wine DOS drive z: comes from?! There seems to be a never ending loop in the path.

I noticed that as well and wine definitely isn’t installed on that server.

I also did a search for the .wine directory and it didnt return any results either. I have no idea where that wine directory is coming from.