Skip to content

[Version: 3.12.0] Files stuck in status 'Scanning' after malware scanner found the file 'Clean' #432

@mrjgavdilabs

Description

@mrjgavdilabs

Describe the bug
Sometimes (seemingly at random) the malware scanner will scan the file, find nothing wrong, set the status to 'Clean' and then immediately after set the status to 'Scanning'. This can also be seen in the logs attached below.

To Reproduce
Steps to reproduce the behavior:
I updated the status of 10-15 files in my postgres db to 'Clean' and the lastScan date to be older than the scanExpiryMs, so I could retrigger the malware scan when reading the files' content from my app's UI, a simple read of the files' content would do the same I imagine. Each time 0-4 of the files would get stuck in status 'Scanning' - and it was not the same files either.
I hoped the automatic retry in version 3.12.0 would solve this issue, but it does not seem to be related to too many requests. Anyway, this is my package.json config:

	"cds": {
		"requires": {
			"malwareScanner": {
				"retry": {
					"maxAttempts": 5,
					"initialDelay": 1000,
					"maxDelay": 30000,
					"maxConcurrentScans": 30
				},
				"vcap": {
					"label": "malware-scanner"
				}
			},
			"attachments": {
				"scanExpiryMs": 1296000000
			},
        ...

Expected behavior
I would expect that the a clean file would end up with the 'Clean' status.
It also does not make sense to me, that in order to trigger a re-scan of the document, it must be in status 'Clean' already and lastScan > scanExpiryMs.
Ideally, clean files would show as clean. Alternatively, scanning files that are not in status 'Clean' would fix this issue. In my mind those files are the obvious candidates anyway.

[ ] is it a regression issue?

Screenshots

Image Chronological from bottom to top, the pink ID is the file's ID in postgres.

Customer Info
You can reach me at mrj@pxmsoft.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions