ClamAV "Tried to scan non file"

I am getting a lot of the following errors.

{"reqId":"XXXXX","level":4,"time":"2021-09-10T16:43:27+09:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"Tried to scan non file","userAgent":"--","version":"22.1.1.2","id":"YYYYY"}

A large number of the above errors are output and only one error is output as follows.

{"reqId":"qmP8HgkU0rWueFnXAiKl","level":3,"time":"2021-09-10T16:43:26+09:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"File with id \"847\" has not been found.","userAgent":"--","version":"22.1.1.2","exception":{"Exception":"OCP\\Files\\StorageNotAvailableException","Message":"File with id \"847\" has not been found.","Code":0,"Trace":[{"file":"/MY-NEXTCLOUD-DIR/apps/files_sharing/lib/SharedStorage.php","line":434,"function":"acquireLock","class":"OC\\Files\\Storage\\FailedStorage","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/Storage/Wrapper/Wrapper.php","line":591,"function":"acquireLock","class":"OCA\\Files_Sharing\\SharedStorage","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1964,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":2079,"function":"lockPath","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1151,"function":"lockFile","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1005,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/Node/File.php","line":114,"function":"fopen","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Item.php","line":191,"function":"fopen","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Item.php","line":85,"function":"getFileHandle","class":"OCA\\Files_Antivirus\\Item","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Scanner/ScannerBase.php","line":112,"function":"fread","class":"OCA\\Files_Antivirus\\Item","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":336,"function":"scan","class":"OCA\\Files_Antivirus\\Scanner\\ScannerBase","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":122,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/cron.php","line":127,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/MY-NEXTCLOUD-DIR/lib/private/Files/Storage/FailedStorage.php","Line":197,"Hint":"Storage is temporarily not available","Previous":{"Exception":"OCP\\Files\\NotFoundException","Message":"File with id \"847\" has not been found.","Code":0,"Trace":[{"file":"/MY-NEXTCLOUD-DIR/apps/files_sharing/lib/SharedStorage.php","line":132,"function":"getPath","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_sharing/lib/SharedStorage.php","line":493,"function":"init","class":"OCA\\Files_Sharing\\SharedStorage","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/Storage/Wrapper/Jail.php","line":482,"function":"getWrapperStorage","class":"OCA\\Files_Sharing\\SharedStorage","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_sharing/lib/SharedStorage.php","line":433,"function":"resolvePath","class":"OC\\Files\\Storage\\Wrapper\\Jail","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/Storage/Wrapper/Wrapper.php","line":591,"function":"acquireLock","class":"OCA\\Files_Sharing\\SharedStorage","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1964,"function":"acquireLock","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":2079,"function":"lockPath","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1151,"function":"lockFile","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","line":1005,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/Files/Node/File.php","line":114,"function":"fopen","class":"OC\\Files\\View","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Item.php","line":191,"function":"fopen","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Item.php","line":85,"function":"getFileHandle","class":"OCA\\Files_Antivirus\\Item","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/Scanner/ScannerBase.php","line":112,"function":"fread","class":"OCA\\Files_Antivirus\\Item","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":336,"function":"scan","class":"OCA\\Files_Antivirus\\Scanner\\ScannerBase","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":122,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\\BackgroundJob\\Job","type":"->"},{"file":"/MY-NEXTCLOUD-DIR/cron.php","line":127,"function":"execute","class":"OC\\BackgroundJob\\TimedJob","type":"->"}],"File":"/MY-NEXTCLOUD-DIR/lib/private/Files/View.php","Line":1773},"CustomMessage":"--"},"id":"613b0c9f14659"}

I have not been able to figure out when this error occurs, but it seems to happen almost regularly.
Is there a solution to this?

I am using TCPSocket because I could not specify LocalSocket in ClamAV setup. That’s about it for my uncommon setup.


CentOS 7.8, PHP 7.4.22, Nginx 1.20.1, Antivirus for files app 3.2.1

Error files_antivirus OCP\Files\StorageNotAvailableException: File with id “847” has not been found.

I had to go back and look at the logs, but apparently the above “ID: 847” is fixed at this value.

This error is marked as fatal in NC, but is this an error I can ignore?
And is this a problem with ClamAV itself? Or is it NC’s Antivirus for files app?

Is this a very rare error that only occurs on my server?

What anti-virus software do you recommend as an alternative to ClamAV?

I have updated to NC22.2.2 and the situation is no different. Or do I have to do something on the ClamAV side, like set an exception?

Error files_antivirus OCP\Files\StorageNotAvailableException: File with id “847” has not been found.

I know what caused this. I opened the MariaDB SQL file and looked for ID 847. It was a file in a strange state.
The file was viewed in NC’s web UI and the icon was a PDF file, and the file name was the “shared folder name” shared by others.

If I right-click on that strange file, there is an “Exit from this share” menu. When I unshared with all users who have this strange file, the ID847 error stopped.

The remaining problem is the nearly 200 “Tried to scan non file” errors.

{"reqId":"KKg9Rjo4tXa5urwKQPvM","level":4,"time":"2022-04-04T15:50:38+09:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"Tried to scan non file","userAgent":"--","version":"23.0.3.2","id":"624a9894e423a"}

Is there any way to modify the source and force it to bypass this checking process?

I have built a new NC, but I am getting a lot of “Tried to scan non file” errors even with this NC. So it does not seem to be a problem with MariaDB or Data directory configuration.

What is the cause?

Same issue here.
Move to the app GITHUB repo to report this.

My NC log is filled with this error. I get over 100 of the same error repeated every 5 minutes.
I would like to hide the Antivirus error output, even if this Antivirus error is a fatal problem.
Is there any function in NC to suppress the error log output only for certain apps?

Antivirus for Files updated to 4.0 and finally stopped outputting errors.