Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB error while updating 16.0.3 to 16.0.4 #16783

Closed
CliffMitchell opened this issue Aug 18, 2019 · 4 comments
Closed

DB error while updating 16.0.3 to 16.0.4 #16783

CliffMitchell opened this issue Aug 18, 2019 · 4 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@CliffMitchell
Copy link

CliffMitchell commented Aug 18, 2019

Steps to reproduce

  1. Upgrade 16.0.3 to 16.0.4

Expected behaviour

Successful upgrade

Actual behaviour

DB error:
Update to 16.0.4

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

###Detailed logs below.
Configuration:
Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-54-generic x86_64)
MariaDB: Server version: 10.1.40-MariaDB-0ubuntu0.18.04.1 - Ubuntu 18.04
Apache/2.4.29 (Ubuntu)
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: PHP version: 7.2.21-1+ubuntu18.04.1+deb.sury.org+1

Detailed logs

Update to 16.0.4

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
Detailed logs

Preparing update

Set log level to debug

Turned on maintenance mode

Repair step: Repair MySQL collation

Repair info: Change row format for oc_addressbooks ...

Repair info: Change collation for oc_addressbooks ...

Repair info: Change row format for oc_authtoken ...

Repair info: Change collation for oc_authtoken ...

Repair info: Change row format for oc_calendarobjects ...

Repair info: Change collation for oc_calendarobjects ...

Repair info: Change row format for oc_calendars ...

Repair info: Change collation for oc_calendars ...

Repair info: Change row format for oc_calendarsubscriptions ...

Repair info: Change collation for oc_calendarsubscriptions ...

Repair info: Change row format for oc_dav_shares ...

Repair info: Change collation for oc_dav_shares ...

Repair info: Change row format for oc_login_flow_v2 ...

Repair info: Change collation for oc_login_flow_v2 ...

Repair info: Change row format for oc_migrations ...

Repair info: Change collation for oc_migrations ...

Repair info: Change row format for oc_mimetypes ...

Repair info: Change collation for oc_mimetypes ...

Repair info: Change row format for oc_systemtag_group ...

Repair info: Change collation for oc_systemtag_group ...

Repair info: Change row format for oc_trusted_servers ...

Repair info: Change collation for oc_trusted_servers ...

Repair step: Repair SQLite autoincrement

Repair step: Copy data from accounts table when migrating from ownCloud

Repair step: Drop account terms table when migrating from ownCloud

Updating database schema

Updated database

Checking for update of app "accessibility" in appstore

Checked for update of app "accessibility" in appstore

Checking for update of app "activity" in appstore

Checked for update of app "activity" in appstore

Checking for update of app "bruteforcesettings" in appstore

Checked for update of app "bruteforcesettings" in appstore

Checking for update of app "calendar" in appstore

Checked for update of app "calendar" in appstore

Checking for update of app "cloud_federation_api" in appstore

Checked for update of app "cloud_federation_api" in appstore

Checking for update of app "comments" in appstore

Checked for update of app "comments" in appstore

Checking for update of app "contacts" in appstore

Checked for update of app "contacts" in appstore

Checking for update of app "dav" in appstore

Checked for update of app "dav" in appstore

Checking for update of app "encryption" in appstore

Checked for update of app "encryption" in appstore

Checking for update of app "federatedfilesharing" in appstore

Checked for update of app "federatedfilesharing" in appstore

Checking for update of app "federation" in appstore

Checked for update of app "federation" in appstore

Checking for update of app "files" in appstore

Checked for update of app "files" in appstore

Checking for update of app "files_external" in appstore

Checked for update of app "files_external" in appstore

Checking for update of app "files_markdown" in appstore

Checked for update of app "files_markdown" in appstore

Checking for update of app "files_pdfviewer" in appstore

Checked for update of app "files_pdfviewer" in appstore

Checking for update of app "files_rightclick" in appstore

Checked for update of app "files_rightclick" in appstore

Checking for update of app "files_sharing" in appstore

Checked for update of app "files_sharing" in appstore

Checking for update of app "files_texteditor" in appstore

Checked for update of app "files_texteditor" in appstore

Checking for update of app "files_trashbin" in appstore

Checked for update of app "files_trashbin" in appstore

Checking for update of app "files_versions" in appstore

Checked for update of app "files_versions" in appstore

Checking for update of app "files_videoplayer" in appstore

Checked for update of app "files_videoplayer" in appstore

Checking for update of app "firstrunwizard" in appstore

Checked for update of app "firstrunwizard" in appstore

Checking for update of app "gallery" in appstore

Checked for update of app "gallery" in appstore

Checking for update of app "logreader" in appstore

Checked for update of app "logreader" in appstore

Checking for update of app "lookup_server_connector" in appstore

Checked for update of app "lookup_server_connector" in appstore

Checking for update of app "nextcloud_announcements" in appstore

Checked for update of app "nextcloud_announcements" in appstore

Checking for update of app "notes" in appstore

Checked for update of app "notes" in appstore

Checking for update of app "notifications" in appstore

Checked for update of app "notifications" in appstore

Checking for update of app "oauth2" in appstore

Checked for update of app "oauth2" in appstore

Checking for update of app "onlyoffice" in appstore

Checked for update of app "onlyoffice" in appstore

Checking for update of app "password_policy" in appstore

Checked for update of app "password_policy" in appstore

Checking for update of app "privacy" in appstore

Checked for update of app "privacy" in appstore

Checking for update of app "provisioning_api" in appstore

Checked for update of app "provisioning_api" in appstore

Checking for update of app "qownnotesapi" in appstore

Checked for update of app "qownnotesapi" in appstore

Checking for update of app "recommendations" in appstore

Checked for update of app "recommendations" in appstore

Checking for update of app "serverinfo" in appstore

Checked for update of app "serverinfo" in appstore

Checking for update of app "sharebymail" in appstore

Checked for update of app "sharebymail" in appstore

Checking for update of app "support" in appstore

Checked for update of app "support" in appstore

Checking for update of app "survey_client" in appstore

Checked for update of app "survey_client" in appstore

Checking for update of app "systemtags" in appstore

Checked for update of app "systemtags" in appstore

Checking for update of app "tasks" in appstore

Checked for update of app "tasks" in appstore

Checking for update of app "theming" in appstore

Checked for update of app "theming" in appstore

Checking for update of app "twofactor_backupcodes" in appstore

Checked for update of app "twofactor_backupcodes" in appstore

Checking for update of app "updatenotification" in appstore

Checked for update of app "updatenotification" in appstore

Checking for update of app "viewer" in appstore

Checked for update of app "viewer" in appstore

Checking for update of app "workflowengine" in appstore

Checked for update of app "workflowengine" in appstore

Repair step: Repair MySQL collation

Repair info: Change row format for oc_addressbooks ...

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

The update was unsuccessful. Please report this issue to the Nextcloud community.
Checked for update of app "provisioning_api" in appstore

Checking for update of app "qownnotesapi" in appstore

Checked for update of app "qownnotesapi" in appstore

Checking for update of app "recommendations" in appstore

Checked for update of app "recommendations" in appstore

Checking for update of app "serverinfo" in appstore

Checked for update of app "serverinfo" in appstore

Checking for update of app "sharebymail" in appstore

Checked for update of app "sharebymail" in appstore

Checking for update of app "support" in appstore

Checked for update of app "support" in appstore

Checking for update of app "survey_client" in appstore

Checked for update of app "survey_client" in appstore

Checking for update of app "systemtags" in appstore

Checked for update of app "systemtags" in appstore

Checking for update of app "tasks" in appstore

@CliffMitchell CliffMitchell added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 18, 2019
@kesselb
Copy link
Contributor

kesselb commented Aug 18, 2019

Thank you for reporting this issue 👍 Please check #15974 #15058 for more details.

@kesselb kesselb closed this as completed Aug 18, 2019
@CliffMitchell
Copy link
Author

#15974 does not fix my problem. I have root access to the server so have tried the various suggestions but still have the problem.

I have tried to repair the database as suggested but this fails (see below). My instance is not stuck in maintenance mode until I can figure this out!


root@ubuntu:/var/www/owncloud# sudo -u www-data php occ maintenance:repair
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

  • Repair MySQL collation
    • Change row format for oc_addressbooks ...
    • Change collation for oc_addressbooks ...

In AbstractMySQLDriver.php line 125:

An exception occurred while executing 'ALTER TABLE oc_addressbooks CONVER
T TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;':

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes

In PDOStatement.php line 143:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes

In PDOStatement.php line 141:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was t
oo long; max key length is 767 bytes

maintenance:repair [--include-expensive]

root@ubuntu:/var/www/owncloud#

@kesselb
Copy link
Contributor

kesselb commented Aug 18, 2019

There are two ways:

A) Configure your database server to support utf8mb4 (https://docs.nextcloud.com/server/16/admin_manual/configuration_database/mysql_4byte_support.html).

B) If the database server does not support utf8mb4 disable it by setting 'mysql.utf8mb4' => false in your config.php (emojis in filename, calendar events, etc. are not possible than).

@CliffMitchell
Copy link
Author

Thanks kesselb, disabling utf8mb4 in config.php solved the problem. Many thanks for your prompt support - it is REALLY appreciated :-)
Cliff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

2 participants