Error during upgrade

Hi,

I upgraded from version 9.0.53 (from top of my head) to 10.0.1
I am not experiencing any issues. I have the same error as below during all my (minor) updates also. Note that I originally moved from Owncloud.

$ php ./occ upgrade
Nextcloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Checking whether the database schema can be updated (this can take a long time depending on the database size)
 Done
 27/27 [============================] 100%
Checked database schema update
Checking updates of apps
Checking whether the database schema for <activity> can be updated (this can take a long time depending on the database size)
 Done
 2/2 [============================] 100%
Checking whether the database schema for <federatedfilesharing> can be updated (this can take a long time depending on the database size)
 Done
 1/1 [============================] 100%
Checking whether the database schema for <files_sharing> can be updated (this can take a long time depending on the database size)
 Done
 1/1 [============================] 100%
Checking whether the database schema for <files_trashbin> can be updated (this can take a long time depending on the database size)
 Done
 1/1 [============================] 100%
Checked database schema update for apps
Updating database schema
Updated database
Updating <federatedfilesharing> ...
Updated <federatedfilesharing> to 1.0.1
Updating <updatenotification> ...
Updated <updatenotification> to 1.0.1
Updating <files> ...
Updated <files> to 1.5.2
Updating <activity> ...
Updated <activity> to 2.3.2
Updating <encryption> ...
Updated <encryption> to 1.3.1
Updating <files_sharing> ...
Updated <files_sharing> to 1.0.0
Updating <files_trashbin> ...
Updated <files_trashbin> to 1.0.0
Updating <files_versions> ...
Updated <files_versions> to 1.3.0
Updating <comments> ...
Updated <comments> to 1.0.0
Updating <systemtags> ...
Updated <systemtags> to 1.0.2
dav: 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[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists
notifications: An exception occurred while executing 'CREATE TABLE `oc_notifications` (`notification_id` INT AUTO_INCREMENT NOT NULL, `app` VARCHAR(32) NOT NULL, `user` VARCHAR(64) NOT NULL, `timestamp` INT DEFAULT 0 NOT NULL, `object_type` VARCHAR(64) NOT NULL, `object_id` VARCHAR(64) NOT NULL, `subject` VARCHAR(64) NOT NULL, `subject_parameters` LONGTEXT DEFAULT NULL, `message` VARCHAR(64) DEFAULT NULL, `message_parameters` LONGTEXT DEFAULT NULL, `link` VARCHAR(4000) DEFAULT NULL, `actions` LONGTEXT DEFAULT NULL, INDEX oc_notifications_app (`app`), INDEX oc_notifications_user (`user`), INDEX oc_notifications_timestamp (`timestamp`), INDEX oc_notifications_object (`object_type`, `object_id`), PRIMARY KEY(`notification_id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_notifications' already exists
federation: An exception occurred while executing 'CREATE TABLE `oc_trusted_servers` (`id` INT AUTO_INCREMENT NOT NULL, `url` VARCHAR(512) NOT NULL COMMENT 'Url of trusted server', `url_hash` VARCHAR(255) DEFAULT '' NOT NULL COMMENT 'sha1 hash of the url without the protocol', `token` VARCHAR(128) DEFAULT NULL COMMENT 'token used to exchange the shared secret', `shared_secret` VARCHAR(256) DEFAULT NULL COMMENT 'shared secret used to authenticate', `status` INT DEFAULT 2 NOT NULL COMMENT 'current status of the connection', `sync_token` VARCHAR(512) DEFAULT NULL COMMENT 'cardDav sync token', UNIQUE INDEX url_hash (`url_hash`), PRIMARY KEY(`id`)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_trusted_servers' already exists
Drop old database tables
 Done
 31/31 [============================] 100%
Remove old (< 9.0) calendar/contact shares
 Done
 4/4 [============================] 100%
Fix permissions so avatars can be stored again
 Done
 2/2 [============================] 100%
Repair unmerged shares
 Done
 3/3 [============================] 100%
Starting code integrity check...
Finished code integrity check
Update successful
Turned off maintenance mode
Reset log level

You had this problem already during the last update:


And there was an issue in owncloud that was fixed:

@nickvergessen what can the user do to avoid this error in the future?

The problem

Base table or view already exists

was not fixed yet. We still lack a way to reproduce this.

I am currently facing the same error message, after updating an other app. After the update I got a message like “failed to enable app dav”. If I run ./occ app:enable dav, I get the following output:

[OC\HintException]        
  Failed to enable app dav  
                            

                                                                                                                                                                               
  [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, UNIQUE INDEX addressboo  
  k_index (`principaluri`, `uri`), 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                                                                              
                                                                                                                                                                               

                                                                                                   
  [Doctrine\DBAL\Driver\PDOException]                                                              
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists  
                                                                                                   

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

NC 10.0.3

What can I do to help you?

Hello,

did someone already find a solution for this?
I have the same problem here, but I’m on version 11.0.3.

The upgrade showed me some problems, and now I can’t access my calendar any more, no matter if I use a CalDav Client or the Webpage.

When I look into the NC logs, I find some issues about DAV anytime I try to connect the calendar. When I look into the internals I see the following:

    php /var/www/owncloud/occ app:list
       Enabled:
      - activity: 2.4.1
      - admin_audit: 1.1.0
      - audioplayer: 1.5.1
      - calendar: 1.5.2
      - comments: 1.1.0
      - contacts: 1.5.3
      - dav: true
    ...

So DAV seems to be fine. But when I try to enable it anyway this happens:

php /var/www/owncloud/occ app:enable dav

                                                                                                                                           
  [Doctrine\DBAL\Exception\TableExistsException]                                                                                           
  An exception occurred while executing 'CREATE TABLE `oc_addressbooks` (`id` BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, `principaluri` VAR  
  CHAR(255) DEFAULT NULL, `displayname` VARCHAR(255) DEFAULT NULL, `uri` VARCHAR(255) DEFAULT NULL, `description` VARCHAR(255) DEFAULT NU  
  LL, `synctoken` INT UNSIGNED DEFAULT 1 NOT NULL, UNIQUE INDEX addressbook_index (`principaluri`, `uri`), PRIMARY KEY(`id`)) DEFAULT CHA  
  RACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB':                                                                                       
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists                                          
                                                                                                                                           

                                                                                                   
  [Doctrine\DBAL\Driver\PDOException]                                                              
  SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_addressbooks' already exists  
                                                                                                   

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

app:enable [-g|--groups GROUPS] [--] 

What looks pretty much the same than the messages @sualko sualko got.

So what can I do to get a working DAV and Calendar again?