Repository navigation
Description
Steps to reproduce
- apt-get dist-upgrade successfully
- Start updater in webbrowser
- Update will abort with
Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLEoc_gallery_sharing(tokenVARCHAR(64) NOT NULL,gallery_idINT DEFAULT 0 NOT NULL,recursiveSMALLINT NOT NULL) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_gallery_sharing' already exists
Expected behaviour
Updater should run completely
Actual behaviour
The updater will stop with the error:
Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE oc_gallery_sharing (token VARCHAR(64) NOT NULL, gallery_id INT DEFAULT 0 NOT NULL, recursive SMALLINT NOT NULL) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_gallery_sharing' already exists
Server configuration
Operating system:
Ubuntu 14.04 LTS
Web server:
Server version: Apache/2.4.7 (Ubuntu)
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)
8.2.2
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:
When starting the upgrade, all apps are disabled.
After the failed update the system was set back to the existing snapshot.
The content of config/config.php:
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder
or
Insert your config.php content here
(Without the database password, passwordsalt and secret)
Are you using external storage, if yes which one: local/smb/sftp/...
Are you using encryption: yes/no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
LDAP configuration (delete this part if not used)
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder
Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';
Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.
Client configuration
Browser:
Operating system:
Logs
Web server error log
Insert your webserver log here
ownCloud log (data/owncloud.log)
Insert your ownCloud log here
Browser log
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
Activity
LukasReschke commentedon Mar 9, 2016
Seems also like #22968.
cc @nickvergessen
nickvergessen commentedon Mar 9, 2016
Please post the list of apps before the update.
HelFANS commentedon Mar 9, 2016
sudo -u www-data php occ app:list
Enabled:
Disabled:
but I have disabled all apps before the update.
sudo -u www-data php occ app:disable activity
sudo -u www-data php occ app:disable files
sudo -u www-data php occ app:disable files_mv
sudo -u www-data php occ app:disable files_pdfviewer
sudo -u www-data php occ app:disable files_sharing
sudo -u www-data php occ app:disable files_texteditor
sudo -u www-data php occ app:disable files_trashbin
sudo -u www-data php occ app:disable files_versions
sudo -u www-data php occ app:disable files_videoviewer
sudo -u www-data php occ app:disable firstrunwizard
sudo -u www-data php occ app:disable gallery
sudo -u www-data php occ app:disable ocusagecharts
sudo -u www-data php occ app:disable search_lucene
sudo -u www-data php occ app:disable templateeditor
joni1993 commentedon Mar 9, 2016
Another error that occurred while upgrading to 9.0.0 from 8.2.3.
Ubuntu 15.04
nginx
MariaDB
//Fixed: Removed an old copy of the calendar plugin in the apps directory which caused this problem. Interestingly that app wasn't even enabled but still tried to recreate its tables when updating oc. Shouldn't disabled apps don't do anything even when upgrading oc?
Mattoje commentedon Mar 9, 2016
the same goes also for postgresql
Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE "oc_activity" ("activity_id" SERIAL NOT NULL, "timestamp" INT DEFAULT 0 NOT NULL, "priority" INT DEFAULT 0 NOT NULL, "type" VARCHAR(255) DEFAULT NULL, "user" VARCHAR(64) DEFAULT NULL, "affecteduser" VARCHAR(64) NOT NULL, "app" VARCHAR(255) NOT NULL, "subject" VARCHAR(255) NOT NULL, "subjectparams" VARCHAR(4000) NOT NULL, "message" VARCHAR(255) DEFAULT NULL, "messageparams" VARCHAR(4000) DEFAULT NULL, "file" VARCHAR(4000) DEFAULT NULL, "link" VARCHAR(4000) DEFAULT NULL, "object_type" VARCHAR(255) DEFAULT NULL, "object_id" INT DEFAULT 0 NOT NULL, PRIMARY KEY("activity_id"))':
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "oc_activity" already exists
Update failed
vb0 commentedon Mar 9, 2016
Ubuntu 14.04.4 LTS, [edited] sqlite3
I'm getting:
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
Farfetch42 commentedon Mar 10, 2016
Sorry posted: #23122 - Then found this thread.
I'm also receiving this:
`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`
Ubuntu 14.04 - Apache 2.4.7 - MySQL 14.14 - PHP 5.5.9
nivoliev commentedon Mar 10, 2016
With some help, I finally got it working : after checking the differences between a backup of the database before the upgrade and its state when the error occured, the table is created by the update. After iteratively dropping the problematic tables in the database, and restarting the update, it finally ended successfully.
33 remaining items
vb0 commentedon Mar 17, 2016
I did not restore from a backup but I think I did upgrade twice from command line (well, I tried many times but I have done one before the table exists problem). I ignored the first run because it seemed to do nothing, unfortunately I really can't remember what happened there. Where should the log be for this upgrade?
nivoliev commentedon Mar 17, 2016
I can confirm in my case that the problem was due to an error in a previous upgrade attempt. The error message was that of #23013. Since the proposed solution was to restart the upgrade, that's what I did. I am using the basic sqlite as well, and the data directory containing the database is a symbolic link to a folder on another volume. This is probably the cause of the first upgrade failure. I believe the database was then left in a mixed state, and the second upgrade wasn't able to recover from this state. I believe that during the first upgrade attempt, the migration test passed, and then the real database migration failed because of the IO error.
PVince81 commentedon Mar 17, 2016
To check whether you ran the same upgrade several times, have a look at "owncloud.log", there should be entries that look like "Starting upgrade from version XXX to YYY" (something like this, not the exact text). You can check whether the version numbers in these messages are the same several times.
BernieO commentedon Mar 17, 2016
To me it happened with the first upgrade attempt. Excerpt of my owncloud.log:
BernieO commentedon Mar 17, 2016
P.S.: I did upgrade 2 days before from 8.2.2 to 8.2.3 - maybe the table causing issues was created then?
murzz commentedon Mar 19, 2016
@PVince81 yes this error happens to me after I run
occ upgradesecond time. First time it failed withGeneral error: 10 disk I/O error. Then upgrade starts failing withGeneral error: 1 table "oc_notifications" already exists.Removing
oc_notificationstable from my sqlite database was not of help.After removing folder
apps/notificationsupgrade completed without errors.nickvergessen commentedon Mar 21, 2016
Well we can't help with the disk error. But as said already:
Before doing a second attempt of the update you need to drop your database and recreate it from a backup, to make sure that no new table/columns are there.
lock commentedon Aug 5, 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.