Ubuntu 21.04 to 21.10 Upgrade

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 22.1.1
Operating system and version (eg, Ubuntu 20.04): 20.10
Apache or nginx version (eg, Apache 2.4.25): Apache/2.4.48 (Ubuntu)
PHP version (eg, 7.4): PHP Version 8.0.8

The issue you are facing:
After dist upgrade from 21.04 to 21.10 I believe PHP what forced to PHP8 and I am getting Internal server errors with no real hints in the log files.
The cron job did show that the connection to mysql fails.
From shell I can connect using the user/password/dbname from the config file

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:87

Stack trace below

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

Steps to replicate it:

  1. let cron job run get error email
  2. any access via web just get ISE

Is there a list of php modules I need to run the nextcloud?
What mods does it depend on to talk to mysql?

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:87
Stack trace:
#0 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1486): OC\DB\Connection->connect()
#1 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php(1014): Doctrine\DBAL\Connection->getWrappedConnection()
#2 /var/www/nextcloud/lib/private/DB/Connection.php(231): Doctrine\DBAL\Connection->executeQuery()
#3 /var/www/nextcloud/3rdparty/doctrine/dbal/src/Query/QueryBuilder.php(210): OC\DB\Connection->executeQuery()
#4 /var/www/nextcloud/lib/private/DB/QueryBuilder/QueryBuilder.php(287): Doctrine\DBAL\Query\QueryBuilder->execute()
#5 /var/www/nextcloud/lib/private/AppConfig.php(344): OC\DB\QueryBuilder\QueryBuilder->execute()
#6 /var/www/nextcloud/lib/private/AppConfig.php(109): OC\AppConfig->loadConfigValues()
#7 /var/www/nextcloud/lib/private/AppConfig.php(300): OC\AppConfig->getApps()
#8 /var/www/nextcloud/lib/private/legacy/OC_App.php(961): OC\AppConfig->getValues()
#9 /var/www/nextcloud/lib/private/Server.php(685): OC_App::getAppVersions()
#10 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#11 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#12 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#13 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#14 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#15 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(182): OC\AppFramework\Utility\SimpleContainer->get()
#16 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#17 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(114): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#18 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#19 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#20 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#21 /var/www/nextcloud/lib/private/Server.php(1050): OC\AppFramework\Utility\SimpleContainer->get()
#22 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#23 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#24 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#25 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#26 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#27 /var/www/nextcloud/lib/private/Server.php(2010): OC\AppFramework\Utility\SimpleContainer->get()
#28 /var/www/nextcloud/lib/private/Files/View.php(118): OC\Server->getLockingProvider()
#29 /var/www/nextcloud/lib/private/Server.php(433): OC\Files\View->__construct()
#30 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(160): OC\Server->OC\{closure}()
#31 /var/www/nextcloud/3rdparty/pimple/pimple/src/Pimple/Container.php(118): OC\AppFramework\Utility\SimpleContainer->OC\AppFramework\Utility\{closure}()
#32 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(127): Pimple\Container->offsetGet()
#33 /var/www/nextcloud/lib/private/ServerContainer.php(136): OC\AppFramework\Utility\SimpleContainer->query()
#34 /var/www/nextcloud/lib/private/AppFramework/Utility/SimpleContainer.php(56): OC\ServerContainer->query()
#35 /var/www/nextcloud/lib/private/Server.php(1373): OC\AppFramework\Utility\SimpleContainer->get()
#36 /var/www/nextcloud/lib/base.php(594): OC\Server->boot()
#37 /var/www/nextcloud/lib/base.php(1083): OC::init()
#38 /var/www/nextcloud/cron.php(42): require_once('...')
#39 {main}

The output of your Nextcloud log in Admin > Logging:

Tried sudo -u www-data php occ log:file but also can't connect

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

$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xx',
  'secret' => 'xx',
  'trusted_domains' => 
  array (
    0 => 'rnode.xx.us:1111',
    1 => 'rnode.',
  ),
  'datadirectory' => '/home/nextcloud/data',
  'overwrite.cli.url' => 'https://home.:1111/nextcloud',
  'dbtype' => 'mysql',
  'version' => '22.1.1.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_user',
  'dbpassword' => 'password',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
  'data-fingerprint' => 'a7b9f22e8a46a54a391e854029145b7f',
  'mysql.utf8mb4' => true,
  'mail_from_address' => 'nextcloud',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'mail',
  'mail_smtphost' => 'net',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => 'user@hosr',
  'mail_smtppassword' => 'password',
);

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

Nov 12 06:05:01 rnode CRON[1286322]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Nov 12 06:05:01 rnode nullmailer-send[1228]: Trigger pulled.
Nov 12 06:05:01 rnode nullmailer-send[1228]: Rescanning queue.
Nov 12 06:05:01 rnode nullmailer-send[1228]: Starting delivery, 1 message(s) in queue.
Nov 12 06:05:01 rnode nullmailer-send[1228]: Starting delivery: host: xxxx protocol: smtp file: 1636715101.1286327
Nov 12 06:05:01 rnode nullmailer-send[1228]: From: <ts> to: <>
Nov 12 06:05:01 rnode nullmailer-send[1228]: Message-Id: <1636715101.608738.1286326.nullmailer@rhost>
Nov 12 06:05:02 rnode nullmailer-send[1286328]: smtp: Succeeded: 250 OK id=1mlUMg-0003Qb-Cs
Nov 12 06:05:02 rnode nullmailer-send[1228]: Sent file.
Nov 12 06:05:02 rnode nullmailer-send[1228]: Delivery complete, 0 message(s) remain.

Hi @w2vy

You mean a do-release-upgrade, and you had to force it because normaly an LTS release like 20.04 does not upgrade to intremediate releases like 21.10. :wink: Is there a specific reason why you wanted to upgrade to 20.10?

My suggestions to solve the issue:

  1. If you have recent backups, go back to 20.04!

  2. If that’s not an option, I would try to uninstall all PHP packages including all config files with apt purge php* and apt autoremove and then reinstall the packages and reconfigure it the same way as you did, when you first installed nextcloud.

1 Like

The upgrade was from 21.04 to 21.10

I guess your #2 is still a valid way

Ah sorry my bad.

But maybe you should consider using LTS releases on servers. Makes life easier :wink: Anyway, yes I think it’s a valid way…

In principle, you can install, uninstall, reconfigure, PHP completely independently of Nextcloud. The only important thing at the end of the day is that all the required modules which Nextcloud needs are installed and correctly configured.

I think that during the update to the new version, either not all configuration changes were taken over to the new version or not all the PHP modules were installed and / or activated. You could of course also try to find the actual problems and fix them. But if you have documented your installation and configuration process, it is probably easier to just reinstall PHP from scratch. I would use apt purge php* to remove the PHP packages, because with the purge option it will also remove all the config files, so you can start from a clean state.

It seems when Ubuntu upgraded from 21.04 to 21.10 and upgrading php from 7…4 to 8…0 it did not consider installing the php8.0 versions of any php modules that were running.

Updated them and the system came back.

Thanks!

1 Like