Skip to content

File is not removed by background job (no user backend) #297

@Rello

Description

@Rello

Steps to reproduce

  1. create an invected file in files
  2. wait for the next background job
  3. see the logs

Expected behaviour

  • Activity entry that the file was deleted
  • The file is actually removed

Actual behaviour

  • Activity entry that the file was deleted
  • The file is not removed
  • error recorded in the logfile

Server configuration

Operating system:

Web server:

Database:

PHP version:

Nextcloud version: (see Nextcloud admin page)

Where did you install Nextcloud from:

List of activated apps:

Antivirus 5.2.2

Nextcloud configuration:

27.1.1

Client configuration

Browser:

Operating system:

Logs

Nextcloud log (data/owncloud.log)

{"reqId":"8Wpusbh03HOjgudHD2JQ","level":3,"time":"2023-10-20T10:53:02+02:00","remoteAddr":"","user":"--","app":"files_antivirus","method":"","url":"--","message":"Infected file deleted (during background scan) Type=0; Resolution=2; Threat=Win.Test.EICAR_HDB-1; File: 808 Account: bced5c02-f2da-103d-8627-579fb31c2125 Path: /bced5c02-f2da-103d-8627-579fb31c2125/files/Eicar.com.txt","userAgent":"--","version":"27.1.1.0","data":{"app":"files_antivirus"}}


{"reqId":"8Wpusbh03HOjgudHD2JQ","level":3,"time":"2023-10-20T10:53:02+02:00","remoteAddr":"","user":"--","app":"files","method":"","url":"--","message":"Backends provided no user object for ","userAgent":"--","version":"27.1.1.0","exception":{"Exception":"OC\\User\\NoUserException","Message":"Backends provided no user object","Code":0,"Trace":[{"function":"getUserFolder","class":"OC\\Files\\Node\\Root","type":"->","args":[false]},{"file":"/var/www/html/lib/private/Files/Node/LazyFolder.php","line":74,"function":"call_user_func_array","args":[[["OC\\Files\\Node\\Root"],"getUserFolder"],[false]]},{"file":"/var/www/html/lib/private/Files/Node/LazyRoot.php","line":40,"function":"__call","class":"OC\\Files\\Node\\LazyFolder","type":"->","args":["getUserFolder",[false]]},{"file":"/var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php","line":359,"function":"getUserFolder","class":"OC\\Files\\Node\\LazyRoot","type":"->","args":[false]},{"file":"/var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php","line":295,"function":"getPathForNode","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->","args":[["OC\\Files\\Node\\File"]]},{"file":"/var/www/html/apps/files_versions/lib/Listener/FileEventsListener.php","line":116,"function":"pre_remove_hook","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->","args":[["OC\\Files\\Node\\File"]]},{"file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php","line":86,"function":"handle","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->","args":[["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"]]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":251,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->","args":[["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"],"OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent",["Symfony\\Component\\EventDispatcher\\EventDispatcher"]]},{"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":73,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[[["Closure"],["Closure"],["Closure"]],"OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent",["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"]]},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":94,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->","args":[["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"],"OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"]},{"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php","line":106,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent",["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"]]},{"file":"/var/www/html/lib/private/Files/Node/HookConnector.php","line":149,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->","args":[["OCP\\Files\\Events\\Node\\BeforeNodeDeletedEvent"]]},{"file":"/var/www/html/lib/private/legacy/OC_Hook.php","line":105,"function":"delete","class":"OC\\Files\\Node\\HookConnector","type":"->","args":[[true,"/Eicar.com.txt"]]},{"file":"/var/www/html/lib/private/Files/View.php","line":1270,"function":"emit","class":"OC_Hook","type":"::","args":["OC_Filesystem","delete",[true,"/Eicar.com.txt"]]},{"file":"/var/www/html/lib/private/Files/View.php","line":1144,"function":"runHooks","class":"OC\\Files\\View","type":"->","args":[["delete"],"/Eicar.com.txt"]},{"file":"/var/www/html/lib/private/Files/View.php","line":702,"function":"basicOperation","class":"OC\\Files\\View","type":"->","args":["unlink","/bced5c02-f2da-103d-8627-579fb31c2125/files/Eicar.com.txt",["delete"]]},{"file":"/var/www/html/lib/private/Files/Node/File.php","line":133,"function":"unlink","class":"OC\\Files\\View","type":"->","args":["/bced5c02-f2da-103d-8627-579fb31c2125/files/Eicar.com.txt"]},{"file":"/var/www/html/custom_apps/files_antivirus/lib/Item.php","line":217,"function":"delete","class":"OC\\Files\\Node\\File","type":"->","args":[]},{"file":"/var/www/html/custom_apps/files_antivirus/lib/Item.php","line":118,"function":"deleteFile","class":"OCA\\Files_Antivirus\\Item","type":"->","args":[]},{"file":"/var/www/html/custom_apps/files_antivirus/lib/Status.php","line":164,"function":"processInfected","class":"OCA\\Files_Antivirus\\Item","type":"->","args":[["OCA\\Files_Antivirus\\Status"]]},{"file":"/var/www/html/custom_apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":274,"function":"dispatch","class":"OCA\\Files_Antivirus\\Status","type":"->","args":[["OCA\\Files_Antivirus\\Item"]]},{"file":"/var/www/html/custom_apps/files_antivirus/lib/BackgroundJob/BackgroundScanner.php","line":144,"function":"scanOneFile","class":"OCA\\Files_Antivirus\\BackgroundJob\\BackgroundScanner","type":"->","args":[["OC\\Files\\Node\\File"]]},

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    📄 To do (~10 entries)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions