Core: can't update Or install ownCloud in version 10.0.1

Created on 25 May 2017  Â·  23Comments  Â·  Source: owncloud/core

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
Bug p1-urgent sev2-high

Most helpful comment

@jerryjharrison just edit the file core/Migrations/Version20170516100103.php and on line 52 replace the value "256" with "255".

All 23 comments

1071 Specified key was too long; max key length is 767 bytes

@DeepDiver1975

also cc @tomneedham @butonic as I remember a discussion about index size for this particular table

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 😞

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?

@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.

Applying this patch to the 10.0.1 codebase before upgrading will make the upgrade run smoothly:

--- a/core/Migrations/Version20170516100103.php
+++ b/core/Migrations/Version20170516100103.php
@@ -50,7 +50,7 @@ public function changeSchema(Schema $schema, array $options) {

            $table->addColumn('term', Type::STRING, [
                'notnull' => true,
-               'length' => 256
+               'length' => 255
            ]);

            $table->setPrimaryKey(['id']);

Not familiar with this process. Could you provide some guidance on steps required?


From: Tom Needham notifications@github.com
Sent: Tuesday, May 30, 2017 4:16 AM
To: owncloud/core
Cc: Jerry Harrison; Comment
Subject: Re: [owncloud/core] can't update Or install ownCloud in version 10.0.1 (#28007)

Applying this patch to the 10.0.1 codebase before upgrading will make the upgrade run smoothly:

--- a/core/Migrations/Version20170516100103.php
+++ b/core/Migrations/Version20170516100103.php
@@ -50,7 +50,7 @@ public function changeSchema(Schema $schema, array $options) {

                    $table->addColumn('term', Type::STRING, [
                            'notnull' => true,

- 'length' => 256
+ 'length' => 255
]);

                    $table->setPrimaryKey(['id']);

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/owncloud/core/issues/28007#issuecomment-304807323, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXclsw4w_UlgGN9dtctQszkiHvDHHDPzks5r-9BWgaJpZM4NmJ9q.

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 ?

@jerryjharrison just edit the file core/Migrations/Version20170516100103.php and on line 52 replace the value "256" with "255".

please all post your Mysql/mariadb version number and config if possible...

For me it is:
mysql56-server-5.6.36 Multithreaded SQL database (server)

I am happy to provide you any configuration information you want, but it was a clean install using pkg. The only thing I did after install was to run mysql_secure_installation, and then install owncloud. Nothing other than owncloud is installed on this computer.

From: Vincent Petry notifications@github.com
Reply-To: owncloud/core reply@reply.github.com
Date: Thursday, June 1, 2017 at 5:43 AM
To: owncloud/core core@noreply.github.com
Cc: Jerry Harrison jerryjharrison@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [owncloud/core] can't update Or install ownCloud in version 10.0.1 (#28007)

please all post your Mysql/mariadb version number and config if possible...

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/owncloud/core/issues/28007#issuecomment-305444060, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXclsyG-N3wgOyPA-Zs8cxx8yT_Ymmdqks5r_ofPgaJpZM4NmJ9q.

Sorry, but I am a bit of a noob around github, and downloading the code. I have always installed from pkg.

I realize it may be too basic for this thread, but would love to learn how to get and install from github.

(edit by @tomneedham, removed quoted email)

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 ?

guessing we dont have mysql strict mode enabled on our CI tests => we should turn it on

I just tried the upgrade to 10.0.2, and it failed due to database schema issues again…

Is anybody testing this before it is published?

From: Tom Needham notifications@github.com
Reply-To: owncloud/core reply@reply.github.com
Date: Tuesday, June 13, 2017 at 9:14 AM
To: owncloud/core core@noreply.github.com
Cc: Jerry Harrison jerryjharrison@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [owncloud/core] can't update Or install ownCloud in version 10.0.1 (#28007)

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 ?

guessing we dont have mysql strict mode enabled on our CI tests => we should turn it on

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/owncloud/core/issues/28007#issuecomment-308111390, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXcls-8f88OdNi2R6437lI_N08UxYx3Nks5sDotDgaJpZM4NmJ9q.

@jerryjharrison We have two fixes already implemented for this issue: https://github.com/owncloud/core/pull/28019, https://github.com/owncloud/core/pull/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.

Will close this issue once the PR is merged in.

Is anybody testing this before it is published?

@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

I do my best on the testing, and regularly contribute when I can. I have reviewed all of the comments on the two open tickets, and cannot find any instructions/guidance on how to turn off strict mode on sql. Additionally, I had requested additional help and would love to learn how to install from the tarball/github but my experience so far is limited to installing from portsnap or pkg…

From: Tom Needham notifications@github.com
Reply-To: owncloud/core reply@reply.github.com
Date: Tuesday, June 13, 2017 at 9:37 AM
To: owncloud/core core@noreply.github.com
Cc: Jerry Harrison jerryjharrison@hotmail.com, Mention mention@noreply.github.com
Subject: Re: [owncloud/core] can't update Or install ownCloud in version 10.0.1 (#28007)

Is anybody testing this before it is published?

@jerryjharrisonhttps://github.com/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

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/owncloud/core/issues/28007#issuecomment-308118339, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AXcls2NRPQrhIsO_IAhEFA56ts_RuqlCks5sDpCWgaJpZM4NmJ9q.

waiting for the last backport before closing: https://github.com/owncloud/core/pull/28576

PRs were merged. Fixes will be in 10.0.3

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

ownCloud is not installed - only a limited number of commands are available
Error while trying to create admin user: An exception occurred while executing 'CREATE TABLE `oc_mimetypes` (`id` INT AUTO_INCREMENT NOT NULL, `mimetype` VARCHAR(255) DEFAULT '' NOT NULL, UNIQUE INDEX mimetype_id_index (`mimetype`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin ENGINE = InnoDB ROW_FORMAT = compressed':

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.

Was this page helpful?
0 / 5 - 0 ratings