Skip to content

fix(cron): do not abort cleanup job when attachments cannot be deleted - #9514

Merged
silverkszlo merged 1 commit into
mainfrom
fix/attachment-cleanup-job
Nov 3, 2026
Merged

silverkszlo merged 1 commit into
mainfrom
fix/attachment-cleanup-job

Conversation

@silverkszlo

Copy link
Copy Markdown
Collaborator

📝 Summary

The log is flooded by this error:

NotPermittedExceptionError while running background job OCA\Text\Cron\Cleanup (id: 63508, arguments: null)

The cleanup job runs every 5 minutes and can't remove unreferenced/unused attachments in folders without delete permission. The exception isn't caught, so the job aborts, logs the error and skips the rest of its cleanup work. And because the document stays on the job's list, the job tries it again on every run and fails the same way each time.

Log a warning instead and mark the document, so it is only retried after it has been saved again.

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

🤖 AI

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Signed-off-by: silver <s.szmajduch@posteo.de>
Assisted-by: ClaudeCode:claude-opus-5.5
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 3, 2026

@max-nextcloud max-nextcloud left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks!

@silverkszlo

Copy link
Copy Markdown
Collaborator Author

CI failure is unrelated

@silverkszlo
silverkszlo merged commit 42148e1 into main Nov 3, 2026
69 of 73 checks passed
@silverkszlo
silverkszlo deleted the fix/attachment-cleanup-job branch November 3, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants