Skip to content

fix(files): Continue scanning after StorageInvalidException - #65585

Open
DerDreschner wants to merge 1 commit into
masterfrom
fix/prevent-crash-on-stale-fed-shares
Open

DerDreschner wants to merge 1 commit into
masterfrom
fix/prevent-crash-on-stale-fed-shares

Conversation

@DerDreschner

Copy link
Copy Markdown
Contributor

Summary

When a federated share was already removed on the remote end, accessing it triggers a StorageInvalidException after the share and its mount are removed locally. When running occ files:scan, this exception isn't caught by the scanner and aborts the scan of all remaining mounts of that user, printing a stack trace instead. This can be pretty frustrating on larger instances with many federated shares.

To avoid that, the StorageInvalidException is now caught and handled the same way as the StorageNotAvailableException: log it as an error, report it through the StorageNotAvailable hook and continue with the next mount.

Checklist

AI (if applicable)

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

When a federated share was already removed on the remote end, accessing it triggers a `StorageInvalidException` after the share and its mount are removed locally. When running `occ files:scan`, this exception isn't caught by the scanner and aborts the scan of all remaining mounts of that user, printing a stack trace instead. This can be pretty frustrating on larger instances with many federated shares.

To avoid that, the `StorageInvalidException` is now caught and handled the same way as the `StorageNotAvailableException`: log it as an error, report it through the `StorageNotAvailable` hook and continue with the next mount.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: David Dreschner <david.dreschner@nextcloud.com>
@DerDreschner DerDreschner self-assigned this Oct 16, 2026
@DerDreschner
DerDreschner requested a review from a team as a code owner October 16, 2026 14:34
@DerDreschner
DerDreschner requested review from Altahrim, provokateurin, salmart-dev and sorbaugh and removed request for a team October 16, 2026 14:34

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.

occ files:scan crashes on stale federated shares after remote deletion

2 participants