Can´t delete file uploaded to shared external folder - "NoUserException"
Steps to reproduce
- Share a folder, which is hooked into nextcloud via external storage (local filesystem mount)
- Upload a file to that folder (via the shared link, so no user is logged in currently)
- Try and delete the file
Expected behaviour
The upload should succeed. Deletion should succeed.
Actual behaviour
Upload succeeds, but throws an exception. Uploaded file cannot be removed from nextcloud
Server configuration
Operating system: Ubuntu 16.04.1, arm32 SBC Web server: Apache2 Database: mySQL PHP version: 7.0 Nextcloud version: 11.0.1
Are you using external storage, if yes which one: local/smb/sftp/... local Are you using encryption: yes/no no
Client configuration
Browser: Chrome 55 Operating system: Mac OS
Logs
Nextcloud log (data/nextcloud.log)
Nextcloud log
{"reqId":"l8MpoXuxSTQoLLgd3jqg","remoteAddr":"127.0.0.1","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"Attempted to initialize mount points for null user and no user in session\",\"Code\":0,\"Trace\":\"#0 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(520): OC\\\\Files\\\\Filesystem::initMountPoints(false)\\n#1 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(155): OCA\\\\Activity\\\\FilesHooks->getSourcePathAndOwner('\\\/Media-Netzwerk...')\\n#2 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooks.php(130): OCA\\\\Activity\\\\FilesHooks->addNotificationsForFileAction('\\\/Media-Netzwerk...', 'file_deleted', 'deleted_self', 'deleted_by')\\n#3 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/activity\\\/lib\\\/FilesHooksStatic.php(61): OCA\\\\Activity\\\\FilesHooks->fileDelete('\\\/Media-Netzwerk...')\\n#4 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/hook.php(106): OCA\\\\Activity\\\\FilesHooksStatic::fileDelete(Array)\\n#5 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1235): OC_Hook::emit('OC_Filesystem', 'delete', Array)\\n#6 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1113): OC\\\\Files\\\\View->runHooks(Array, '\\\/Media-Netzwerk...')\\n#7 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(695): OC\\\\Files\\\\View->basicOperation('unlink', '\\\/Freeride-Guide...', Array)\\n#8 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(334): OC\\\\Files\\\\View->unlink('\\\/Freeride-Guide...')\\n#9 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->delete()\\n#10 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('Freeride-GuideB...')\\n#11 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#12 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#13 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#14 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#15 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#16 \\\/media\\\/data\\\/www\\\/nextcloud\\\/public.php(77): require_once('\\\/media\\\/data\\\/www...')\\n#17 {main}\",\"File\":\"\\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php\",\"Line\":399}","level":3,"time":"January 25, 2017 22:28:46","method":"DELETE","url":"\/public.php\/webdav\/Freeride-GuideBook_DE.pdf","user":"--","version":"11.0.1.2"}
{"reqId":"l8MpoXuxSTQoLLgd3jqg","remoteAddr":"127.0.0.1","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"Attempted to initialize mount points for null user and no user in session\",\"Code\":0,\"Trace\":\"#0 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(91): OC\\\\Files\\\\Filesystem::initMountPoints(false)\\n#1 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(68): OCA\\\\Files_Trashbin\\\\Trashbin::getUidAndFilename('\\\/Media-Netzwerk...')\\n#2 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/hook.php(106): OCA\\\\Files_Trashbin\\\\Trashbin::ensureFileScannedHook(Array)\\n#3 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1235): OC_Hook::emit('OC_Filesystem', 'delete', Array)\\n#4 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1113): OC\\\\Files\\\\View->runHooks(Array, '\\\/Media-Netzwerk...')\\n#5 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(695): OC\\\\Files\\\\View->basicOperation('unlink', '\\\/Freeride-Guide...', Array)\\n#6 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(334): OC\\\\Files\\\\View->unlink('\\\/Freeride-Guide...')\\n#7 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->delete()\\n#8 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('Freeride-GuideB...')\\n#9 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#10 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#11 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#12 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#13 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#14 \\\/media\\\/data\\\/www\\\/nextcloud\\\/public.php(77): require_once('\\\/media\\\/data\\\/www...')\\n#15 {main}\",\"File\":\"\\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php\",\"Line\":399}","level":3,"time":"January 25, 2017 22:28:46","method":"DELETE","url":"\/public.php\/webdav\/Freeride-GuideBook_DE.pdf","user":"--","version":"11.0.1.2"}
{"reqId":"l8MpoXuxSTQoLLgd3jqg","remoteAddr":"127.0.0.1","app":"no app in context","message":"Exception: {\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Message\":\"Attempted to initialize mount points for null user and no user in session\",\"Code\":0,\"Trace\":\"#0 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_versions\\\/lib\\\/Storage.php(104): OC\\\\Files\\\\Filesystem::initMountPoints(false)\\n#1 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_versions\\\/lib\\\/Storage.php(207): OCA\\\\Files_Versions\\\\Storage::getUidAndFilename('\\\/Media-Netzwerk...')\\n#2 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_versions\\\/lib\\\/Hooks.php(91): OCA\\\\Files_Versions\\\\Storage::markDeletedFile('\\\/Media-Netzwerk...')\\n#3 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/legacy\\\/hook.php(106): OCA\\\\Files_Versions\\\\Hooks::pre_remove_hook(Array)\\n#4 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1235): OC_Hook::emit('OC_Filesystem', 'delete', Array)\\n#5 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1113): OC\\\\Files\\\\View->runHooks(Array, '\\\/Media-Netzwerk...')\\n#6 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(695): OC\\\\Files\\\\View->basicOperation('unlink', '\\\/Freeride-Guide...', Array)\\n#7 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(334): OC\\\\Files\\\\View->unlink('\\\/Freeride-Guide...')\\n#8 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->delete()\\n#9 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('Freeride-GuideB...')\\n#10 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#11 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#12 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#13 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#14 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#15 \\\/media\\\/data\\\/www\\\/nextcloud\\\/public.php(77): require_once('\\\/media\\\/data\\\/www...')\\n#16 {main}\",\"File\":\"\\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php\",\"Line\":399}","level":3,"time":"January 25, 2017 22:28:46","method":"DELETE","url":"\/public.php\/webdav\/Freeride-GuideBook_DE.pdf","user":"--","version":"11.0.1.2"}
{"reqId":"l8MpoXuxSTQoLLgd3jqg","remoteAddr":"127.0.0.1","app":"webdav","message":"Exception: {\"Message\":\"Attempted to initialize mount points for null user and no user in session\",\"Exception\":\"OC\\\\User\\\\NoUserException\",\"Code\":0,\"Trace\":\"#0 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(91): OC\\\\Files\\\\Filesystem::initMountPoints(false)\\n#1 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Trashbin.php(205): OCA\\\\Files_Trashbin\\\\Trashbin::getUidAndFilename('Media-Netzwerk\\\/...')\\n#2 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Storage.php(161): OCA\\\\Files_Trashbin\\\\Trashbin::move2trash('Media-Netzwerk\\\/...')\\n#3 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_trashbin\\\/lib\\\/Storage.php(96): OCA\\\\Files_Trashbin\\\\Storage->doDelete('Bilder\\\/2017 - W...', 'unlink')\\n#4 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Storage\\\/Wrapper\\\/Wrapper.php(261): OCA\\\\Files_Trashbin\\\\Storage->unlink('Bilder\\\/2017 - W...')\\n#5 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/files_accesscontrol\\\/lib\\\/StorageWrapper.php(270): OC\\\\Files\\\\Storage\\\\Wrapper\\\\Wrapper->unlink('Bilder\\\/2017 - W...')\\n#6 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(1124): OCA\\\\FilesAccessControl\\\\StorageWrapper->unlink('Bilder\\\/2017 - W...')\\n#7 \\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/View.php(695): OC\\\\Files\\\\View->basicOperation('unlink', '\\\/Freeride-Guide...', Array)\\n#8 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/lib\\\/Connector\\\/Sabre\\\/File.php(334): OC\\\\Files\\\\View->unlink('\\\/Freeride-Guide...')\\n#9 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(179): OCA\\\\DAV\\\\Connector\\\\Sabre\\\\File->delete()\\n#10 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(287): Sabre\\\\DAV\\\\Tree->delete('Freeride-GuideB...')\\n#11 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpDelete(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#12 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#13 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:DELETE', Array)\\n#14 \\\/media\\\/data\\\/www\\\/nextcloud\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#15 \\\/media\\\/data\\\/www\\\/nextcloud\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/publicwebdav.php(104): Sabre\\\\DAV\\\\Server->exec()\\n#16 \\\/media\\\/data\\\/www\\\/nextcloud\\\/public.php(77): require_once('\\\/media\\\/data\\\/www...')\\n#17 {main}\",\"File\":\"\\\/media\\\/data\\\/www\\\/nextcloud\\\/lib\\\/private\\\/Files\\\/Filesystem.php\",\"Line\":399,\"User\":false}","level":4,"time":"January 25, 2017 22:28:46","method":"DELETE","url":"\/public.php\/webdav\/Freeride-GuideBook_DE.pdf","user":"--","version":"11.0.1.2"}
Seems to be an error with the trashbin. The other issues are then caused by this. However I can not reproduce.
{
"reqId": "l8MpoXuxSTQoLLgd3jqg",
"remoteAddr": "127.0.0.1",
"app": "webdav",
"message": {
"Exception": {
"Message": "Attempted to initialize mount points for null user and no user in session",
"Exception": "OC\User\NoUserException",
"Code": 0,
"Trace": {
"#0": [
"/media/data/www/nextcloud/apps/files_trashbin/lib/Trashbin.php(91):",
"OC\Files\Filesystem::initMountPoints(false)"
],
"#1": [
"/media/data/www/nextcloud/apps/files_trashbin/lib/Trashbin.php(205):",
"OCA\Files_Trashbin\Trashbin::getUidAndFilename('Media-Netzwerk/...')"
],
"#2": [
"/media/data/www/nextcloud/apps/files_trashbin/lib/Storage.php(161):",
"OCA\Files_Trashbin\Trashbin::move2trash('Media-Netzwerk/...')"
],
"#3": [
"/media/data/www/nextcloud/apps/files_trashbin/lib/Storage.php(96): OCA\Files_Trashbin\Storage->doDelete('Bilder/2017 - W...', 'unlink')",
null
],
"#4": [
"/media/data/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php(261): OCA\Files_Trashbin\Storage->unlink('Bilder/2017 - W...')",
null
],
"#5": [
"/media/data/www/nextcloud/apps/files_accesscontrol/lib/StorageWrapper.php(270): OC\Files\Storage\Wrapper\Wrapper->unlink('Bilder/2017 - W...')",
null
],
"#6": [
"/media/data/www/nextcloud/lib/private/Files/View.php(1124): OCA\FilesAccessControl\StorageWrapper->unlink('Bilder/2017 - W...')",
null
],
"#7": [
"/media/data/www/nextcloud/lib/private/Files/View.php(695): OC\Files\View->basicOperation('unlink', '/Freeride-Guide...', Array)",
null
],
"#8": [
"/media/data/www/nextcloud/apps/dav/lib/Connector/Sabre/File.php(334):",
"OC\Files\View->unlink('/Freeride-Guide...')"
],
"#9": [
"/media/data/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Tree.php(179):",
"OCA\DAV\Connector\Sabre\File->delete()"
],
"#10": [
"/media/data/www/nextcloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php(287):",
"Sabre\DAV\Tree->delete('Freeride-GuideB...')"
],
"#11": [
"[internal function]: Sabre\DAV\CorePlugin->httpDelete(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))",
null
],
"#12": [
"/media/data/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php(105): call_user_func_array(Array, Array)",
null
],
"#13": [
"/media/data/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(479): Sabre\Event\EventEmitter->emit('method:DELETE', Array)",
null
],
"#14": [
"/media/data/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php(254): Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))",
null
],
"#15": [
"/media/data/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php(104):",
"Sabre\DAV\Server->exec()"
],
"#16": [
"/media/data/www/nextcloud/public.php(77):",
"require_once('/media/data/www...')"
],
"#17": [
"{main}",
null
]
},
"File": "/media/data/www/nextcloud/lib/private/Files/Filesystem.php",
"Line": 399,
"User": false
}
},
"level": 4,
"time": "January 25, 2017 22:28:46",
"method": "DELETE",
"url": "/public.php/webdav/Freeride-GuideBook_DE.pdf",
"user": "--",
"version": "11.0.1.2"
}
As I cannot reproduce the original issue anymore, I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.