Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(files_sharing): diagnose unavailable federated shares on availability recheck - #67174

Open
skjnldsv wants to merge 1 commit into
masterfrom
fix/federated-share-availability-recheck
Open

skjnldsv wants to merge 1 commit into
masterfrom
fix/federated-share-availability-recheck

Conversation

@skjnldsv

Copy link
Copy Markdown
Member

Summary

When a federated share is deleted on the owner's side and the recipient misses the unshare notification, the recipient keeps the mount forever. Once it's flagged unavailable every access returns 503, and the 10 min recheck never removes it. We saw a setup with about 1.9k of these dead storages mounted.

External\Storage::test() expects parent::test() to throw so it can call checkStorageAvailability(). But Common::test() catches every exception and returns false: a 401 (StorageInvalidException) is swallowed, and a 404 on the root is cached as false in DAV::propfind() without throwing. The other path, hasUpdated(), returns early while the storage is unavailable. So checkStorageAvailability(), which removes the share on 404 or 401/403, never runs.

test() now stats the root itself and runs checkStorageAvailability() when that fails. Availability::updateAvailability() already catches what it throws.

Warning

For user shares, removeShare() sends decline to the owner, which deletes their share. A shared folder in the owner's trash bin answers 404 on the root and on shareinfo, same as a deleted share. With this fix those shares are removed on both sides and don't come back if the folder is restored. Keeping them hidden while trashed needs the owner to report a distinct status, that's a separate follow-up.

Unit tests cover test(). Not tested between two real federated instances.

TODO

  • Nothing left

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

👾 This pull request was assisted by Claude Code, commits carry an Assisted-by trailer.

…lity recheck

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv requested a review from a team as a code owner November 30, 2026 10:08
@skjnldsv
skjnldsv requested review from GhassenKefi and pabzm and removed request for a team November 30, 2026 10:08
@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Nov 30, 2026
@skjnldsv skjnldsv self-assigned this Nov 30, 2026
@skjnldsv
skjnldsv requested review from a team, icewind1991 and provokateurin and removed request for a team November 30, 2026 10:43
@skjnldsv

Copy link
Copy Markdown
Member Author

/backport to stable34

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants