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

Upgrade from 5.0.12 to 6.0.0a fails on Ubuntu 12.04 #6549

Closed
despens opened this issue Dec 22, 2013 · 7 comments
Closed

Upgrade from 5.0.12 to 6.0.0a fails on Ubuntu 12.04 #6549

despens opened this issue Dec 22, 2013 · 7 comments
Labels

Comments

@despens
Copy link

despens commented Dec 22, 2013

I am using the official repositories from opensuse on Ubuntu 12.04

The error message in the browser after apt-get install owncloud reads:

An exception occurred while executing 'ALTER TABLE oc_appconfig ADD PRIMARY KEY (appid, configkey)': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'files_encryption-publicShareKeyId' for key 'PRIMARY'

0145

Installed Applications:
Calendar
Contacts
Deleted files
Encryption
First Run Wizard
Full Text Search
Image Viewer
Media
ODF Viewer
PDF Viewer
Pictures
Share Files
Tasks
Text Editor
Updater
User Account Migration
Versions
Video Viewer
ownCloud Instance Migration
App Framework

Update history:
Updated from 5.0.10 to 5.0.11 by downloading a release candidate from owncloud.org (to urgently fix a bug I had problems with).
Updated to 5.0.12 via the repository from opensuse.

@karlitschek
Copy link
Contributor

Very strange. @schiesbn Any idea if something has changed in the db structure since 5.0.10 ?

@despens
Copy link
Author

despens commented Jan 6, 2014

Any other upgrading path I could use?
Is the a fix I could apply to make the upgrade possible?

@DeepDiver1975
Copy link
Member

@despens you can backup your database and remove the duplicate entries in the table oc_appconfig

@despens
Copy link
Author

despens commented Jan 6, 2014

Yeah, but how can I remove duplicate entries in a table without a primary key? And how the fixed update script is going to do it?

mysql> select * from oc_appconfig where appid='files_encryption';
+------------------+-------------------+-------------------+
| appid            | configkey         | configvalue       |
+------------------+-------------------+-------------------+
| files_encryption | enabled           | yes               |
| files_encryption | installed_version | 0.4               |
| files_encryption | publicShareKeyId  | pubShare_ab123456 |
| files_encryption | publicShareKeyId  | pubShare_ab123456 |
| files_encryption | types             | filesystem        |
+------------------+-------------------+-------------------+
5 rows in set (0.00 sec)

(I changed the 'configvalue' in the output as I am not sure what the value is used for. But they are both the same.)

@despens
Copy link
Author

despens commented Jan 6, 2014

OK, got it! Update worked.

mysql> delete from oc_appconfig where appid='files_encryption' and configkey='publicShareKeyId' limit 1;

@karlitschek
Copy link
Contributor

We really should add code to our upgrade and/or database repair routine that automatically fixes issues like that.

@PVince81
Copy link
Contributor

PVince81 commented May 6, 2014

Closing in favor of #8469 for handling duplicate keys.

@PVince81 PVince81 closed this as completed May 6, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants