Skip to content

[Version: 3.13.1] Attachments stuck in "Scanning" status after server crash — no retry on restart #481

Description

@ansgarlichter

Describe the bug
Files uploaded to composition attachment entities can get permanently stuck in Scanning status if the server crashes while a malware scan is in progress. On the next server start, no mechanism exists to detect and retry these orphaned scans.

To Reproduce

  1. Upload a file to an entity that uses the Attachments aspect
  2. Kill the server while ScanAttachmentsFile is being processed (before updateStatus writes Clean/Infected/Failed)
  3. Restart the server
  4. The attachment remains in Scanning status indefinitely — no retry is triggered

Expected behavior
On startup, any attachment rows with status = 'Scanning' should be detected and re-queued for scanning, since the scan that set that status clearly never completed.

Additional context
We implemented a workaround on the application side by hooking into cds.once('served') and querying all @_is_media_data entities for stuck rows, then re-emitting ScanAttachmentsFile for each. However this belongs in the plugin itself.

If you agree with this, I am happy to support further by submitting a PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions