Skip to content

can't update Or install ownCloud in version 10.0.1 #28007

Description

@jonesmith

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

  1. PVince81 commented on May 26, 2017

    @PVince81
    Contributor

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

    @DeepDiver1975

  2. added this to the 10.0.3 milestone on May 26, 2017
  3. PVince81 commented on May 26, 2017

    @PVince81
    Contributor

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

  4. tomneedham commented on May 26, 2017

    @tomneedham
    Contributor

    This is the column and related index

    $table->addColumn('term', Type::STRING, [
    'notnull' => true,
    'length' => 256
    ]);
    $table->setPrimaryKey(['id']);
    $table->addIndex(['account_id'], 'account_id_index');
    $table->addIndex(['term'], 'term_index');

  5. tomneedham commented on May 26, 2017

    @tomneedham
    Contributor

    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 😞

  6. jerryjharrison commented on May 29, 2017

    @jerryjharrison

    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?

  7. PVince81 commented on May 29, 2017

    @PVince81
    Contributor

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

  8. tomneedham commented on May 30, 2017

    @tomneedham
    Contributor

    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']);
    
  9. jerryjharrison commented on May 30, 2017

    @jerryjharrison
  10. PVince81 commented on Jun 1, 2017

    @PVince81
    Contributor

    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 ?

  11. PVince81 commented on Jun 1, 2017

    @PVince81
    Contributor

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

  12. PVince81 commented on Jun 1, 2017

    @PVince81
    Contributor

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

  13. jerryjharrison commented on Jun 1, 2017

    @jerryjharrison
  14. jerryjharrison commented on Jun 1, 2017

    @jerryjharrison
  15. tomneedham commented on Jun 13, 2017

    @tomneedham
    Contributor

    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

  16. jerryjharrison commented on Jun 13, 2017

    @jerryjharrison
  17. tomneedham commented on Jun 13, 2017

    @tomneedham
    Contributor

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

  18. tomneedham commented on Jun 13, 2017

    @tomneedham
    Contributor

    Will close this issue once the PR is merged in.

  19. tomneedham commented on Jun 13, 2017

    @tomneedham
    Contributor

    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

  20. jerryjharrison commented on Jun 13, 2017

    @jerryjharrison
  21. added
    p1-urgentCritical issue, need to consider hotfix with just that issue
    on Jul 3, 2017
  22. PVince81 commented on Aug 7, 2017

    @PVince81
    Contributor

    waiting for the last backport before closing: #28576

  23. PVince81 commented on Aug 8, 2017

    @PVince81
    Contributor

    PRs were merged. Fixes will be in 10.0.3

  24. sleroy commented on Nov 29, 2017

    @sleroy

    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':
    
    
  25. lock commented on Aug 2, 2019

    @lock

    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.

  26. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type:Bugp1-urgentCritical issue, need to consider hotfix with just that issuesev2-high

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions