Update from 8.2.2 to 9.0.0-1.1 failed - Doctrine\DBAL\Exception\TableExistsException Table 'oc_gallery_sharing' already exists #22993

Closed
HelFANS opened this Issue Mar 9, 2016 · 44 comments
@HelFANS
HelFANS commented Mar 9, 2016

Steps to reproduce

  1. apt-get dist-upgrade successfully
  2. Start updater in webbrowser
  3. Update will abort with
    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

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) ...
@LukasReschke
Member

Seems also like #22968.

cc @nickvergessen

@LukasReschke LukasReschke added this to the 9.0.1-current-maintenance milestone Mar 9, 2016
@nickvergessen
Contributor

Please post the list of apps before the update.

@HelFANS
HelFANS commented Mar 9, 2016

sudo -u www-data php occ app:list
Enabled:

  • activity: 2.1.3
  • files: 1.2.0
  • files_mv: 0.8.1a
  • files_pdfviewer: 0.7
  • files_sharing: 0.7.0
  • files_texteditor: 2.0
  • files_trashbin: 0.7.0
  • files_versions: 1.1.0
  • files_videoviewer: 0.1.3
  • firstrunwizard: 1.1
  • gallery: 14.2.0
  • ocusagecharts: 2
  • search_lucene: 0.6.0
  • templateeditor: 0.1

Disabled:

  • _calendar
  • _contacts
  • appframework
  • encryption
  • external
  • files_embeddedvideo
  • files_external
  • files_tree
  • fluxx_compensator
  • gallery-backup
  • mozilla_sync
  • notes
  • notifications
  • provisioning_api
  • user_external
  • user_ldap
  • videos

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
joni1993 commented Mar 9, 2016

Another error that occurred while upgrading to 9.0.0 from 8.2.3.

Doctrine\DBAL\Exception\TableExistsException: An exception occurred while executing 'CREATE TABLE `oc_clndr_objects` (`id` INT UNSIGNED AUTO_INCREMENT NOT NULL, `calendarid` INT UNSIGNED DEFAULT 0 NOT NULL, `objecttype` VARCHAR(40) DEFAULT '' NOT NULL, `startdate` DATETIME DEFAULT '1970-01-01 00:00:00', `enddate` DATETIME DEFAULT '1970-01-01 00:00:00', `repeating` INT DEFAULT 0, `summary` VARCHAR(255) DEFAULT NULL, `calendardata` LONGTEXT DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `lastmodified` INT DEFAULT 0, PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_clndr_objects' already exists

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?

@sardanap
sardanap commented 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
vb0 commented 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

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

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.

@vb0
vb0 commented Mar 11, 2016

I got it working too, would have earlier probably but got stumped by mysql config ... nothing looked right because I've been using sqlite3 (small install, one user, etc).
Just looked into oc_trusted_servers, it was empty, drop table oc_trusted_servers and that was it, upgrade worked from command line.

Maybe somebody can add the label db:sqlite3 or something to this if appropriate.

@feedthedogs

I had the same issue with oc_activity and oc_activity_mq in mysql, also fixed the error by verifying they were empty and dropping them.

My Apps being updated in the log:
Disabled incompatible app: bookmarks
Disabled 3rd-party app: bookmarks
Disabled incompatible app: calendar
Disabled 3rd-party app: calendar
Disabled incompatible app: contacts
Disabled 3rd-party app: contacts
Disabled 3rd-party app: files_videoviewer
Disabled incompatible app: notes
Disabled 3rd-party app: notes
Disabled 3rd-party app: updater
Updating <files_pdfviewer> ...
Updated <files_pdfviewer> to 0.8
Updating <files_texteditor> ...
Updated <files_texteditor> to 2.1
Updating ...
Updated to 14.5.0
Updating ...
Updated to 1.4.4
Updating <files_external> ...
Updated <files_external> to 0.5.2
Updating <files_sharing> ...
Updated <files_sharing> to 0.9.1
Updating <files_trashbin> ...
Updated <files_trashbin> to 0.8.0
Updating <files_versions> ...
Updated <files_versions> to 1.2.0
Update 3rd-party app: calendar
Update 3rd-party app: contacts
-- same SQL error as above about existing tables --

@BernieO
BernieO commented Mar 12, 2016

Hi,
I got the same error on occ upgrade:
Base table or view already exists: 1050 Table 'oc_activity' already exists
After deleting that table (was empty) and running the upgrade again I got:
Base table or view already exists: 1050 Table 'oc_activity_mq' already exists
Then after deleting the tables oc_activity AND oc_acitivity_mq (both were empty) the upgrade (8.2.3->9.0.0) ran through without errors.

@orefimi
orefimi commented Mar 13, 2016

I have some questions
1 - I have MAriaDB, is it the same?
2- inmary DB I hava a DB , name owncloud but it is empyt, where should I found the tables to be dropped?

Thanks!

@orefimi
orefimi commented Mar 13, 2016

I solved : I removed the app "notifications" and then it runs

@PVince81 PVince81 added sev2-high and removed needs info labels Mar 14, 2016
@PVince81
Collaborator

There's another report here with other tables: #23122

@jzdm
jzdm commented Mar 14, 2016

I get a similar error. The system is a FreeBSD 9.3 with latest PHP 5.6 and MySQL 5.6.
To upgrade i use portmaster owncloud, to upgrade from 8.2.2.2 to 9.0.0.
Even after disabling the "notifications" App i get an error. But for me it's the "oc_addressbooks" table which already exists and is not empty. So i can't drop this one.

@HelFANS
HelFANS commented Mar 15, 2016

I have deleted the empty table 'oc_gallery_sharing', then the update runs successfully.

@nickvergessen
Contributor

Well @jzdm the table is non-empty, when you successfully migrated your contacts app data to the new endpoint. However, as long as you don't delete the old contacts app table, you can do that again and again.

@PVince81
Collaborator

After discussing with @nickvergessen, from what I understood this problem happens because people have been importing their backup DB (SQL file) without first dropping the database. This would cause newly created tables to still exist.

@nickvergessen can we make OC detect and ignore existing tables at the time where new creates should be created as part of enabling apps ?

@PVince81
Collaborator

I don't think this bug qualifies as a regression, since this is how ownCloud always behaved. It just happens that this bug got uncovered now because of the many new tables that appeared in 9.0.

@nickvergessen
Contributor

No, as said yesterday. If the table exists an error is the only acceptable solution.
We don't know if the user has an app or something that already uses the table.
We would need to diff the structure, than we still have the problem when the schema changed. Should we change it, or is the table from a different app/system/... ?

@PVince81
Collaborator

Yes, indeed, this would be risky.

How about changing the error message and adding a hint like "If you restored from a backup, please make sure that you dropped the database in the first place" ?

@orefimi
orefimi commented Mar 15, 2016

In my case I removed manually the app and then it works but no body explained to me where to find the tables.

I have Mariadb and the owncloud database was empty

Where could I found and drop the 'notifications' table?

Michele Orefice

Il giorno 15 mar 2016, alle ore 10:40, Joas Schilling notifications@github.com ha scritto:

No, as said yesterday. If the table exists an error is the only acceptable solution.
We don't know if the user has an app or something that already uses the table.
We would need to diff the structure, than we still have the problem when the schema changed. Should we change it, or is the table from a different app/system/... ?

โ€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#22993 (comment)

@vb0
vb0 commented Mar 15, 2016

I don't know how common is restoring from backup for an upgrade. I sure didn't do a restore, just upgraded the packages via normal apt-get and then run the command-line upgrade.

@Stormblade

I also did an update via apt-get, and am getting this error when running occ upgrade.
I haven't restored or modified the databases.

@deepeshmittal

Hi, even I am facing issue the same issue:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_activity' already exists
Update failed

Like other I didn't perform any restore from DB, it just automatically went to maintenance mode, when from terminal I switched off maintenance mode then on browser it prompted me to start upgrade to 9.0.0. I am using ubuntu and MySql as DB.

Also 'oc_activity' is not an empty table for me ? Can you please suggest something ASAP. My owncloud is down. Can I rollback to 8.2.2, I don't want 9.0.0.

Please help !

Thanks,
Deepesh Mittal

@orefimi
orefimi commented Mar 15, 2016

I would remove the app, just move the folder in another place

Michele Orefice

Il giorno 15 mar 2016, alle ore 22:11, deepeshmittal notifications@github.com ha scritto:

Hi, even I am facing issue the same issue:

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_activity' already exists
Update failed

Like other I didn't perform any restore from DB, it just automatically went to maintenance mode, when from terminal I switched off maintenance mode then on browser it prompted me to start upgrade to 9.0.0. I am using ubuntu and MySql as DB.

Also 'oc_activity' is not an empty table for me ? Can you please suggest something ASAP. My owncloud is down. Can I rollback to 8.2.2, I don't want 9.0.0.

Please help !

Thanks,
Deepesh Mittal

โ€”
You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@deepeshmittal

Thanks Michele for your response.

I am bit confuse. You mean I should remove any particular app from owncloud which is in app:list or you mean whole OC removal ? Also which folder your are referring to ?

Till now I did setup once so don't know much about owncloud stuff.

@orefimi
orefimi commented Mar 15, 2016

I meant: I removed from the server folder, the app where I had the problem. Then it works.

@orefimi
orefimi commented Mar 15, 2016

I tried to disable the app but it was the same, I moved then the folder app away and it works

@deepeshmittal

Amazing !! it worked ...You are awesome, thanks mate, you saved my day!!

Last thing, Do I need to copy activity folder back ?

@PVince81
Collaborator

For those who didn't restore from backup, did you run the same upgrade twice ? Maybe you experienced a timeout and had to rerun the upgrade ? So far it is still not clear what would cause a table to be created twice.

@BernieO
BernieO commented Mar 16, 2016

I also didn't restore from a backup. The error-message came up on the first run of occ upgrade.

@PVince81
Collaborator

Did you guys run "occ upgrade" from the command line or in the web UI ?
Trying to find out what could have caused a "double upgrade" of some sorts.

@BernieO
BernieO commented Mar 16, 2016

I did run occ upgrade from the command-line after disabling 3rd party apps (also on the command-line with occ)

@Stormblade

Any clues how to fix this? Currently the server has been down since this attempted update.
Moving the app folder suggestion only works if you know which app is causing the problem. How do you tell?

@nickvergessen
Contributor

Can you post a backup of your oc_appconfig table from before the update attempt?

@BernieO
BernieO commented Mar 16, 2016

Here it is (sorry for bad formating...):

--
-- Table structure for table `oc_appconfig`
--

DROP TABLE IF EXISTS `oc_appconfig`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `oc_appconfig` (
  `appid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',
  `configkey` varchar(64) COLLATE utf8_bin NOT NULL DEFAULT '',
  `configvalue` longtext COLLATE utf8_bin,
  PRIMARY KEY (`appid`,`configkey`),
  KEY `appconfig_config_key_index` (`configkey`),
  KEY `appconfig_appid_key` (`appid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `oc_appconfig`
--

LOCK TABLES `oc_appconfig` WRITE;
/*!40000 ALTER TABLE `oc_appconfig` DISABLE KEYS */;
INSERT INTO `oc_appconfig` VALUES ('admin_migrate','enabled','no'),('admin_migrate','installed_version','0.1'),('admin_migrate','types',''),('backgroundjob','lastjob','8'),('calendar','enabled','yes'),('calendar','installed_version','0.8.2'),('calendar','ocsid','168707'),('calendar','types',''),('contacts','enabled','yes'),('contacts','installed_version','0.5.0.0'),('contacts','ocsid','168708'),('contacts','types',''),('core','backgroundjobs_mode','webcron'),('core','backgroundjobs_step','regular_tasks'),('core','backgroundjobs_task',''),('core','global_cache_gc_lastrun','1436330702'),('core','installedat','1381698536.0404'),('core','lastcron','1457761501'),('core','lastupdateResult','{\"version\":{},\"versionstring\":{},\"url\":{},\"web\":{}}'),('core','lastupdatedat','1457593192'),('core','public_caldav','calendar/share.php'),('core','public_calendar','calendar/share.php'),('core','public_files','files_sharing/public.php'),('core','public_gallery','gallery/sharing.php'),('core','public_webdav','files_sharing/publicwebdav.php'),('core','remote_ampache','media/remote.php'),('core','remote_caldav','calendar/appinfo/remote.php'),('core','remote_calendar','calendar/appinfo/remote.php'),('core','remote_carddav','contacts/appinfo/remote.php'),('core','remote_contacts','contacts/appinfo/remote.php'),('core','remote_contactthumbnail','contacts/thumbnail.php'),('core','remote_core.css','/core/minimizer.php'),('core','remote_core.js','/core/minimizer.php'),('core','remote_files','files/appinfo/remote.php'),('core','remote_filesync','files/appinfo/filesync.php'),('core','remote_webdav','files/appinfo/remote.php'),('core','repairlegacystoragesdone','yes'),('core','shareapi_allow_links','yes'),('core','shareapi_allow_mail_notification','yes'),('core','shareapi_allow_public_notification','yes'),('core','shareapi_allow_public_upload','no'),('core','shareapi_allow_resharing','no'),('core','shareapi_enabled','yes'),('core','umgmt_send_email','false'),('core','umgmt_show_backend','true'),('core','umgmt_show_email','true'),('core','umgmt_show_last_login','true'),('core','umgmt_show_storage_location','true'),('files','backgroundwatcher_previous_file','82'),('files','backgroundwatcher_previous_folder','201'),('files','enabled','yes'),('files','installed_version','1.2.1'),('files','types','filesystem'),('files_external','enabled','no'),('files_external','installed_version','0.2.1'),('files_external','ocsid','166048'),('files_external','types','filesystem'),('files_imageviewer','enabled','no'),('files_imageviewer','installed_version','1.0'),('files_imageviewer','types',''),('files_odfviewer','enabled','no'),('files_odfviewer','installed_version','0.1'),('files_odfviewer','types',''),('files_pdfviewer','enabled','no'),('files_pdfviewer','installed_version','0.2'),('files_pdfviewer','types',''),('files_sharing','3','1456644342.7981'),('files_sharing','7','1456644342.8111'),('files_sharing','enabled','yes'),('files_sharing','installed_version','0.7.0'),('files_sharing','outgoing_server2server_share_enabled','no'),('files_sharing','types','filesystem'),('files_texteditor','enabled','no'),('files_texteditor','installed_version','0.3'),('files_texteditor','types',''),('files_trashbin','enabled','no'),('files_trashbin','installed_version','0.4'),('files_trashbin','types','filesystem'),('files_versions','enabled','no'),('files_versions','installed_version','1.0.3'),('files_versions','types','filesystem'),('files_videoviewer','enabled','no'),('files_videoviewer','installed_version','0.1.1'),('files_videoviewer','types',''),('firstrunwizard','enabled','no'),('firstrunwizard','installed_version','1.0'),('firstrunwizard','types',''),('gallery','enabled','no'),('gallery','installed_version','0.5.2'),('gallery','types','filesystem'),('media','enabled','no'),('media','installed_version','0.4.3'),('media','types',''),('ownnote','enabled','no'),('ownnote','folder',''),('ownnote','installed_version','0.0.8'),('ownnote','types',''),('search_lucene','enabled','no'),('search_lucene','installed_version','0.5.0'),('search_lucene','types','filesystem'),('tasks','enabled','no'),('tasks','installed_version','0.7.1'),('tasks','ocsid','164356'),('tasks','types',''),('updater','enabled','no'),('updater','installed_version','0.3'),('updater','types',''),('user_external','enabled','no'),('user_external','installed_version','0.4'),('user_external','ocsid','166060'),('user_external','types','authentication,prelogin'),('user_migrate','enabled','no'),('user_migrate','installed_version','0.1'),('user_migrate','types','');
/*!40000 ALTER TABLE `oc_appconfig` ENABLE KEYS */;
UNLOCK TABLES;
@vb0
vb0 commented 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

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
Collaborator

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
BernieO commented Mar 17, 2016

To me it happened with the first upgrade attempt. Excerpt of my owncloud.log:


{main}\",\"File\":\"\\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/sabre\\\/vobject\\\/lib\\\/Parser\\\/MimeDir.php\",\"Line\":253}","level":4,"time":"2016-03-10T18:26:53+01:00"}
{"reqId":"S1jYE7AKOXHS48iQAKBz","remoteAddr":"192.168.1.30","app":"PHP","message":"Undefined index: addressBookId at \/usr\/share\/nginx\/www\/owncloud\/apps\/contacts\/lib\/hooks.php#109","level":3,"time":"2016-03-11T12:52:06+01:00"}
{"reqId":"jIzDINfNAQEVCmMoGgNe","remoteAddr":"","app":"core","message":"starting upgrade from 8.2.3.2 to 9.0.0.19","level":0,"time":"2016-03-12T05:56:33+00:00","method":"--","url":"--"}
{"reqId":"jIzDINfNAQEVCmMoGgNe","remoteAddr":"","app":"PHP","message":"file_put_contents(\/usr\/share\/nginx\/ownclouddata\/.htaccess): failed to open stream: Permission denied at \/usr\/share\/nginx\/www\/owncloud\/lib\/private\/setup.php#458","level":3,"time":"2016-03-12T05:56:33+00:00","method":"--","url":"--"}
{"reqId":"jIzDINfNAQEVCmMoGgNe","remoteAddr":"","app":"core","message":"Exception: {\"Exception\":\"Doctrine\\\\DBAL\\\\Exception\\\\TableExistsException\",\"Message\":\"An exception occurred while executing 'CREATE TABLE `oc_activity` (`activity_id` INT AUTO_INCREMENT 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, INDEX activity_time (`timestamp`), INDEX activity_user_time (`affecteduser`, `timestamp`), INDEX activity_filter_by (`affecteduser`, `user`, `timestamp`), INDEX activity_filter_app (`affecteduser`, `app`, `timestamp`), PRIMARY KEY(`activity_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':\\n\\nSQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_activity' already exists\",\"Code\":0,\"Trace\":\"#0 \\\/usr\\\/share\\\/nginx\\\/www\\\/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 \\\/usr\\\/share\\\/nginx\\\/www\\\/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 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(167): Doctrine\\\\DBAL\\\\Connection->query('CREATE TABLE `o...')\\n#3 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/db\\\/mdb2schemamanager.php(70): OC\\\\DB\\\\MDB2SchemaManager->executeSchemaChange(Object(Doctrine\\\\DBAL\\\\Schema\\\\Schema))\\n#4 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/db.php(172): OC\\\\DB\\\\MDB2SchemaManager->createDbFromStructure('\\\/usr\\\/share\\\/ngin...')\\n#5 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(567): OC_DB::createDbFromStructure('\\\/usr\\\/share\\\/ngin...')\\n#6 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/installer.php(546): OC_Installer::installShippedApp('activity')\\n#7 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/updater.php(336): OC_Installer::installShippedApps()\\n#8 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/updater.php(215): OC\\\\Updater->doUpgrade('9.0.0.19', '8.2.3.2')\\n#9 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/core\\\/command\\\/upgrade.php(225): OC\\\\Updater->upgrade()\\n#10 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Command\\\/Command.php(259): OC\\\\Core\\\\Command\\\\Upgrade->execute(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#11 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(840): Symfony\\\\Component\\\\Console\\\\Command\\\\Command->run(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#12 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(192): Symfony\\\\Component\\\\Console\\\\Application->doRunCommand(Object(OC\\\\Core\\\\Command\\\\Upgrade), Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#13 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/symfony\\\/console\\\/Application.php(123): Symfony\\\\Component\\\\Console\\\\Application->doRun(Object(Symfony\\\\Component\\\\Console\\\\Input\\\\ArgvInput), Object(Symfony\\\\Component\\\\Console\\\\Output\\\\ConsoleOutput))\\n#14 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/lib\\\/private\\\/console\\\/application.php(145): Symfony\\\\Component\\\\Console\\\\Application->run(NULL, NULL)\\n#15 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/console.php(88): OC\\\\Console\\\\Application->run()\\n#16 \\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/occ(11): require_once('\\\/usr\\\/share\\\/ngin...')\\n#17 {main}\",\"File\":\"\\\/usr\\\/share\\\/nginx\\\/www\\\/owncloud\\\/3rdparty\\\/doctrine\\\/dbal\\\/lib\\\/Doctrine\\\/DBAL\\\/Driver\\\/AbstractMySQLDriver.php\",\"Line\":49}","level":3,"time":"2016-03-12T05:56:58+00:00","method":"--","url":"--"}
@BernieO
BernieO commented 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
murzz commented Mar 19, 2016

@PVince81 yes this error happens to me after I run occ upgrade second time. First time it failed with General error: 10 disk I/O error. Then upgrade starts failing with General error: 1 table "oc_notifications" already exists.
Removing oc_notifications table from my sqlite database was not of help.
After removing folder apps/notifications upgrade completed without errors.

@nickvergessen
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment