Skip to content

Owncloud 8.2.2 manual upgrade to version 9.0.0 fails #22968

Closed

Description

@samuelstein

Steps to reproduce

  1. Owncloud 8.2.2 with addressbook needs to be installed
  2. Manual upgrade installation to 9.0.0 (See: https://doc.owncloud.org/server/9.0/admin_manual/maintenance/manual_upgrade.html)
  3. Open index.php

Expected behaviour

Owncloud and apps should be upgraded

Actual behaviour

owncloud.log shows following error:

{
  "reqId": "wQzVLIALlhFjT6ci8uiC",
  "remoteAddr": "10.30.7.137",
  "app": "core",
  "message": "Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\DriverException\",\"Message\":\"An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VARCHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NULL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (`principaluri`, `uri`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\\n\\nSQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes\",\"Code\":0,\"Trace\":\"#0 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/DBALException.php(116): Doctrine\\\\DBAL\\\\Driver\\\\AbstractMySQLDriver->convertException('An exception oc...', Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException))\\n#1 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Connection.php(945): Doctrine\\\\DBAL\\\\DBALException::driverExceptionDuringQuery(Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOMySql\\\\Driver), Object(Doctrine\\\\DBAL\\\\Driver\\\\PDOException), 'CREATE TABLE `o...')\\n#2 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/db\\/mdb2schemamanager.php(167): Doctrine\\\\DBAL\\\\Connection->query('CREATE TABLE `o...')\\n#3 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/db\\/mdb2schemamanager.php(70): OC\\\\DB\\\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\\\DBAL\\\\Schema\\\\Schema))\\n#4 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/db.php(172): OC\\\\DB\\\\MDB2SchemaManager->createDbFromStructure('\\/is\\/htdocs\\/wp10...')\\n#5 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/installer.php(567): OC_DB::createDbFromStructure('\\/is\\/htdocs\\/wp10...')\\n#6 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/installer.php(546): OC_Installer::installShippedApp('dav')\\n#7 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/updater.php(336): OC_Installer::installShippedApps()\\n#8 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/lib\\/private\\/updater.php(215): OC\\\\Updater->doUpgrade('9.0.0.19', '8.2.2.2')\\n#9 \\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/core\\/ajax\\/update.php(120): OC\\\\Updater->upgrade()\\n#10 {main}\",\"File\":\"\\/is\\/htdocs\\/wp10838123_LGOL2QNNTD\\/www\\/samuelstein.de\\/owncloud\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractMySQLDriver.php\",\"Line\":115}",
  "level": 3,
  "time": "2016-03-08T20:07:11+00:00",
  "method": "GET",
  "url": "/core/ajax/update.php?requesttoken=WRxtLlhgIlocD3IGPCssBj0sXBgyNhgkUSQrXz0c%3Ak%2F%2BM75thUXA1tOtseI0BTYBEfgj6ZjBRLS9nXn8d"
}

Server configuration

Operating system: shared space at hosteurope

Web server: apache

Database: mysql

PHP version: latest 5

Login as admin user into your ownCloud and access
http://example.com/index.php/settings/integrity/failed
paste the results here:

`ownCloud wird auf Version 9.0.0 aktualisiert. Das könnte eine Weile dauern.

Update vorbereiten
Log-Level auf "debug" gesetzt
Wartungsmodus eingeschaltet 
Prüft, ob das Datenbankschema aktualisiert werden kann (dies kann je nach Datenbankgröße sehr lange dauern)
Datenbankschema-Aktualisierung überprüft
Es wird nach Updates für die Apps gesucht
Datenbankschema-Aktualisierung für Apps überprüft
Das Datenbankschema wird aktualisiert
Datenbank aktualisiert
Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VARCHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NULL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (`principaluri`, `uri`), 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 1000 bytes`

List of activated apps:

Are you using external storage: no

Are you using encryption: no

Are you using an external user-backend: no

Client configuration

Browser: 48.0.2564.116 m (64-bit)

Operating system: windows 7

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log: 'https://ssl.webpack.de/cloud.samuelstein.de/core/js/oc.js?v=d78eff885055a5dff1258825d52763d5 Failed to load resource: the server responded with a status of 500 (Internal Server Error)'

Activity

  1. added this to the milestone on Mar 8, 2016
  2. LukasReschke commented on Mar 8, 2016

    @LukasReschke
    Contributor

    Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

    @DeepDiver1975

  3. Bernd1978 commented on Mar 8, 2016

    @Bernd1978

    Disable "#RewriteRule .* index.php [PT,E=PATH_INFO:$1]" in .htaccess helps nothing to me :-(

    Still got the same error:

    Doctrine\DBAL\Exception\DriverException: An exception occurred while executing 'CREATE TABLE oc_addressbooks (id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, principaluri VARCHAR(255) DEFAULT NULL, displayname VARCHAR(255) DEFAULT NULL, uri VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, synctoken INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (principaluri, uri), 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 1000 bytes

    All hints welcome, because I don't want to reinstall owncloud.

  4. nickvergessen commented on Mar 9, 2016

    @nickvergessen
    Contributor

    Text field without a set length are always heros on keys.

    @PVince81 should have a QA task to test install/enable of all apps on innodb

  5. samuelstein commented on Mar 9, 2016

    @samuelstein
    Author

    @nickvergessen if i delete the lines then i get this error:

    Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VARCHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NULL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists ```
    
  6. nickvergessen commented on Mar 9, 2016

    @nickvergessen
    Contributor

    Yeah before attempting a second update, you need to wipe your database and restore a backup.

  7. PVince81 commented on Mar 9, 2016

    @PVince81
    Contributor

    @nickvergessen can you make a ticket in owncloud/QA with the details ?

  8. nickvergessen commented on Mar 9, 2016

    @nickvergessen
    Contributor
  9. DeepDiver1975 commented on Mar 9, 2016

    @DeepDiver1975
    Contributor

    Text field without a set length are always heros on keys.

    🐼 why is there no length? 😱

  10. self-assigned this
    on Mar 9, 2016
  11. 9 remaining items

  12. samuelstein commented on Mar 14, 2016

    @samuelstein
    Author

    the problem is that i only have a shared webspace where i don't have root access.
    my other idea was removing the problematic too long indices (principaluri) but then i got 500 error and in the logfile lots of migration errors because of missing indices.
    for now i restore latest owncloud 8 release.
    sad that the update is always such a horror.

  13. owncube commented on Mar 16, 2016

    @owncube

    Hello people.
    @Autrui @Eridania : about your "RewriteRule" issue. Its not related to ownCloud. Its webserver/php issue. We had the 500errors on many testsystems. You are right that remove this "#RewriteRule .* index.php [PT,E=PATH_INFO:$1]" from the htaccess will fix it BUT. the code integrity check will fail because of wrong hash as you wrote. We have updated php+apache+mysql,.. to the latest stable version and no 500 error anymore on systems where we recieved it before. The error is that the RewriteRule does "too many" redirects and so apache/nginx deny this.
    If you are on shared hosting you can contact the provider to get this fixed.

    Topic "1071 Specified key was too long; max key length is 1000 bytes"
    we got this fixed by upgrade to latest mysql version. Tested on ~ 1200 clouds from 8.x --> 9
    Maybe this helps someone.

    Regards
    OwnCube

  14. PVince81 commented on Mar 24, 2016

    @PVince81
    Contributor

    @LukasReschke #22968 (comment)

    maybe .htaccess was created too early, before the "overwrite" values in the config.php could be read/used/set ?

  15. owncube commented on Mar 24, 2016

    @owncube

    Hello @Autrui
    From our view its not related to the htaccess, we use already a few thousand of clouds with V9 and no issue since we use newest php,apache and mysql version.
    We tested to get back to an older version of web,php,.. and then the internal error was there again.
    Updated again to stable versions and no internal error anymore
    its not related to the htaccess from our view and our experience with a few thousand updates we have done in the last weeks.
    of course you can edit the htaccess to get this fixed too, but thats not needed if apache,php is up2date and configured correct.
    I also dont see any entry with "/owncloud" in the owncloud V9 package available here: https://download.owncloud.org/community/owncloud-9.0.0.zip
    But i see you used the webinstaller php file. We dont use it so maybe there its the issue.
    A "real" update via latest stable package does not cause any issues from our view and no /owncloud/ path in the htaccess.
    Regards

  16. DeepDiver1975 commented on Apr 6, 2016

    @DeepDiver1975
    Contributor

    the column length issue is fixed from my pov with #23508 - for any other remaining issues - please open a new issue - THX

  17. modified the milestones: , on Apr 6, 2016
  18. Messa1 commented on May 25, 2017

    @Messa1

    @samuelstein - I got the same problem with oc_addressbooks table Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes. So i try everything that i found to fix that problem :) But no one works for me.

    So i did it this way.

    First make a full backup of your data and SQL!

    1. I have a lokal MAMP Server so i install OC 9.x.x and check the SQL.
    2. I open my other SQL were my active system has.
    3. I compare both SQL - and only export the missing one. (Cause the adjustments of the DB were done before / At the first try of the update)
    4. Import the missing one in my active SQL
    5. Set in config/config.php 'installed' => true, 'maintenance' => false,
    6. Check your System.

    At my system everything works fine. I have made a deep test. Also the Mac and Windows client works finde with the new system.

    Best Regards
    Matthias

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

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

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions