-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug]: Deleting file or folder leaves orphaned share links #46369
Comments
These should be cleaned daily by a background job. |
Do I need to set up a separate cron job (aside from cron.php) for that? Or a config setting? |
Found the background job via If I understand the code in
correctly, there are no preconditions to delete an orphaned share. And according to
there is only a debug message logged (side note: I would have expected info instead of debug). Is there any other log where I can check what is (not) happening? |
A diff of yesterday's and today's orphaned shares gave me the relevant hint: the orphaned shares only get deleted from the database if the relevant folders and files are permanently deleted. So as long as they are still present in the trash bin, the orphaned shares do not get deleted. Which makes sense insofar, as an accidently deleted file or folder gets restored, the share link gets restored, too. |
I am surprised you closed this bug report since while not cleaning up the orphaned share links might be correct, it is still a bug for other users as they still see a share (that they shouldn't actually see) when the file has been moved to the trashbin. |
I closed the report, as my question/"bug" has been answered sufficiently (and my users can live with the error pages for a few days time, if they ever encounter one). However, I understand your point about the confusion if the share links point to nowhere in the time between being moved to the trash bin and permanently getting deleted. And I would indeed recommend to you (in response to nextcloud/groupfolders#1699 (comment)) to open a bug report on the nextcloud/server github, as this seems to get more attention from the devs. |
Bug description
NC 29.0.3
If a shared file or folder gets deleted, only the file or folder itself gets deleted yet its shares (entries in database) do not get deleted but remain orphaned. After the deletion, it is possible to open such a link, a password (if set) will be queried and only after a successful authentication an error page is shown (missing file resp. folder).
Steps to reproduce
Expected behavior
When deleting a shared file or folder, its meta data (shares, etc.) has to be deleted automatically, too.
Installation method
Community Manual installation with Archive
Nextcloud Server version
29
Operating system
Other
PHP engine version
PHP 8.3
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
Upgraded to a MAJOR version (ex. 28 to 29)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
No response
Additional info
This issue has already been discussed in #7238, yet has been closed there for lack of response. For the time being, orphaned shares can be deleted on the command line via
occ sharing:delete-orphan-shares
The text was updated successfully, but these errors were encountered: