Error nextcloud update The following extra files have been found: nextcloud.log

Nextcloud version : 20.0.7
Operating system and version: eg, Ubuntu 20.04
Apache or nginx version: Apache 2.4.25
PHP version: 7.4.3

The issue you are facing:
Wen I try to update vi nextcloud updater, I have the error:

    Check for expected files
    The following extra files have been found:
        nextcloud.log

If I search for nextcloud.log files, I find;

find . -name "nextcloud.log"       
./html/nextcloud/nextcloud.log
./html/nextcloud/ocs/nextcloud.log
./html/nextcloud/ocm-provider/nextcloud.log
./html/nextcloud/ocs-provider/nextcloud.log

I tried to remove nextcloud/nextcloud.log
and restart the update, but this file was immediately recreated.
I installed Nextcloud using the instructions found here (maybe I should have used the manual):

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

Steps to replicate it:

  1. Log with admin account
  2. Go to open the updater system
  3. click on update

The output of your Nextcloud log in Admin > Logging:

{"reqId":"QW7O69tV63xMqj2t2ShO","level":3,"time":"March 03, 2021 07:14:49","remoteAddr":"82.65.243.247","user":"Antonio","app":"mail","method":"GET","url":"/index.php/apps/mail/api/mailboxes?accountId=3","message":{"Exception":"OCA\\Mail\\Exception\\ServiceException","Message":"IMAP error: Error connecting to mail server.","Code":11,"Trace":[{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/Service/MailManager.php","line":128,"function":"sync","class":"OCA\\Mail\\IMAP\\MailboxSync","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":92,"function":"getMailboxes","class":"OCA\\Mail\\Service\\MailManager","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"index","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/IMAP/MailboxSync.php","Line":106,"Previous":{"Exception":"Horde_Imap_Client_Exception","Message":"Error connecting to mail server.","Code":11,"Trace":[{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php","line":375,"function":"_connect","class":"Horde_Imap_Client_Socket","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php","line":838,"function":"_login","class":"Horde_Imap_Client_Socket","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php","line":1389,"function":"login","class":"Horde_Imap_Client_Base","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/IMAP/FolderMapper.php","line":60,"function":"listMailboxes","class":"Horde_Imap_Client_Base","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/IMAP/MailboxSync.php","line":103,"function":"getFolders","class":"OCA\\Mail\\IMAP\\FolderMapper","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/Service/MailManager.php","line":128,"function":"sync","class":"OCA\\Mail\\IMAP\\MailboxSync","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/lib/Controller/MailboxesController.php","line":92,"function":"getMailboxes","class":"OCA\\Mail\\Service\\MailManager","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"index","class":"OCA\\Mail\\Controller\\MailboxesController","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/
cloud.tellurix.eu/html/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php","Line":605},"CustomMessage":"IMAP error: Error connecting to mail server."},"userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0","version":"20.0.7.1"}
{"reqId":"F45plTNg5iReLa45AA5X","level":3,"time":"March 03, 2021 07:16:04","remoteAddr":"82.65.243.247","user":"Antonio","app":"PHP","method":"DELETE","url":"/remote.php/dav/files/Antonio/Administratif/Anyon","message":{"Exception":"Error","Message":"fread(): read of 8192 bytes failed with errno=21 Is a directory at /var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php#862","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":862,"function":"fread"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":930,"function":"readFirstBlock","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":961,"function":"getHeader","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":294,"function":"getEncryptionModule","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":278,"function":"rename","class":"OC\\Files\\Storage\\Wrapper\\Encryption","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":572,"function":"rename","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_trashbin/lib/Trashbin.php","line":322,"function":"moveFromStorage","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php","line":108,"function":"move2trash","class":"OCA\\Files_Trashbin\\Trashbin","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_trashbin/lib/Trash/TrashManager.php","line":103,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_trashbin/lib/Storage.php","line":192,"function":"moveToTrash","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/files_trashbin/lib/Storage.php","line":118,"function":"doDelete","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/View.php","line":1167,"function":"rmdir","class":"OCA\\Files_Trashbin\\Storage","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Files/View.php","line":350,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Connector/Sabre/Directory.php","line":310,"function":"rmdir","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php","line":183,"function":"delete","class":"OCA\\DAV\\Connector\\Sabre\\Directory","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":295,"function":"delete","class":"Sabre\\DAV\\Tree","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"httpDelete","class":"Sabre\\DAV\\CorePlugin","type":"->"},06:08:09","remoteAddr":"82.65.243.247","user":"Antonio","app":"PHP","method":"GET","url":"/remote.php/dav/files/Antonio/Professionnel%20Anyon/Anyon/Missions%20-%20hors%20dropbox/CA%20Titres_old/CAT/06%20-%20Communication/02%20-%20ELS-Amundi/PER%20CONVERGENCE%20Reglement%202018.pdf","message":{"Exception":"Error","Message":"Cannot modify header information - headers already sent by (output started at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php:112) at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php#70","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php","line":70,"function":"header"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":308,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/remote.php","line":167,"args":["/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1git (Nextcloud)","version":"20.0.7.1"}
{"reqId":"MiYgRHzQIiMQ2iO7X9ZF","level":3,"time":"March 04, 2021 06:08:09","remoteAddr":"82.65.243.247","user":"Antonio","app":"PHP","method":"GET","url":"/remote.php/dav/files/Antonio/Professionnel%20Anyon/Anyon/Missions%20-%20hors%20dropbox/CA%20Titres_old/CAT/06%20-%20Communication/02%20-%20ELS-Amundi/PER%20CONVERGENCE%20Reglement%202018.pdf","message":{"Exception":"Error","Message":"Cannot modify header information - headers already sent by (output started at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php:112) at /var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php#70","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/http/lib/Sapi.php","line":70,"function":"header"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":308,"function":"sendResponse","class":"Sabre\\HTTP\\Sapi","type":"::"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":319,"function":"start","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/lib/Server.php","line":332,"function":"exec","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->"},{"file":"/var/www/cloud.tellurix.eu/html/nextcloud/remote.php","line":167,"args":["/var/www/cloud.tellurix.eu/html/nextcloud/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/var/www/cloud.tellurix.eu/html/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Linux) mirall/3.1.1git (Nextcloud)","version":"20.0.7.1"}

(I truncated the file because it’s too long)
The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'trusted_domains' => 
  array (
    0 => '82.65.xxx.xxx',
    1 => 'cloud.tellurix.eu',
    2 => 'localhost',
  ),
  'datadirectory' => '/var/www/cloud.tellurix.eu/html/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '20.0.7.1',
  'overwrite.cli.url' => 'https://cloud.tellurix.eu',
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'loglevel' => 3,
  'logdateformat' => 'F d, Y H:i:s',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'adnext',
  'dbpassword' => '',
  'installed' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'ssl',
  'mail_smtptimeout' => '30',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'ss',
  'mail_domain' => 'ss',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'smtp.free.fr',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxxx@free.fr',
  'mail_smtppassword' => 'xxxxx',
  'mail_smtpauthtype' => 'LOGIN',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'maintenance' => false,
  'updater.secret' => 'dxxxx',
);

Delete all existing nextcloud.log files and make sure that you prefix the log file name with an absolute path to place the log file outsite of the Nextcloud document root directory, like e.g. (or any other directory):

'logfile' => '/var/log/nextcloud log',

J-ed solution worked fine, thanks ! :grinning:

1 Like