You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to update | Multiple primary key for oc_locks table #5139
Same here on update to 5.0.12 and 5.0.13. Now I've as well run the commands after upgrading to 5.0.13. Is that all? No need to rerun some update procedure?
see at the end of #999 (comment) :
(I have no idea at the moment, if this helps)
Update:
Commands posted by ceri https://github.com/owncloud/core/issues/999#issuecomment-16778131 did solve the issue.
Had the same issue here going from 5.0.3 to 5.0.5 using MySQL. Had to run in the following commands myself.
ALTER TABLE `oc_locks` CHANGE `id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, drop primary key;
ALTER TABLE oc_locks CHANGE `timeout` `timeout` INT UNSIGNED DEFAULT 0, CHANGE `created` `created` BIGINT DEFAULT 0, CHANGE `scope` `scope` TINYINT DEFAULT 0, CHANGE `depth` `depth` TINYINT DEFAULT 0;
ALTER TABLE `oc_queuedtasks` CHANGE `id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, drop primary key;
ALTER TABLE `oc_vcategory` CHANGE `id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, drop primary key;
OC Developers are asked to please better test the upgrade code - it is essential, that upgrading runs smoothly.
@karlitschek the table schema did not change through out the whole 5.0.x lifecycle up to now.
I suspect the root cause within the mbd2 schema migration - not much we can do from my understanding.
#! /usr/bin/env python
import sys
def main():
print "SET sql_mode='NO_BACKSLASH_ESCAPES';"
lines = sys.stdin.read().splitlines()
for line in lines:
processLine(line)
def processLine(line):
if (
line.startswith("PRAGMA") or
line.startswith("BEGIN TRANSACTION;") or
line.startswith("COMMIT;") or
line.startswith("DELETE FROM sqlite_sequence;") or
line.startswith("INSERT INTO \"sqlite_sequence\"")
):
return
line = line.replace("AUTOINCREMENT", "AUTO_INCREMENT")
line = line.replace("DEFAULT 't'", "DEFAULT '1'")
line = line.replace("DEFAULT 'f'", "DEFAULT '0'")
line = line.replace(",'t'", ",'1'")
line = line.replace(",'f'", ",'0'")
in_string = False
newLine = ''
for c in line:
if not in_string:
if c == "'":
in_string = True
elif c == '"':
newLine = newLine + '`'
continue
elif c == "'":
in_string = False
newLine = newLine + c
print newLine
if __name__ == "__main__":
main()
Perhaps, the convertions made by script caused our trouble, perhaps because some INDEXes are now incorrect or missing ?
OK. Seems to be clear that this is triggered by a broken way to migrate to a different database. Nothing we can do here beside providing a working howto in the future. Or even a database Migration script which might be tricky to do right as proven here.
Activity
XueSheng-GIT commentedon Oct 4, 2013
Looks like issue #999
This post might help you: #999 (comment)
mokkin commentedon Nov 6, 2013
@XueSheng-GIT
I've manually done those SQL-commands after upgrading to 5.0.13 I'll see it on the next update, if it works.
Thx so far!
exic commentedon Nov 8, 2013
Same here on update to 5.0.12 and 5.0.13. Now I've as well run the commands after upgrading to 5.0.13. Is that all? No need to rerun some update procedure?
karlitschek commentedon Nov 10, 2013
@DeepDiver1975 Any idea?
Wikinaut commentedon Nov 11, 2013
@karlitschek @DeepDiver1975
see at the end of #999 (comment) :
(I have no idea at the moment, if this helps)
Ceri's comment is #999 (comment) :
OC Developers are asked to please better test the upgrade code - it is essential, that upgrading runs smoothly.
VicDeo commentedon Nov 11, 2013
IMO preventive deletion of existing key with
should help. But this is just a workaround, not a fix at all.
karlitschek commentedon Nov 11, 2013
@DeepDiver1975 Do you know if we have changes the oc_locks table lately?
DeepDiver1975 commentedon Nov 11, 2013
@karlitschek there has been no database schema change from 5.0.12 to 5.0.13:
v5.0.12...v5.0.13
XueSheng-GIT commentedon Nov 11, 2013
I had this issue with updating from 5.0.5 to 5.0.6 (others reported this also with even older versions of owncloud).
I did a fresh install of owncloud 5.0.x at that time, but started with a sqlite database. Later on I exported this database and imported it to mysql.
Did others who are affected by this bug also start with sqlite and converted the database afterwards? Maybe that could be a reason.
karlitschek commentedon Nov 11, 2013
@XueSheng-GIT O.K. It is possible that something went wrong here.
DeepDiver1975 commentedon Nov 11, 2013
@karlitschek the table schema did not change through out the whole 5.0.x lifecycle up to now.
I suspect the root cause within the mbd2 schema migration - not much we can do from my understanding.
mokkin commentedon Nov 11, 2013
I have to add, I also started on OC 4 with SQLite and later during OC 5 I migrated to MySQL.
Wikinaut commentedon Nov 11, 2013
@XueSheng-GIT
Same for me: I have also to add that
using the steps described in
with the Python script linked in there
Perhaps, the convertions made by script caused our trouble, perhaps because some INDEXes are now incorrect or missing ?
exic commentedon Nov 11, 2013
OK, that goes for me too. Started with sqlite on some OC 5 version and changed to mysql later.
karlitschek commentedon Nov 11, 2013
OK. Seems to be clear that this is triggered by a broken way to migrate to a different database. Nothing we can do here beside providing a working howto in the future. Or even a database Migration script which might be tricky to do right as proven here.
Wikinaut commentedon Nov 11, 2013
@karlitschek
Dear Frank, perhaps you as expert can find
what database or index conversion has been missing in the Python code (sqlite-to-MySQL converter) above #5139 (comment) .
As we all can see in this thread and other filed issues, quite a lot of users suffer from that (alleged) conversion-related problem.
karlitschek commentedon Nov 12, 2013
Sorry. But there is no working, tested and documented solution for this yet. This has to be developed. Contributions are welcome.
bantu commentedon Nov 16, 2013
@DeepDiver1975 Remove oc6 tag? See #5139 (comment)
karlitschek commentedon Nov 17, 2013
Yes. I removed it
karlitschek commentedon Nov 29, 2013
duplicate of #4085