Skip to content

OC Upgrade from 8.2.2 - 9.0.0 Doctrine\DBAL\Exception\TableExistsException #23122

Closed

Description

@Farfetch42

Steps to reproduce

  1. Manual upgrade of owncloud from 8.2.2 - 9.0.0
  2. errors after running $ sudo -u www-data php occ upgrade
  3. Displays this:

Set log level to debug
Checking whether the database schema can be updated (this can take a long time depending on the database size)
Checked database schema update
Checking updates of apps
Checked database schema update for apps
Updating database schema
Updated database
Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE "oc_trusted_servers" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "url" VARCHAR(512) NOT NULL, "url_hash" VARCHAR(255) DEFAULT '' NOT NULL, "token" VARCHAR(128) DEFAULT NULL, "shared_secret" VARCHAR(256) DEFAULT NULL, "status" INTEGER DEFAULT 2 NOT NULL, "sync_token" VARCHAR(512) DEFAULT NULL)':

SQLSTATE[HY000]: General error: 1 table "oc_trusted_servers" already exists
Update failed
Maintenance mode is kept active
Reset log level

Expected behaviour

Upgrade successful

Actual behaviour

Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE "oc_trusted_servers" ("id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "url" VARCHAR(512) NOT NULL, "url_hash" VARCHAR(255) DEFAULT '' NOT NULL, "token" VARCHAR(128) DEFAULT NULL, "shared_secret" VARCHAR(256) DEFAULT NULL, "status" INTEGER DEFAULT 2 NOT NULL, "sync_token" VARCHAR(512) DEFAULT NULL)':

SQLSTATE[HY000]: General error: 1 table "oc_trusted_servers" already exists
Update failed

Server configuration

Operating system:
Ubuntu 14.04
Web server:
Apache 2.4.7
Database:
mysql Ver 14.14 Distrib 5.5.47, for debian-linux-gnu (x86_64) using readline 6.3
PHP version:
PHP 5.5.9-1ubuntu4.14
ownCloud version: (see ownCloud admin page)
9.0.0
Updated from an older ownCloud or fresh install:
Updated from 8.2.2

Where did you install ownCloud from:
/etc/apt/sources.list.d/owncloud.list
deb http://download.owncloud.org/download/repositories/stable/Ubuntu_14.04/ /

Signing status (ownCloud 9.0 and above):

List of activated apps:

Enabled:

  • activity: 2.2.1
  • dav: true
  • federatedfilesharing: 0.1.0
  • files: 1.4.4
  • files_pdfviewer: 0.8
  • files_sharing: 0.9.1
  • files_texteditor: 2.1
  • files_trashbin: 0.8.0
  • files_versions: 1.2.0
  • firstrunwizard: 1.1
  • gallery: 14.5.0
  • notifications: 0.2.3
  • provisioning_api: 0.4.1
  • systemtags: 0.2
  • templateeditor: 0.1
    Disabled:
  • comments
  • encryption
  • external
  • federation
  • files_external
  • files_videoplayer
  • updatenotification
  • user_external
  • user_ldap

The content of config/config.php:

"system": {
    "instanceid": "oc0kwyx4osig",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "192.168.1.71"
    ],
    "datadirectory": "\/var\/www\/owncloud\/data",
    "dbtype": "sqlite3",
    "version": "9.0.0.0",
    "logtimezone": "UTC",
    "installed": true,
    "memcache.local": "\\OC\\Memcache\\APCu",
    "mail_smtpmode": "smtp",
    "mail_smtpauth": 1,
    "loglevel": 0,
    "theme": "",
    "updatechecker": false,
    "maintenance": true
}

Are you using external storage, if yes which one: local/smb/sftp/...
No
Are you using encryption: yes/no
No
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
No

Any guidance would be most useful. Thanks.

Activity

  1. Farfetch42 commented on Mar 11, 2016

    @Farfetch42
    Author

    I fixed this by dropping the table from owncloud.db and rerunning the upgrade.

  2. gjelsas commented on Mar 11, 2016

    @gjelsas

    Hey there,

    got the same issue, though I am no database expert. May I ask how you drop that table? I#m using sqlite btw...

    Thanks!

  3. PVince81 commented on Mar 14, 2016

    @PVince81
    Contributor

    Possibly related to or duplicate of #22993

  4. PVince81 commented on Mar 14, 2016

    @PVince81
    Contributor

    For now I'll close as duplicate

  5. lock commented on Aug 5, 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions