27.01 RC2 occ db:add-missing-indices fault

Recently updated to php8 and up to 27.01R2 and Nextcloud has been working fine and still does.

When checking overview it tells me that some db-indices need updating - no problem have done this many times before, but this time I get an error:

root@cloud:/var/www/html/nextcloud# sudo -u www-data php occ db:add-missing-indices
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:140

There’s a long stack trace thereafter. Any ideas how to remedy this problem, it originally started to happen with the RC1 update but I thought it may be a bug.

Did you check on GitHub if there is already an issue for it?

I mean that’s what beta versions and RC versions are for, to test and report bugs to the developers before the official release.

Spoiler Alert: I’m also gettiing this warning on my test system (RC1), and I executed occ db:add-missing-indices multiple times, but the warning didn’t go away. However, I had neither the time nor the motivation to look into it any further. :wink:

This should have been fixed with RC2

1 Like

I have done the update to 27.01RC2 on multiple systems with different databases and everything went smooth, without issues.

That does mean, that your occ does not get a connecrion to your database.

Could it be, that you have a version mish mash in your php? Do you realy only have one php-version installed and is CLI the same as apache / fpm?

Look what php packages are installed on your system:

dpkg -l | awk '/^ii.*php/ {print $2}'

Look what php is used by your occ:

php -v

Look what php Version is used by your apache2:

apachectl -tD DUMP_INCLUDES | sed -n '/php.*conf/ s#.*/\([^/]*\)\.conf#\1#p'

Does Apache have a unique version or more available?
Does everything match?

Much luck

1 Like

Yep, it is. Just upgraded my test instance to RC2, execuded occ db:add-missing-indices, and the warning went away. :slight_smile:

Thankyou ernolf, you were correct, I did have an mis-mash of php 8.1 and 8.2, your kind instructions made me see this and i was able to correct it.

db-indices have updated and all is good.

1 Like

Well, when I saw the issue in RC1 I thought bug, everything still worked so no biggy but after RC2 I thought it might be more.