Can't access to the trashbin

github_issue_filed
nc15
nc14

#1

Nextcloud version : 15.0.2
Operating system and version Debian 9.6
Apache or nginx version : Apache 2.4.25
PHP version : 7.3.1-1

Hello,

I’ve a problem with Nextcloud 15.0.2, I can’t access to the trashbin.
I’ve test with php7.2 and php7.3.

please see the log:

{"reqId":"HG6d2qICbhYydLwJkVj0","level":3,"time":"2019-01-22T19:46:08+00:00","remoteAddr":"206.123.147.73","user":"nameless","app":"remote","method":"PROPFIND","url":"\/remote.php\/dav\/trashbin\/nameless\/trash","message":{"Exception":"TypeError","Message":"Argument 2 passed to OCA\\Files_Trashbin\\Trash\\TrashItem::__construct() must be of the type string, null given, called in \/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/LegacyTrashBackend.php on line 57","Code":0,"Trace":[{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/LegacyTrashBackend.php","line":57,"function":"__construct","class":"OCA\\Files_Trashbin\\Trash\\TrashItem","type":"->","args":["*** sensitive parameter replaced ***",null,1547453857,"\/Logs.d1547453857","*** sensitive parameter replaced ***",{"__class__":"OC\\User\\User"}]},{"function":"OCA\\Files_Trashbin\\Trash\\{closure}","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/LegacyTrashBackend.php","line":55,"function":"array_map","args":[{"__class__":"Closure"},[{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"}]]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/LegacyTrashBackend.php","line":69,"function":"mapTrashItems","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->","args":[[{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"},{"__class__":"OC\\Files\\FileInfo"}],{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashManager.php","line":48,"function":"listTrashRoot","class":"OCA\\Files_Trashbin\\Trash\\LegacyTrashBackend","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"function":"OCA\\Files_Trashbin\\Trash\\{closure}","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashManager.php","line":49,"function":"array_reduce","args":[{"OCP\\Files\\Storage\\IStorage":"*** sensitive parameter replaced ***"},{"__class__":"Closure"},"*** sensitive parameter replaced ***"]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Sabre\/TrashRoot.php","line":68,"function":"listTrashRoot","class":"OCA\\Files_Trashbin\\Trash\\TrashManager","type":"->","args":[{"__class__":"OC\\User\\User"}]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php","line":195,"function":"getChildren","class":"OCA\\Files_Trashbin\\Sabre\\TrashRoot","type":"->","args":[]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":899,"function":"getChildren","class":"Sabre\\DAV\\Tree","type":"->","args":["trashbin\/nameless\/trash"]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":978,"function":"generatePathNodes","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Sabre\\DAV\\PropFind"},[{"__class__":"Sabre\\DAV\\PropFind"},{"__class__":"OCA\\Files_Trashbin\\Sabre\\TrashRoot"}]]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":1666,"function":"getPropertiesIteratorForPath","class":"Sabre\\DAV\\Server","type":"->","args":["trashbin\/nameless\/trash",["{http:\/\/nextcloud.org\/ns}trashbin-filename","{http:\/\/nextcloud.org\/ns}trashbin-deletion-time","{DAV:}getlastmodified","{DAV:}getetag","{DAV:}getcontenttype","{DAV:}resourcetype","{http:\/\/owncloud.org\/ns}fileid","{http:\/\/owncloud.org\/ns}permissions","{http:\/\/owncloud.org\/ns}size","{DAV:}getcontentlength","{http:\/\/nextcloud.org\/ns}has-preview","{http:\/\/nextcloud.org\/ns}mount-type","{http:\/\/nextcloud.org\/ns}is-encrypted","{http:\/\/open-collaboration-services.org\/ns}share-permissions","{http:\/\/owncloud.org\/ns}comments-unread"],1]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php","line":355,"function":"generateMultiStatus","class":"Sabre\\DAV\\Server","type":"->","args":[{"__class__":"Generator"},false]},{"function":"httpPropFind","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https:\/\/cloud.noobie.fr\/remote.php\/dav\/trashbin\/nameless\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpPropFind"],[{"absoluteUrl":"https:\/\/cloud.noobie.fr\/remote.php\/dav\/trashbin\/nameless\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:PROPFIND",[{"absoluteUrl":"https:\/\/cloud.noobie.fr\/remote.php\/dav\/trashbin\/nameless\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https:\/\/cloud.noobie.fr\/remote.php\/dav\/trashbin\/nameless\/trash","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/dav\/lib\/Server.php","line":301,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"\/var\/www\/html\/noobie.fr\/nextcloud\/remote.php","line":163,"args":["\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/dav\/appinfo\/v2\/remote.php"],"function":"require_once"}],"File":"\/var\/www\/html\/noobie.fr\/nextcloud\/apps\/files_trashbin\/lib\/Trash\/TrashItem.php","Line":41,"CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (X11; Fedora; Linux x86_64; rv:64.0) Gecko\/20100101 Firefox\/64.0","version":"15.0.2.0"}


#2

same problem here.

my logs:

    [webdav] Fatal: Sabre\DAV\Exception\UnsupportedMediaType: Validation error in iCalendar: More than one master object was found for the object with UID 6cfcef75-4302-42eb-b7b8-81d11e76fc2c at <<closure>>

 0. /var/www/html/owncloud/3rdparty/sabre/dav/lib/CalDAV/Plugin.php line 772
    validateICalendar("BEGIN:VCALENDAR ... n", "calendars/xxxx ... s", false, Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {}, false)
 1. <<closure>>
    beforeWriteContent("calendars/xxxx ... s", OCA\DAV\CalDAV\CalendarObject {}, "BEGIN:VCALENDAR ... n", false)
 2. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([OCA\DAV\CalDAV\ ... "], ["calendars/pasc ... e])
 3. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1128
    emit("beforeWriteContent", ["calendars/pasc ... e])
 4. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 513
    updateFile("calendars/xxxx ... s", "BEGIN:VCALENDAR ... n", null)
 5. <<closure>>
    httpPut(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 6. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPut"], [Sabre\HTTP\Requ ... }])
 7. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PUT", [Sabre\HTTP\Requ ... }])
 8. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
 9. /var/www/html/owncloud/apps/dav/lib/Server.php line 301
    exec()
10. /var/www/html/owncloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
11. /var/www/html/owncloud/remote.php line 163
    require_once("/var/www/html/o ... p")

PUT /owncloud/remote.php/dav/calendars/xxx/0e9363c8-3985-421f-9669-ddd0cbd5de0c_shared_by_xxxx/6cfcef75-4302-42eb-b7b8-81d11e76fc2c.ics
from 62.102.148.68 by xxx at 2019-01-22T20:20:21+00:00

[remote] Error: TypeError: Return value of OCA\Files_Trashbin\Sabre\AbstractTrash::getSize() must be of the type int, float returned at <<closure>>

 0. /var/www/html/owncloud/apps/files_trashbin/lib/Sabre/PropfindPlugin.php line 78
    getSize()
 1. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/PropFind.php line 98
    OCA\Files_Trashbin\Sabre\{closure}("*** sensitive parameters replaced ***")
 2. /var/www/html/owncloud/apps/files_trashbin/lib/Sabre/PropfindPlugin.php line 79
    handle("{http://owncloud.org/ns}size", Closure {})
 3. <<closure>>
    propFind(Sabre\DAV\PropFind {}, OCA\Files_Trashbin\Sabre\TrashFolder {})
 4. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([OCA\Files_Trash ... "], [Sabre\DAV\PropF ... }])
 5. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1059
    emit("propFind", [Sabre\DAV\PropF ... }])
 6. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 981
    getPropertiesByNode(Sabre\DAV\PropFind {}, OCA\Files_Trashbin\Sabre\TrashFolder {})
 7. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 1666
    getPropertiesIteratorForPath("trashbin/xxxx/trash", ["{http://nextcl ... "], 1)
 8. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/CorePlugin.php line 355
    generateMultiStatus(Generator {}, false)
 9. <<closure>>
    httpPropFind(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
10. /var/www/html/owncloud/3rdparty/sabre/event/lib/EventEmitterTrait.php line 105
    call_user_func_array([Sabre\DAV\CorePlugin {},"httpPropFind"], [Sabre\HTTP\Requ ... }])
11. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 479
    emit("method:PROPFIND", [Sabre\HTTP\Requ ... }])
12. /var/www/html/owncloud/3rdparty/sabre/dav/lib/DAV/Server.php line 254
    invokeMethod(Sabre\HTTP\Reque ... "}, Sabre\HTTP\Response {})
13. /var/www/html/owncloud/apps/dav/lib/Server.php line 301
    exec()
14. /var/www/html/owncloud/apps/dav/appinfo/v2/remote.php line 35
    exec()
15. /var/www/html/owncloud/remote.php line 163
    require_once("/var/www/html/o ... p")

PROPFIND /owncloud/remote.php/dav/trashbin/xxxx/trash
from 87.123.193.166 by xxxx at 2019-01-22T17:26:49+00:10

#3

there seems to be an issue on github 14 days old…


#4

I have the same problem


#5

The solution is on this page:

I fixed it locally by explicitly casting to int in method getSize() in AbstractTrash.php. It now looks like this now:

public function getSize(): int {
   return (int)$this->data->getSize();
}

Can you please include this in the code of Nextcloud?


#6

That fix works for me. Thanks for posting it!