Driver exception on occ upgrade

Hi,

I just updated nextcloud from a previous nextcloud install using pacman but ran into an error when doing
upgrade nextcloud with /usr/bin/runuser -u http -- /usr/bin/php /usr/share/webapps/nextcloud/occ upgrade

This is the output of the command:
Nextcloud or one of the apps require upgrade - only a limited number of commands are available You may use your browser or the occ upgrade command to do the upgrade Setting log level to debug Updating database schema Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE oc_authtoken CHANGE `password_invalid` password_invalid TINYINT(1) DEFAULT '0'': SQLSTATE[HY000]: General error: 1005 Can't create table `nextcloud`.`oc_authtoken` (errno: 13 "Permission denied") Update failed Maintenance mode is kept active Resetting log level

Install Info:
Operating system: ArchlinuxARM 5.4.77-1-ARCH
Web server: Apache
Database: MariaDB
PHP version: 7.4.12
Nextcloud version: 20.0.2

Nextcloud configuration:
{
“system”: {
“instanceid”: “REMOVED SENSITIVE VALUE”,
“passwordsalt”: “REMOVED SENSITIVE VALUE”,
“secret”: “REMOVED SENSITIVE VALUE”,
“trusted_domains”: [
REMOVED SENSITIVE VALUE
],
“datadirectory”: “REMOVED SENSITIVE VALUE”,
“dbtype”: “mysql”,
“version”: “19.0.3.1”,
“overwrite.cli.url”: “https://REMOVED SENSITIVE VALUE/nextcloud”,
“dbname”: “REMOVED SENSITIVE VALUE”,
“dbhost”: “REMOVED SENSITIVE VALUE”,
“dbport”: “”,
“dbtableprefix”: “oc_”,
“mysql.utf8mb4”: true,
“dbuser”: “REMOVED SENSITIVE VALUE”,
“dbpassword”: “REMOVED SENSITIVE VALUE”,
“installed”: true,
“maintenance”: true,
“memcache.local”: “\OC\Memcache\APCu”,
“loglevel”: 2,
“mail_from_address”: “REMOVED SENSITIVE VALUE”,
“mail_smtpmode”: “smtp”,
“mail_sendmailmode”: “smtp”,
“mail_domain”: “REMOVED SENSITIVE VALUE”,
“mail_smtpauthtype”: “LOGIN”,
“mail_smtpauth”: 1,
“mail_smtphost”: “REMOVED SENSITIVE VALUE”,
“mail_smtpsecure”: “tls”,
“mail_smtpport”: “587”,
“mail_smtpname”: “REMOVED SENSITIVE VALUE”,
“mail_smtppassword”: “REMOVED SENSITIVE VALUE”,
“theme”: “”
}
}

I tried the […]occ maintenance:repair which ran without any errors but did not change anything.
The login credentials in the config.php work when I log into the database manually.

I hope you can help, thanks!

Hi cap_42,

try opening your config.php file under nextcloud and find any entry with

‘mysql.utf8mb4’ => true,

If so, change this to ‘mysql.utf8’ => true,

This helped me in the same error message you got.

Cheers,

Chris

Hi Chris,

thank you very much for your input.
Unfortunately it didn’t change anything on upgrade. The database was created as utf8mb4, so that shouldn’t have fixed it, but I gave it a shot anyway.

I’d really appreciate any further suggestions.
Would it make sense to reinstall nextcloud and then restore the database? I’d prefer not to do that, but if it’ll help, I’m open to anything…