Preview mode suddenly not working after sudo -u www-data php occ files:scan --all nc12 (please help)

Nextcloud version (eg, 10.0.2): 12.0.3
Operating system and version (eg, Ubuntu 16.04): 16.11
Apache or nginx version (eg, Apache 2.4.25): nginx 11.01
PHP version (eg, 5.6): 7.0
Is this the first time you’ve seen this error?:yes

The output of your Nextcloud log in Admin > Logging:
Error PHP Invalid argument supplied for foreach() at /var/www/html/lib/private/Files/Type/Detection.php#104 2017-11-15T10:15:50+0100
Error PHP array_merge(): Argument #2 is not an array at /var/www/html/lib/private/Files/Type/Detection.php#101 2017-11-15T10:15:50+0100
Error PHP array_merge(): Argument #2 is not an array at /var/www/html/lib/private/Files/Type/Detection.php#146 2017-11-15T10:15:50+0100
Error PHP Invalid argument supplied for foreach() at /var/www/html/lib/private/Files/Type/Detection.php#104 2017-11-15T10:15:50+0100
Error PHP array_merge(): Argument #2 is not an array at /var/www/html/lib/private/Files/Type/Detection.php#101 2017-11-15T10:15:50+0100
Error PHP array_merge(): Argument #2 is not an array at /var/www/html/lib/private/Files/Type/Detection.php#146

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 => 'start.boxu.nl', ), 'datadirectory' => '/mnt/bigstorage2/boxu/data', 'overwrite.cli.url' => 'https://start.boxu.nl', 'dbtype' => 'mysql', 'version' => '12.0.3.3', 'dbname' => '......', 'dbhost' => 'localhost', 'dbport' => '', 'dbtableprefix' => 'oc_', 'dbuser' => '......', 'dbpassword' => '........', 'logtimezone' => 'UTC', 'installed' => true, 'enable_previews' => true, 'enabledPreviewProviders' => array ( 0 => 'OC\\Preview\\PNG', 1 => 'OC\\Preview\\JPEG', 2 => 'OC\\Preview\\GIF', 3 => 'OC\\Preview\\BMP', 4 => 'OC\\Preview\\XBitmap', 5 => 'OC\\Preview\\MarkDown', 6 => 'OC\\Preview\\MP3', 7 => 'OC\\Preview\\TXT', 8 => 'OC\\Preview\\Illustrator', 9 => 'OC\\Preview\\Movie', 10 => 'OC\\Preview\\MSOffice2003', 11 => 'OC\\Preview\\MSOffice2007', 12 => 'OC\\Preview\\MSOfficeDoc', 13 => 'OC\\Preview\\OpenDocument', 14 => 'OC\\Preview\\PDF', 15 => 'OC\\Preview\\Photoshop', 16 => 'OC\\Preview\\Postscript', 17 => 'OC\\Preview\\StarOffice', 18 => 'OC\\Preview\\SVG', 19 => 'OC\\Preview\\TIFF', 20 => 'OC\\Preview\\Font', ), 'mail_from_address' => 'noreply', 'mail_smtpmode' => 'smtp', 'mail_domain' => 'somedomain', 'loglevel' => 0, 'mail_smtphost' => 'somehost', 'mail_smtpport' => '25', 'maintenance' => false, 'theme' => '', 'auth.bruteforce.protection.enabled' => false, 'knowledgebaseenabled' => false, 'updater.release.channel' => 'production', 'memcache.local' => '\\OC\\Memcache\\APCu', 'memcache.locking' => '\\OC\\Memcache\\Redis', 'redis' => array ( 'host' => 'localhost', 'port' => 6379, ), 'skeletondirectory' => '/mnt/bigstorage2/boxu/data/skel', 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpauth' => 1, 'mail_smtpname' => '.........', 'mail_smtppassword' => '.........', ); The output of your Apache/nginx/system log in `/var/log/____`: No errors --- In NC 12 previes are not listed and the gallery is not working. There where no changes in the config but this morning it stopped working.

This issue is started after the following command

sudo -u www-data php occ files:scan --all