Activity is not published with server side encryption enabled
Description
When server side encryption is enabled, drop_account app is unable to publish activities which notifies admins that an account was deleted.
How to reproduce?
- Enable SSE in any NC instance (tested on NC:21 and NC:22)
- Install and enable drop_account app (tested on 1.0.2 and 2.0.0)
- Now create a new account
- Delete this new accounts by logging in > settings > delete account > confirm deletion
- Run php cron.php (from /html directory)
- Find the below error log in nextcloud.log
{
"reqId":"8QejJPpv33KDHEvWT0Kg",
"level":3,
"time":"2022-04-27T19:32:20+00:00",
"remoteAddr":"",
"user":"--",
"app":"drop_account",
"method":"",
"url":"--",
"message":"There has been an issue sending the delete activity to admins",
"userAgent":"--",
"version":"22.2.6.2",
"exception":{
"Exception":"BadMethodCallException",
"Message":"path needs to be relative to the system wide data folder and point to a user specific file",
"Code":0,
"Trace":[
{
"file":"/var/www/html/lib/private/Encryption/Keys/Storage.php",
"line":367,
"function":"getUidAndFilename",
"class":"OC\\Encryption\\Util",
"type":"->",
"args":[
"/testusername"
]
},
{
"file":"/var/www/html/lib/private/Encryption/Keys/Storage.php",
"line":189,
"function":"getFileKeyDir",
"class":"OC\\Encryption\\Keys\\Storage",
"type":"->",
"args":[
"",
"/testusername"
]
},
{
"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Encryption.php",
"line":315,
"function":"deleteAllFileKeys",
"class":"OC\\Encryption\\Keys\\Storage",
"type":"->",
"args":[
"/testusername"
]
},
{
"function":"rmdir",
"class":"OC\\Files\\Storage\\Wrapper\\Encryption",
"type":"->",
"args":[
""
]
},
{
"file":"/var/www/html/apps/files_trashbin/lib/Storage.php",
"line":193,
"function":"call_user_func",
"args":[
[
{
"cache":null,
"scanner":null,
"watcher":null,
"propagator":null,
"updater":null,
"__class__":"OC\\Files\\Storage\\Wrapper\\Encryption"
},
"rmdir"
],
""
]
},
{
"file":"/var/www/html/apps/files_trashbin/lib/Storage.php",
"line":125,
"function":"doDelete",
"class":"OCA\\Files_Trashbin\\Storage",
"type":"->",
"args":[
"",
"rmdir"
]
},
{
"file":"/var/www/html/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php",
"line":72,
"function":"rmdir",
"class":"OCA\\Files_Trashbin\\Storage",
"type":"->",
"args":[
""
]
},
{
"file":"/var/www/html/lib/private/EventDispatcher/ServiceEventListener.php",
"line":75,
"function":"handle",
"class":"OC\\Authentication\\Listeners\\UserDeletedFilesCleanupListener",
"type":"->",
"args":[
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
}
]
},
{
"file":"/var/www/html/3rdparty/symfony/event-dispatcher/EventDispatcher.php",
"line":251,
"function":"__invoke",
"class":"OC\\EventDispatcher\\ServiceEventListener",
"type":"->",
"args":[
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
},
"OCP\\User\\Events\\UserDeletedEvent",
{
"__class__":"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":[
[
{
"__class__":"Closure"
},
{
"__class__":"Closure"
},
{
"__class__":"Closure"
},
{
"__class__":"Closure"
},
{
"__class__":"Closure"
},
"And 4 more entries, set log level to debug to see all entries"
],
"OCP\\User\\Events\\UserDeletedEvent",
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
}
]
},
{
"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
"line":88,
"function":"dispatch",
"class":"Symfony\\Component\\EventDispatcher\\EventDispatcher",
"type":"->",
"args":[
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
},
"OCP\\User\\Events\\UserDeletedEvent"
]
},
{
"file":"/var/www/html/lib/private/EventDispatcher/EventDispatcher.php",
"line":100,
"function":"dispatch",
"class":"OC\\EventDispatcher\\EventDispatcher",
"type":"->",
"args":[
"OCP\\User\\Events\\UserDeletedEvent",
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
}
]
},
{
"file":"/var/www/html/lib/private/User/User.php",
"line":301,
"function":"dispatchTyped",
"class":"OC\\EventDispatcher\\EventDispatcher",
"type":"->",
"args":[
{
"__class__":"OCP\\User\\Events\\UserDeletedEvent"
}
]
},
{
"file":"/var/www/html/custom_apps/drop_account/lib/Service/DeleteAccountDataService.php",
"line":81,
"function":"delete",
"class":"OC\\User\\User",
"type":"->",
"args":[
]
},
{
"file":"/var/www/html/custom_apps/drop_account/lib/BackgroundJob/DeleteAccountData.php",
"line":50,
"function":"delete",
"class":"OCA\\DropAccount\\Service\\DeleteAccountDataService",
"type":"->",
"args":[
"testusername"
]
},
{
"file":"/var/www/html/lib/public/BackgroundJob/Job.php",
"line":79,
"function":"run",
"class":"OCA\\DropAccount\\BackgroundJob\\DeleteAccountData",
"type":"->",
"args":[
{
"uid":"testusername"
}
]
},
{
"file":"/var/www/html/lib/public/BackgroundJob/QueuedJob.php",
"line":47,
"function":"execute",
"class":"OCP\\BackgroundJob\\Job",
"type":"->",
"args":[
{
"__class__":"OC\\BackgroundJob\\JobList"
},
{
"__class__":"OC\\Log"
}
]
},
{
"file":"/var/www/html/cron.php",
"line":149,
"function":"execute",
"class":"OCP\\BackgroundJob\\QueuedJob",
"type":"->",
"args":[
{
"__class__":"OC\\BackgroundJob\\JobList"
},
{
"__class__":"OC\\Log"
}
]
}
],
"File":"/var/www/html/lib/private/Encryption/Util.php",
"Line":233,
"CustomMessage":"There has been an issue sending the delete activity to admins"
}
}