[SOLVED] Update form 18.0.1 to 18.0.3 failed

Dear Community,

so far my Nextcloud instance has been working properly. Today I wanted to update it from 18.0.1 to 18.0.3. All steps except the last one worked fine. In the last step I got the following error:

Repair info: Change collation for oc_addressbooks ...

Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'ALTER TABLE `oc_addressbooks` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Where is the problem and how can i affect it?
Thank you very much Nicko

[/details]

Nextcloud version : 18.0.1
Operating system and version : Ubuntu 18.04.4 LTS (GNU/Linux 4.15.0 x86_64
Webserver : Apache/2.4.29
PHP version : PHP 7.2.24-0ubuntu0.18.04.3

The issue you are facing:

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

The output of your config.php file:

<?php
$CONFIG = array (
  'instanceid' => '#hidden',
  'passwordsalt' => '#hidden',
  'secret' => '#hidden',
  'trusted_domains' => 
  array (
    0 => '#hidden',
    1 => '#hidden',
  ),
  'datadirectory' => '/var/www/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '18.0.1.3',
  'overwrite.cli.url' => 'https://#hidden',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextclouduser',
  'dbpassword' => '#hidden',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'htaccess.RewriteBase' => '/',
  'lost_password_link' => 'disabled',
  'maintenance' => false,
  'mysql.utf8mb4' => true,
  'app_install_overwrite' => 
  array (
    0 => 'documents',
  ),
  'has_rebuilt_cache' => true,
  'updater.secret' => '#hidden',
  'theme' => '',
  'loglevel' => 2,
);

The output of your Apache error log:

[Fri Mar 27 10:02:57.220123 2020] [access_compat:error] [pid 3130] [client 91.207.172.86:48808] AH01797: client denied by server configuration: /var/www/nextcloud/config

When running 18.0.1 did it pass the security check?
The “utf8mb4” reference most likely meant mySQL 4-byte support that would be mentioned in the security section if not enabled…

Exactly this was my problem.
I tried to solve it with the original nextcloud guide https://docs.nextcloud.com/server/18/admin_manual/configuration_database/mysql_4byte_support.html and everything worked fine, exept this:

sudo -u www-data php occ maintenance:repair
I got the following error and did not know how to fix it.

So I looked as you said at the Nextcloud Security check which said: All checks passed!. So I ignored the error message and went on with further configurations.But now I see that the mistake has massive consequences.

Did you try this?

1 Like

@anon71540698 this was the solution.
Thanks a lot !!!