Repository navigation
Closed
Description
Actual behaviour
Tell us what happens instead
I recently got to know owncloud, when i install owncloud 10.0.0. ,it is wonderful work.but when i update to owncloud 10.0.1 ,i get a error "Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_account_terms (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, account_id BIGINT UNSIGNED NOT NULL, term VARCHAR(256) NOT NULL, INDEX account_id_index (account_id), INDEX term_index (term), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes"
i know the error code is ' term varchar(256)',but i can't update the owncloud code. so ~
and then i reinstall in owncloud 10.0.1 ,it happen again.the same error.
Server configuration
Operating system:
ubuntu
Web server:
apache
Database:
mysql 5.6
PHP version:
PHP Version 5.6.30-0+deb8u1
ownCloud version: (see ownCloud admin page)
10.0.1
Updated from an older ownCloud or fresh install:
install | same as update from 10.0.0
Logs
Web server error
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_account_terms (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, account_id BIGINT UNSIGNED NOT NULL, term VARCHAR(256) NOT NULL, INDEX account_id_index (account_id), INDEX term_index (term), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
error log
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_account_terms (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, account_id BIGINT UNSIGNED NOT NULL, term VARCHAR(256) NOT NULL, INDEX account_id_index (account_id), INDEX term_index (term), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
Activity
PVince81 commentedon May 26, 2017
@DeepDiver1975
PVince81 commentedon May 26, 2017
also cc @tomneedham @butonic as I remember a discussion about index size for this particular table
tomneedham commentedon May 26, 2017
This is the column and related index
core/core/Migrations/Version20170516100103.php
Lines 51 to 58 in f4b1dc1
tomneedham commentedon May 26, 2017
according to https://dev.mysql.com/doc/refman/5.7/en/innodb-restrictions.html we can only go up to 255 chars, and we're trying 256 😞
jerryjharrison commentedon May 29, 2017
Any update on the correction to this? I am a long time Owncloud user, but this is completely blocking the upgrade path. I typically use pkg to update, so I unless someone has a manual correction, I suppose I have to wait for the next version release to migrate through pkg before upgrading?
PVince81 commentedon May 29, 2017
@tomneedham a quickfix in the form of manually executable SQL statements would be nice.
Basically you need to make the column "term" 255 characters instead of 256.
tomneedham commentedon May 30, 2017
Applying this patch to the 10.0.1 codebase before upgrading will make the upgrade run smoothly:
jerryjharrison commentedon May 30, 2017
PVince81 commentedon Jun 1, 2017
I'm still wondering why we didn't find this in local and automated tests. Is this a different version of Mysql / MariaDB or does it have different settings ?
PVince81 commentedon Jun 1, 2017
@jerryjharrison just edit the file core/Migrations/Version20170516100103.php and on line 52 replace the value "256" with "255".
PVince81 commentedon Jun 1, 2017
please all post your Mysql/mariadb version number and config if possible...
jerryjharrison commentedon Jun 1, 2017
jerryjharrison commentedon Jun 1, 2017
tomneedham commentedon Jun 13, 2017
guessing we dont have mysql strict mode enabled on our CI tests => we should turn it on
jerryjharrison commentedon Jun 13, 2017
tomneedham commentedon Jun 13, 2017
@jerryjharrison We have two fixes already implemented for this issue: #28019, #28086
As previously mentioned, please disable strict mode if you wish to upgrade to 10.0.2, or wait for 10.0.3 with these fixes.
tomneedham commentedon Jun 13, 2017
Will close this issue once the PR is merged in.
tomneedham commentedon Jun 13, 2017
@jerryjharrison We're an open source project, everyone is here to help, code, test. Please help out by testing the PRs mentioned above and report back with feedback - this is how we advance the project together
jerryjharrison commentedon Jun 13, 2017
PVince81 commentedon Aug 7, 2017
waiting for the last backport before closing: #28576
PVince81 commentedon Aug 8, 2017
PRs were merged. Fixes will be in 10.0.3
sleroy commentedon Nov 29, 2017
I encountered a similar issue using the Docker version of owncloud and deploying it in GCE :
The versions I have been using :
owncloud/server : latest
dockhippie/mariadb: latest
dockhippie//redis : latest
lock commentedon Aug 2, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.