Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update failed because an exception occured while executing CREATE TABLE 'oc_pictures_images_cache' #10829

Closed
waldkauts opened this issue Sep 3, 2014 · 3 comments

Comments

@waldkauts
Copy link

Hey guys!

During the update from ownCloud 6 to 7 I am getting the following error:

Failed to update database structure (exception 'PDOException' with message 'SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`cloud`.`oc_pictures_images_cache`' already exists' in /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:742
Stack trace: #0 [internal function]: PDO->query('CREATE TABLE `o...')
#1 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(742): call_user_func_array(Array, Array)
#2 /var/www/owncloud/lib/private/db/migrator.php(181): Doctrine\DBAL\Connection->query('CREATE TABLE `o...')
#3 /var/www/owncloud/lib/private/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema))
#4 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(99): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema))
#5 /var/www/owncloud/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...')
#6 /var/www/owncloud/lib/private/app.php(1148): OC_DB::updateDbFromStructure('/var/www/ownclo...')
#7 /var/www/owncloud/lib/private/updater.php(267): OC_App::updateApp('gallery')
#8 /var/www/owncloud/lib/private/updater.php(209): OC\Updater->doAppUpgrade()
#9 /var/www/owncloud/lib/private/updater.php(139): OC\Updater->doUpgrade('7.0.2.1', '7.0.2.1')
#10 /var/www/owncloud/core/ajax/update.php(41): OC\Updater->upgrade()
#11 {main} Next exception 'Doctrine\DBAL\DBALException' with message 'An exception occurred while executing 'CREATE TABLE `oc_pictures_images_cache` (`uid_owner` VARCHAR(64) NOT NULL, `path` VARCHAR(256) NOT NULL, `width` INT NOT NULL, `height` INT NOT NULL) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table '`cloud`.`oc_pictures_images_cache`' already exists' in /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php:47
Stack trace:
#0 /var/www/owncloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(744): Doctrine\DBAL\DBALException::driverExceptionDuringQuery(Object(PDOException), 'CREATE TABLE `o...')
#1 /var/www/owncloud/lib/private/db/migrator.php(181): Doctrine\DBAL\Connection->query('CREATE TABLE `o...')
#2 /var/www/owncloud/lib/private/db/migrator.php(35): OC\DB\Migrator->applySchema(Object(Doctrine\DBAL\Schema\Schema)) 
#3 /var/www/owncloud/lib/private/db/mdb2schemamanager.php(99): OC\DB\Migrator->migrate(Object(Doctrine\DBAL\Schema\Schema)) 
#4 /var/www/owncloud/lib/private/db.php(320): OC\DB\MDB2SchemaManager->updateDbFromStructure('/var/www/ownclo...') 
#5 /var/www/owncloud/lib/private/app.php(1148): OC_DB::updateDbFromStructure('/var/www/ownclo...') 
#6 /var/www/owncloud/lib/private/updater.php(267): OC_App::updateApp('gallery') 
#7 /var/www/owncloud/lib/private/updater.php(209): OC\Updater->doAppUpgrade() 
#8 /var/www/owncloud/lib/private/updater.php(139): OC\Updater->doUpgrade('7.0.2.1', '7.0.2.1') 
#9 /var/www/owncloud/core/ajax/update.php(41): OC\Updater->upgrade() 
#10 {main}) 

One of my first attempts was to drop the table manualy, but if I try I'm getting the error:

ERROR 1051 (42S02): Unknown table 'oc_pictures_images_cache'

But if I try to create the table I'm getting the same error like the ownCloud updater:

ERROR 1050 (42S01): Table 'cloud.oc_pictures_images_cache' already exists.

This doesn't make any sense to me at all...
If i set the configvalue of the appid gallery to "no" the update works, but I cant use the gallery function any more...

Has anybody a suggestion on how I can solv this problem?

Edit: reformatted stack trace

@PVince81
Copy link
Contributor

PVince81 commented Sep 3, 2014

@icewind1991 any idea ? Is the updater trying to create the table twice ?

@craigpg craigpg added this to the ownCloud 7 backlog milestone Sep 3, 2014
@icewind1991
Copy link
Contributor

With this (and various similar issues) I'm suspecting we're running into upstream bugs about creating diffs between the current and target db scheme

(also oc_pictures_images_cache, hasn't actually been used for over 2 version, should probably get around removing it...)

@DeepDiver1975 DeepDiver1975 modified the milestones: ownCloud 7 backlog, backlog Jan 8, 2015
@DeepDiver1975
Copy link
Member

we will drop the table with 8.1 -> close

@MorrisJobke MorrisJobke removed this from the backlog milestone Mar 3, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Aug 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants