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

Dangling data tuples in table oc_cards_properties #15286

Closed
raoulbhatia opened this issue Apr 29, 2019 · 7 comments
Closed

Dangling data tuples in table oc_cards_properties #15286

raoulbhatia opened this issue Apr 29, 2019 · 7 comments

Comments

@raoulbhatia
Copy link

I have a long upgrade history, where I started out on OwnCloud and then migrated over to Nextcloud. I have also used the Contacts app for a long time.

I was today doing some contacts cleanup and noticed dangling data tuples with the following command:

SELECT * FROM oc_cards_properties
LEFT JOIN oc_cards ON oc_cards_properties.cardid = oc_cards.id
HAVING oc_cards.id IS NULL;

38 rows in set (0.00 sec)

How about adding a constraint to disallow such invalid data?

Thanks,
Raoul

@raoulbhatia raoulbhatia added bug 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Apr 29, 2019
@kesselb
Copy link
Contributor

kesselb commented May 5, 2019

cc @rullzer @nickvergessen

@nickvergessen
Copy link
Member

We have a repair step for that in place, which should already take care of this:
https://github.com/nextcloud/server/blob/master/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php

it's executed on each update of the dav app. So I guess we can close this?

@nickvergessen nickvergessen added feature: dav and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels May 6, 2019
@raoulbhatia
Copy link
Author

I suppose this will ship with Nextcloud 16 then, right?

@nickvergessen
Copy link
Member

It is shipping since Nextcloud 13

@raoulbhatia
Copy link
Author

Strangely, I am unable to locate this file in my installation. Also, if this is shipping since NC 13, then I should not be in this situation with my NC 15 installation, right?

# ls ./apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php
ls: cannot access './apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php': No such file or directory
# grep -i orphan ./apps/dav/lib/Migration/*
#

Also, the history shows that this file was added in January 2019, only? Check
https://github.com/nextcloud/server/commits/master/apps/dav/lib/Migration/RemoveOrphanEventsAndContacts.php and https://github.com/nextcloud/server/commit/f88e7648d51036c4c04f6c44a8286b1762bea506.patch

@raoulbhatia raoulbhatia reopened this May 6, 2019
@nickvergessen
Copy link
Member

Oh, you are right. I though this was much longer ago.
So yeah it is fixed in 16. Let's make it available in 15 too.

@MorrisJobke
Copy link
Member

Fixed for 15 by #15387.

@MorrisJobke MorrisJobke added this to the Nextcloud 15.0.8 milestone May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants