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

Share still exists after source file gets deleted #7238

Closed
Emi94 opened this issue Nov 21, 2017 · 10 comments
Closed

Share still exists after source file gets deleted #7238

Emi94 opened this issue Nov 21, 2017 · 10 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: sharing high needs info

Comments

@Emi94
Copy link

Emi94 commented Nov 21, 2017

Steps to reproduce

  1. Share a file with a user
  2. Delete the shared file

Expected behaviour

Share should be deleted from DB

Actual behaviour

Share still exists in DB table oc_share

Server configuration

Operating system:Ubuntu 16.04
Web server:Apache2
Database:PostgreSQL
PHP version:php 7.0
Nextcloud version: 12.0.3
Updated from an older Nextcloud/ownCloud or fresh install:updated from older nextcloud
Where did you install Nextcloud from:https://nextcloud.com/install/
Are you using an external user-backend, if yes which one: LDAP

This lead to one user having a broken share in "Shared with others" folder:
errant_folder
I managed to get rid of it by manually deleting the share from DB table oc_share.

I would recommend for nextcloud to check when deleting a file, if it is shared. If yes then delete the share from DB too.

@LukasReschke
Copy link
Member

cc @schiessle @icewind1991

@skjnldsv
Copy link
Member

Still happens

@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of high and removed stale Ticket or PR with no recent activity labels May 21, 2019
@skjnldsv skjnldsv added this to the Nextcloud 17 milestone May 21, 2019
@joepitt91
Copy link

A cron based check as well as on delete would be good, e.g. if users have shared something on external storage and the shared folder gets deleted or moved outside of Nextcloud

@aignerat
Copy link
Member

just ran into that issue and got some ideas I want to point out:

if trashbin is active only delete share when the file gets finally removed
if trashbin is not active delete shares on file-removal

In that step it would be great to validate possible errors from remnants. I had the idea to move the filecache, storage and shares from the oc-tables to oc_xxx_remnants. That way the stability of the system's services like fulltextsearch could be better, even without removing remnants.

@nikkilocke
Copy link

When is this going to be fixed?
What measures can I take to remove the shares of deleted folders from 1,000 users, because someone shared a folder then deleted the folder without unsharing it first?

@kesselb kesselb removed this from the Nextcloud 17.0.4 milestone Feb 13, 2020
@kesselb
Copy link
Contributor

kesselb commented Feb 13, 2020

cc @skjnldsv I removed the milestone. Please reschedule ;)

@chaosgrid
Copy link

chaosgrid commented Oct 19, 2021

I think this bug has been fixed for normal files (could not reproduce), but files within group folders still have this problem when using trashbin/deleted files app. See nextcloud/groupfolders#1699

@szaimen
Copy link
Contributor

szaimen commented Jan 9, 2023

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

@szaimen szaimen removed the 1. to develop Accepted and waiting to be taken care of label Jan 9, 2023
@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 9, 2023
@szaimen szaimen closed this as completed Mar 6, 2023
@LM-vb
Copy link

LM-vb commented Jul 4, 2024

This still/again (?) happens on 29.0.3 for both files and folders.

At least orphaned links can be deleted on the command line now: occ sharing:delete-orphan-shares

@szaimen
Copy link
Contributor

szaimen commented Jul 9, 2024

Hi, please open a new issue for this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: sharing high needs info
Projects
None yet
Development

No branches or pull requests