-
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
Update error when duplicate sub-shares exist #27990
Comments
Seems some of your shares are in an inconsistent state. I suggest you check In your database, for some unknown reason, one of these sub-entries isn't pointing to the same parent like the others. Normally they all point to the same parent when it's the same share. If you manage to find the matching broken share, please post the select result here so we can examine it (and tell you how to manually fix it) |
I ran into just the same problem and checked the database based on your information. All seemed to be just fine, so I checked the exception in owncloud.log and finally the code. It seems there's an obvious mistake while performing "Ensure uniquenes of parents". |
I'm having a very similar issue except that the update succeeded. The problem is that two of my users (the only ones who actually have shared anything) cannot login due these errors. Here is the select result as asked: What do I do? |
May you verify if https://github.com/owncloud/core/pull/28080/files helps? |
Yes, that did work! It allowed me to sign in but another user was still having trouble. I had to reset that user and now everything is good. |
From my understanding of that code is that it was designed to throw an exception if a subshare has more than one parent, which should never happen and means the data structure in the DB is corrupted (maybe through a bug). On the other hand, failing hard like this isn't user friendly so maybe your fix is alright but would need to at least log something, maybe a warning, so that an administrator can spot that there is something wrong with the data structure. |
@PVince81 that's absolutely right, though I'm not an ownCloud developer nor aware of its Framework, so that's just a first fix. |
Fix #27990 - Ensure uniquenes of parents
Fix #27990 - Ensure uniquenes of parents
Hi Guys, This is the error I receive when running occ scan: https://gist.github.com/socrat3000/e9ada76a85c03d6f8f0637c141d43106 and when I run the query by @PVince81 , I get the following result: https://gist.github.com/socrat3000/94682f120b485a8466872ef378b9e172 Any ideas how I can fix this? |
And this fix: https://github.com/owncloud/core/pull/28080/files is already there, but not resolving the issue. |
@socrat3000 I don't see anything wrong with the result yet. Can you also do a |
By the way, the account with the problem is 8D0D8BA8-DF3B-44FC-BEEA-25C605E57F88 |
Ok I see, so this user has two sub-entries instead of one. You could simply delete the oc_share entry with id 334. I'll reopen this ticket so we can provide a repair step that detects this scenario and automatically deletes duplicates. |
334? I don't get it |
These two rows are identical except for the share id. This is the problem, so delete the second one with id 334. |
ah I get it. So, you mean I should run this statement? delete from oc_share where id=334 |
Yes. Now the reason why you have duplicates remains a mystery and is likely not reproducible easily. |
It's now working, thanks a lot. Will ask the user to try to login again, because this issue was preventing him from logging in. Will update you with the result. |
Returns this:
I should then run sth like this? (note oc_share, not oc_shareS) This gives me:
Thanks a lot again for your fast replies @PVince81 !! :) 👍 |
Yes. See how the last result has "Blafo" twice. Delete one of both entries. You'll need to repeat the process for every of the 7 results above. This is to get you unstuck. Now seeing that more and more people are having this problem, I think we should work on writing a repair step that will clean this up before an upgrade. |
So sth like this for my example?
|
@p-thurner yes. Make sure you have a backup of the database first. |
@PVince81 thanks again! :) That did the trick. I can now run a
And the WebUI / everything else is working again. Thumbs up for good support from the developers :) 🥇 |
Thanks for confirming! |
Thanks @PVince81 for rising priority. |
Steps to reproduce manually and also illustrate the sub-share feature:
You'll get an entry in the log with "OC\Share20\Exception\ProviderException: Parent of share should be unique". To fix this, the goal is to implement a repair step that will select such entries. See #27990 (comment) for some query ideas, beware as they might be expensive. Then if duplicates were found, delete them and keep the entry with the smallest share id from the duplicates. Add a unit test that inserts such entries, runs the repair step, then checks that the duplicates are gone. @sharidas let me know if you have further questions |
repair step implemented, closing |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
There was an error updating. Please, help!
OC\Share20\Exception\ProviderException: Parent of share should be unique
Detailed logs:
Preparing update
Set log level to debug
Turned on maintenance mode
Updating database schema
Updated database
Updated "activity" to 2.3.4
[1 / 28]: Drop old database table: calendar_calendars
[2 / 28]: Drop old database table: calendar_objects
[3 / 28]: Drop old database table: calendar_share_calendar
[4 / 28]: Drop old database table: calendar_share_event
[5 / 28]: Drop old database table: file_map
[6 / 28]: Drop old database table: foldersize
[7 / 28]: Drop old database table: fscache
[8 / 28]: Drop old database table: gallery_sharing
[9 / 28]: Drop old database table: locks
[10 / 28]: Drop old database table: log
[11 / 28]: Drop old database table: media_albums
[12 / 28]: Drop old database table: media_artists
[13 / 28]: Drop old database table: media_sessions
[14 / 28]: Drop old database table: media_songs
[15 / 28]: Drop old database table: media_users
[16 / 28]: Drop old database table: permissions
[17 / 28]: Drop old database table: pictures_images_cache
[18 / 28]: Drop old database table: principalgroups
[19 / 28]: Drop old database table: principals
[20 / 28]: Drop old database table: queuedtasks
[21 / 28]: Drop old database table: sharing
[22 / 28]: Drop old database table: clndr_calendars
[23 / 28]: Drop old database table: clndr_objects
[24 / 28]: Drop old database table: clndr_share_event
[25 / 28]: Drop old database table: clndr_share_calendar
[26 / 28]: Drop old database table: clndr_repeat
[27 / 28]: Drop old database table: contacts_addressbooks
[28 / 28]: Drop old database table: contacts_cards
[28 / 28]: Drop old database tables
[1 / 4]: Remove old (< 9.0) calendar/contact shares
[2 / 4]: Remove old (< 9.0) calendar/contact shares
[3 / 4]: Remove old (< 9.0) calendar/contact shares
[4 / 4]: Remove old (< 9.0) calendar/contact shares
[4 / 4]: Remove old (< 9.0) calendar/contact shares
[1 / 2]: Fix permissions so avatars can be stored again
[1 / 1]: Fix permissions so avatars can be stored again
[1 / 44]: Move user avatars outside the homes to the new location
[2 / 44]: Move user avatars outside the homes to the new location
[3 / 44]: Move user avatars outside the homes to the new location
OC\Share20\Exception\ProviderException: Parent of share should be unique
The text was updated successfully, but these errors were encountered: