Nextcloud throwing errors in my log

Nextcloud version (eg, 20.0.5): 21.0.1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.5 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.29 (Ubuntu)
PHP version (eg, 7.4): PHP 8.0.3 (cli)

The issue you are facing:

The log is flooded by errors after (and previous) upgrade php7.4 → php8.0
Some new errors appeared since upgrade.
I upgraded because i thought this might fix some errors.

Is this the first time you’ve seen this error? (Y/N): Error repeat to show up, so no

Steps to replicate it:

  1. none - errors appear while running NC

The output of your Nextcloud log in Admin > Logging:

Error: session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#207

    <<closure>>

    OC\Log\ErrorHandler::onError()

    <<closure>>

    session_start()

    /var/www/nextcloud/lib/private/Session/Internal.php - line 207:

    call_user_func_array()

    /var/www/nextcloud/lib/private/Session/Internal.php - line 217:

    OC\Session\Internal->invoke()

    /var/www/nextcloud/lib/private/Session/Internal.php - line 107:

    OC\Session\Internal->startSession()

    /var/www/nextcloud/lib/private/Session/CryptoSessionData.php - line 150:

    OC\Session\Internal->clear()

    /var/www/nextcloud/lib/private/User/Session.php - line 932:

    OC\Session\CryptoSessionData->clear()

    /var/www/nextcloud/lib/private/AppFramework/Middleware/Security/CORSMiddleware.php - line 91:

    OC\User\Session->logout()

    /var/www/nextcloud/lib/private/AppFramework/Middleware/MiddlewareDispatcher.php - line 98:

    OC\AppFramework\Middleware\Security\CORSMiddleware->beforeController()

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 119:

    OC\AppFramework\Middleware\MiddlewareDispatcher->beforeController()

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 157:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/nextcloud/lib/private/Route/Router.php - line 302:

    OC\AppFramework\App::main()

    /var/www/nextcloud/lib/base.php - line 993:

    OC\Route\Router->match()

    /var/www/nextcloud/index.php - line 37:

    OC::handleRequest()

***Appears every minute

Error: The "Symfony\Component\Translation\PluralizationRules" class is deprecated since Symfony 4.2. at /var/www/nextcloud/3rdparty/symfony/translation/PluralizationRules.php#38

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /var/www/nextcloud/3rdparty/symfony/translation/PluralizationRules.php - line 38:

    trigger_error()

    /var/www/nextcloud/lib/private/L10N/L10N.php - line 226:

    Symfony\Component\Translation\PluralizationRules::get()

    /var/www/nextcloud/lib/private/L10N/L10NString.php - line 70:

    OC\L10N\L10N->OC\L10N\{closure}("*** sensiti ... *")

    /var/www/nextcloud/lib/private/L10N/L10N.php - line 131:

    OC\L10N\L10NString->__toString()

    /var/www/nextcloud/lib/private/L10N/LazyL10N.php - line 57:

    OC\L10N\L10N->n()

    /var/www/nextcloud/lib/private/DateTimeFormatter.php - line 257:

    OC\L10N\LazyL10N->n()

    /var/www/nextcloud/lib/private/legacy/template/functions.php - line 306:

    OC\DateTimeFormatter->formatTimeSpan()

    /var/www/nextcloud/apps/settings/templates/settings/admin/server.php - line 34:

    relative_modified_date()

    /var/www/nextcloud/lib/private/Template/Base.php - line 178:

    include("/var/www/ne ... p")

    /var/www/nextcloud/lib/private/Template/Base.php - line 150:

    OC\Template\Base->load()

    /var/www/nextcloud/lib/private/legacy/OC_Template.php - line 180:

    OC\Template\Base->fetchPage()

    /var/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php - line 210:

    OC_Template->fetchPage()

    /var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 139:

    OCP\AppFramework\Http\TemplateResponse->render()

    /var/www/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php - line 83:

    OCA\Settings\Controller\AdminSettingsController->formatSettings()

    /var/www/nextcloud/apps/settings/lib/Controller/CommonSettingsTrait.php - line 149:

    OCA\Settings\Controller\AdminSettingsController->getSettings()

    /var/www/nextcloud/apps/settings/lib/Controller/AdminSettingsController.php - line 68:

    OCA\Settings\Controller\AdminSettingsController->getIndexResponse()

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 218:

    OCA\Settings\Controller\AdminSettingsController->index()

    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 127:

    OC\AppFramework\Http\Dispatcher->executeController()

    /var/www/nextcloud/lib/private/AppFramework/App.php - line 157:

    OC\AppFramework\Http\Dispatcher->dispatch()

    /var/www/nextcloud/lib/private/Route/Router.php - line 302:

    OC\AppFramework\App::main()

    /var/www/nextcloud/lib/base.php - line 993:

    OC\Route\Router->match()

    /var/www/nextcloud/index.php - line 37:

    OC::handleRequest()


***Appears every few minutes

Required parameter $internalPath follows optional parameter $mountId at /var/www/nextcloud/lib/private/Files/Config/CachedMountFileInfo.php#34

also 

Required parameter $tagManager follows optional parameter $fileIdentifier at /var/www/nextcloud/apps/files/lib/Helper.php#220

***Appears sometimes

Error: filesize(): stat failed for /var/www/nextcloud/data/flow.log at /var/www/nextcloud/lib/public/Log/RotationTrait.php#62

***Appeared twice until now since this morning

	Error: Trying to access array offset on value of type null at /var/www/nextcloud/apps/federatedfilesharing/lib/Notifications.php#266

***had this one before Upgrade to php8.0, now it seems to be gone :-/


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

<?php
$CONFIG = array (
  'instanceid' => 'ID',
  'passwordsalt' => 'Salty!',
  'secret' => 'Top Secret!',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.my.server',
    1 => 'www.nextcloud.my.server',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.1.1',
  'overwrite.cli.url' => 'https://www.nextcloud.my.server',      ///Why is there a overwrite?
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'datenbank',
  'dbpassword' => 'Very Secret Password',
  'installed' => true,
  'mail_from_address' => 'webmaster',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'my.server',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'my.server',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'webmaster@my.server',
  'mail_smtppassword' => 'Most secret Password',
  'mail_smtpsecure' => 'ssl',
  'maintenance' => false,
  'mysql.utf8mb4' => true,
  'default_phone_region' => 'DE',
  'force_locale' => 'de_DE',
  'updater.secret' => 'Secret',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache/nginx/system log in /var/log/____:

too much, but no entries within the last hour

Thanks for your support!

Hello friend, how are you?

Hope you doing well, so before anything, let’s try some things up:

1) sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
2) chown -R www-data:www-data /var/www/nextcloud/
3) chmod -R 770 /var/www/nextcloud/
4) sudo -u www-data php /var/www/nextcloud/occ maintenance:repair
5) sudo -u www-data php /var/www/nextcloud/occ db:add-missing-columns
6) sudo -u www-data php /var/www/nextcloud/occ db:add-missing-indices
7) sudo -u www-data php /var/www/nextcloud/occ maintenance:update:htaccess
8) sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --off
9) sudo systemctl restart apache2

Make sure you have php-fpm installed and running.

Hope this helps, have a nice weekend.

All the best!

:smiley:

2 Likes

First:
Thank you for that fast reaction!
Looks good so far, just one error left for now:

Required parameter $internalPath follows optional parameter $mountId at /var/www/nextcloud/lib/private/Files/Config/CachedMountFileInfo.php#34

Any solutions for this last point?

Have a good time and keep healthy

Dirk

1 Like

Hey friend, do you have any cache server installed? Like Redis or APCU for example.

This seems to be a config bug of a memcache.

Seems to be related to php8.0.
I don’t have any memcache installed - NC is “complaining” about this - but my NC is so small and the last time I installed a memcache, it didn’t really speed up but rather occupied my HDDs constantly …
So I found this: Deprecate required parameters after optional parameters in function/method signatures - PHP 8.0 • PHP.Watch
But don’t know anyway to use this informations.

Stay well,
Dirk

1 Like

Hey mate, probably a solution here:

Keep in mind that it was not reviewed by NC yet, so do it on your own risk (as you can see a lot of users had success applying the changes).

Also check this out:

Good luck mate! See ya.

:smiley:

Ok, another look in my log shows there are a way more errors today.
Looks like it wasn’t a good idea to upgrade to php8.0 :frowning:

Right now I’m tired of trying to fix all those errors.
Maybe I’m going to back up all files and Database next week or so and start from scratch.

New errors today:

Error: disk_free_space(): No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#369
Sabre\DAV\Exception\BadRequest: Expected filesize of _(some size here)_ bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) _(some size here)_ bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.
Error: imagecreatefromstring(): Data is not in a recognized format at /var/www/nextcloud/lib/private/legacy/OC_Image.php#668
Required parameter $internalPath follows optional parameter $mountId at /var/www/nextcloud/lib/private/Files/Config/CachedMountFileInfo.php#34
Error: filesize(): stat failed for /var/www/nextcloud/data/flow.log at /var/www/nextcloud/lib/public/Log/RotationTrait.php#62
Error: session_start(): Ignoring session_start() because a session is already active at /var/www/nextcloud/lib/private/Session/Internal.php#207

(thought I fixed that one…) Throwed every minute!

Error: unlink(/tmp/6079825825821.svg): No such file or directory at /var/www/nextcloud/apps/passwords/lib/Helper/Icon/FallbackIconGenerator.php#127

Besides that… thank you!

I’ll see if it’s worth fixing. Funny sidenote: I upgraded only to 8.0, because NC “told” me php7.3 won’t be supported in the future. So I thought why not upgrade to the newest version…

1 Like

I’m sorry to hear that and I agree with you.

Maybe it’s time for a fresh, clean, new install.

I recommend to you the use of php 7.4. For me it’s working great with php-fpm + redis + apache on NC 21.0.1 Stable.

Good luck and have a nice weekend mate.

I wish i could help you more.

:slight_smile: