nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.64k stars 4.09k forks source link

SQL errror when updating to 13.0.5 #10449

Closed jekil closed 6 years ago

jekil commented 6 years ago

Steps to reproduce

  1. Install 13.0.4
  2. Upgrade to 13.0.5 via web updater

Expected behaviour

Successfull update

Actual behaviour

I got this error: Checked for update of app "workflowengine" in appstore 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

Server configuration

Operating system: latest ubuntu lts

Web server: apache2

Database: mariadb

PHP version: 7.2

Nextcloud version: 13.0.4

Updated from an older Nextcloud/ownCloud or fresh install: 13.0.4 was fresh

Where did you install Nextcloud from: zip file (not deb)

List of activated apps:

App list ``` - activity: 2.6.1 - admin_audit: 1.3.0 - calendar: 1.6.1 - checksum: 0.4.0 - comments: 1.3.0 - contacts: 2.1.5 - dav: 1.4.7 - encryption: 2.0.0 - federatedfilesharing: 1.3.1 - federation: 1.3.0 - files: 1.8.0 - files_external: 1.4.1 - files_frommail: 0.1.0 - files_pdfviewer: 1.2.1 - files_sharing: 1.5.0 - files_texteditor: 2.5.1 - files_trashbin: 1.3.0 - files_versions: 1.6.0 - files_videoplayer: 1.2.0 - firstrunwizard: 2.2.1 - gallery: 18.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.1.0 - metadata: 0.6.0 - nextcloud_announcements: 1.2.0 - notifications: 2.1.2 - oauth2: 1.1.1 - onlyoffice: 1.3.0 - password_policy: 1.3.0 - provisioning_api: 1.3.0 - serverinfo: 1.3.0 - sharebymail: 1.3.0 - survey_client: 1.1.0 - systemtags: 1.3.0 - theming: 1.4.5 - twofactor_backupcodes: 1.2.3 - twofactor_totp: 1.4.1 - updatenotification: 1.3.0 - workflowengine: 1.3.0 ```

Nextcloud configuration:

Config report ``` { "system": { "instanceid": "***REMOVED SENSITIVE VALUE***", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "xxxx.net" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "overwrite.cli.url": "https:\/\/xxxx.net", "dbtype": "mysql", "version": "13.0.4.0", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "mysql.utf8mb4": true, "maintenance": false, "memcache.local": "\\OC\\Memcache\\APCu", "memcache.locking": "\\OC\\Memcache\\APCu", "updater.secret": "***REMOVED SENSITIVE VALUE***", "theme": "", "loglevel": 2 } } ```

Are you using external storage, if yes which one: no

Are you using encryption: yes

Are you using an external user-backend, if yes which one: no

nextcloud-bot commented 6 years ago

GitMate.io thinks possibly related issues are https://github.com/nextcloud/server/pull/10350 (13.0.5), https://github.com/nextcloud/server/issues/8107 (Error on Update from 12.0.4 to 12.0.5), https://github.com/nextcloud/server/issues/7960 (Updating Nextcloud 12.0.5 to 13.0.0.rc2 fails on Postgres ), https://github.com/nextcloud/server/issues/10373 (Internal server error following update from 13.0.4 to 13.0.5), and https://github.com/nextcloud/server/issues/8208 (Error when upgrading spreed from NC 12.0.5 to 13.0.0. - shared hosting).

Snake883 commented 6 years ago

Did you follow "Enabling MySQL 4-byte support"? If you did, might it be the cause of the problem?

Snake883 commented 6 years ago

SOLUTION:

$ sudo mysql -u root -p
MariaDB [(none)]> use nextcloud;
MariaDB [nextcloud]> set global innodb_large_prefix=on;
MariaDB [nextcloud]> set global innodb_file_format=Barracuda;
$ sudo -u www-data php occ maintenance:repair
jekil commented 6 years ago

Yeah, I enabled MySQL 4-byte support. As far as I can see, some tables still were in utf8, dunno why, I enabled MySQL 4-byte support from the beginning. BTW your fix worked, thanks so much.