-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
DB upgrade failed (owncloud 6 to 7 on debian sid) #9893
Comments
@slallemand which database are you using? |
MariaDB 5.5 |
Seems I find a solution for my problem. |
@blizzz any idea what could be wrong here ? |
My copy/past has failed ... I had to removed those entries : <primary>true</primary> |
@slallemand did you ever manually change something in oc_ldap_user_mapping ? |
Nothing I can remember. |
do you still have the old table somewhere available? could you give us the structure before the migration? The SQL command would be DESCRIBE oc_ldap_user_mapping; |
Hi blizzz, you'll find following the structure before and after the CREATE TABLE `oc_ldap_user_mapping` (
`ldap_dn` varchar(255) NOT NULL DEFAULT '',
`owncloud_name` varchar(255) NOT NULL DEFAULT '',
`directory_uuid` varchar(255) NOT NULL DEFAULT '',
UNIQUE KEY `ldap_dn_users` (`ldap_dn`),
UNIQUE KEY `owncloud_name_users` (`owncloud_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; Current table structure CREATE TABLE `oc_ldap_user_mapping` (
`ldap_dn` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
`owncloud_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
`directory_uuid` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '',
UNIQUE KEY `ldap_dn_users` (`ldap_dn`),
UNIQUE KEY `owncloud_name_users` (`owncloud_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin; |
Well, there is no primary key, but unique keys. Anyway, why would we attempt to drop it, the KEY descriptions are not different. Any idea @butonic ? |
the primary keys were added by @DeepDiver1975 in 8661fe3 as part of fixing #8252. My guess is that the migration hiccups in this case ... @DeepDiver1975 do you have any tips to get more info? Some more logging that can be enabled? |
@DeepDiver1975 any tips? |
@blizzz @DeepDiver1975 @icewind1991 this smells a little like migration hiccupping like in #10980. However, user_ldap does not try to use a preupdate.php |
Afair there has been a migration unit test fir exactly this case. No clue why this is now failing. |
Same problem here. Someone found any tips ? |
Any news on this? We're hesitant to try upgrading to 7 as this would be a show stopper for us. |
It is incredible that the ownCloud devs leave this issue unfixed for so long. Did they realise that there are two major versions that users could not update to by now? |
@Natureshadow @jonathanvaughn @Ange7 feel free to help providing more information about this issue to push it forward. Tell us about your environment and answer @blizzz's questions above about the LDAP uuid. Here is the issue template: https://raw.githubusercontent.com/owncloud/core/master/issue_template.md Many people have been able to upgrade to OC 7 already who didn't have this issue, it doesn't affect every setup (even with LDAP). This is why the more information about the issue/environemt/situation, the more likely the devs will be able to reproduce the issue and eventually fix it. Thanks! |
Do you all use mariadb ? |
Hello, I have OC 8.0.2 on a ubuntu 14.04 with MySQL. When i upgraded from version 7 to 8 i disabled the apps (LDAP and others) to get the upgrade from 7 to 8 to work, so now i have a working OC 8. But LDAP inactive, when i activate it, owncloud wants to update, but fails with the messege "An exception occurred while executing 'ALTER TABLE oc_oc_ldap_user_mapping_c590aed7a1e5d DROP PRIMARY KEY': SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'PRIMARY'; check that column/key exists" Im not very good at SQL, but i can follow instructions, anyone got some? Thanks Best regards |
@blizzz @icewind1991 any idea ? |
I encountered this issue when upgrading a system from OC6 to OC8, and think I've noticed a few things that might be relevant. I combined the upgrade with a server move, so I used mysqldump to bring my DB over from one server to the new one. My dump file looked a lot like #9893 (comment) at this point, two UNIQUE KEY entries and no PRIMARY KEY. But checking the source database, my "oc_ldap_user_mapping" table has ldap_dn specified as PK, where the database.xml specifies that owncloud_name should be primary.
This is also the structure created on the new server from the dump file. I manually edited my mysqldump file, changed:
to:
After reloading this new dump with explicit PK definitions in place to match #8252 then the upgrade proceeded flawlessly. |
You must not got from OC 6 to 8 directly, but to OC 7 first. Skipping major versions is neither supported nor tested. |
Is that likely to be part of this issue? I hit this problem when I first tried upgrading 6 to 7, from memory, but didn't have time to investigate. I'm only going to 8 directly now as that's what the repos are delivering to me - the test system is working fine after the upgrade though, it's really file sharing only, very few addons. I have only done a test move on a copy of the existing system. My original OC6 system is still in production, so I can do another run at 7 if I can locate the right set of RPMs and see if the same issues occur. |
Is this still happening when upgrading from OC 6 to 7.0.7 or OC 7 to 8.0.5 ? |
@bremensaki you can get the 7 RPMs here: https://software.opensuse.org/download/package?project=isv:ownCloud:community:7.0&package=owncloud In any way, major versions should not be skipped. If you're still having trouble despite this, feel free to reopen. |
I'm facing this issue when upgrading mysql database on my owncloud server :
An exception occurred while executing 'ALTER TABLE
oc_oc_ldap_user_mapping_10b72ceced664
DROP PRIMARY KEY': SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'PRIMARY'; check that column/key existsIn owncloud.log :
Any idea ?
Regards
The text was updated successfully, but these errors were encountered: