Nextcloud version: 27
Operating system and version: Ubuntu 20.04 LTS (no snap)
Apache or nginx version: Apache/2.4.41 (Ubuntu)
PHP version: 8.1
The issue you are facing:
I have updated PHP from version 7.4, to version 8.1, and I uninstalled the old 7.4. I configured the /etc/php/8.1/apache2/php.ini file, and I have installed the 8.1 modules, but when I try to run occ command I get the error:
sudo -u www-data php -f /var/www/nextcloud/cron.php
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1531): OC\DB\Connection->connect()
[...]
Also the cron job return the same error.
Is this the first time you’ve seen this error? (Y/N): Y
Steps to replicate it:
- Update PHP from 7.4 to 8.1
- Install all the PHP modules
- Try to run an occ command
The output of your Nextcloud log in Admin > Logging:
Debug logreader Could not find resource file "/apps/logreader/css/../js/logreader-main.css"
2023-07-02T12:54:48+0200
Info no app in context InvalidArgumentException: Section with the same ID already registered: migration, class: OCA\Google\Settings\PersonalSection
2023-07-02T12:54:48+0200
Debug no app in context Deprecated event type for OCP\IDBConnection::CHECK_MISSING_COLUMNS: Symfony\Component\EventDispatcher\GenericEvent is used
2023-07-02T12:35:43+0200
Info no app in context InvalidArgumentException: Section with the same ID already registered: migration, class: OCA\Google\Settings\PersonalSection
2023-07-02T12:35:32+0200
Debug no app in context Deprecated event type for OCP\IDBConnection::CHECK_MISSING_COLUMNS: Symfony\Component\EventDispatcher\GenericEvent is used
2023-07-02T12:35:25+0200
Debug no app in context Deprecated event type for OCP\IDBConnection::CHECK_MISSING_INDEXES: Symfony\Component\EventDispatcher\GenericEvent is used
2023-07-02T12:35:25+0200
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 => 'name.mydomain.com',
),
'datadirectory' => '/home/mynextdata/',
'dbtype' => 'mysql',
'version' => '27.0.0.8',
'overwrite.cli.url' => 'http://name.mydomain.com',
'dbname' => 'nextclouddb',
'dbhost' => 'localhost',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextclouduser',
'dbpassword' => '*******',
'installed' => true,
'maintenance' => false,
'theme' => '',
'loglevel' => 0,
'default_phone_region' => 'IT',
'memcache.local' => '\\OC\\Memcache\\APCu',
'mail_smtpmode' => 'smtp',
'mail_smtpauthtype' => 'LOGIN',
'mail_sendmailmode' => 'smtp',
'mail_smtpauth' => 1,
'mail_smtpsecure' => 'tls',
'mail_from_address' => 'myemailgmail',
'mail_domain' => 'gmail.com',
'mail_smtphost' => 'smtp.googlemail.com',
'mail_smtpport' => '587',
'mail_smtpname' => 'myemailgmail',
'mail_smtppassword' => '*******',
'twofactor_enforced' => 'false',
'twofactor_enforced_groups' =>
array (
0 => 'Home',
),
'twofactor_enforced_excluded_groups' =>
array (
0 => 'admin',
),
'updater.release.channel' => 'stable',
'updater.secret' => '*******',
'memories.exiftool' => '/var/www/nextcloud/apps/memories/exiftool-bin/exiftool-amd64-glibc',
'memories.vod.path' => '/var/www/nextcloud/apps/memories/exiftool-bin/go-vod-amd64',
'preview_max_memory' => 4096,
'preview_max_filesize_image' => 256,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\Image',
),
'preview_max_x' => 512,
'preview_max_y' => 512,
);
The output of your Apache/nginx/system log in /var/log/____
:
[Sun Jul 02 00:00:07.829147 2023] [mpm_prefork:notice] [pid 51410] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jul 02 00:00:07.829190 2023] [core:notice] [pid 51410] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 02 02:02:45.513006 2023] [php:error] [pid 61785] [client 68.***.***.229:47956] script '/var/www/html/upl.php' not found or unable to stat
[Sun Jul 02 02:02:46.637370 2023] [php:error] [pid 60770] [client 68.***.***.229:48004] script '/var/www/html/1.php' not found or unable to stat
[Sun Jul 02 06:37:18.629107 2023] [mpm_prefork:notice] [pid 51410] AH00171: Graceful restart requested, doing restart
[Sun Jul 02 06:37:18.730879 2023] [mpm_prefork:notice] [pid 51410] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jul 02 06:37:18.730895 2023] [core:notice] [pid 51410] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 02 06:37:23.991032 2023] [mpm_prefork:notice] [pid 51410] AH00171: Graceful restart requested, doing restart
[Sun Jul 02 06:37:24.083945 2023] [mpm_prefork:notice] [pid 51410] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations
[Sun Jul 02 06:37:24.083966 2023] [core:notice] [pid 51410] AH00094: Command line: '/usr/sbin/apache2'
[Sun Jul 02 07:53:54.385084 2023] [php:error] [pid 82859] [client 164.***.***.79:56858] script '/var/www/html/upl.php' not found or unable to stat
[Sun Jul 02 07:53:54.693923 2023] [php:error] [pid 82858] [client 164.***.***.79:56898] script '/var/www/html/1.php' not found or unable to stat
Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.
Error PHP Optional parameter $trustedServers declared before required parameter $groupManager is implicitly treated as a required parameter at /var/www/nextcloud/apps/dav/lib/CardDAV/SystemAddressbook.php#60
2023-07-02T13:14:33+0200
Error PHP include(): Failed opening '/var/www/nextcloud/apps/unsplash/templates/partials/license.php' for inclusion (include_path='/var/www/nextcloud/3rdparty/pear/archive_tar:/var/www/nextcloud/3rdparty/pear/console_getopt:/var/www/nextcloud/3rdparty/pear/pear-core-minimal/src:/var/www/nextcloud/3rdparty/pear/pear_exception:/var/www/nextcloud/apps') at /var/www/nextcloud/lib/private/Template/Base.php#180
2023-07-02T11:10:42+0200
Error PHP include(/var/www/nextcloud/apps/unsplash/templates/partials/license.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Template/Base.php#180
2023-07-02T11:10:42+0200
Error PHP Optional parameter $trustedServers declared before required parameter $groupManager is implicitly treated as a required parameter at /var/www/nextcloud/apps/dav/lib/CardDAV/SystemAddressbook.php#60
2023-07-01T21:27:09+0200
Thank you