Can't access to the trashbin

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

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

1 Like

I have the same problem

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?

That fix works for me. Thanks for posting it!

Has this change already made it to one of the official images yet?

How am I supposed to act now when I have that problem?
I can’t edit the AbstractTrash.php because it is a read only File and I don’t wanna change this on my own in any way.
I am running it on a RPi4 with a 16.0.5 Nextcloud Version.

I think there are two options:

  • Wait until the problem has been fixed in a coming release.
  • Apply the given path to the file. It is usually easy to change the read-only- state of the file to read/write, edit the file, and revert the access files to read-only again.

Thank you j-ed for the answer, I was able to empty the trashbin through the mobile app, regardless of the app not being able to display the files in the trashbin.

Yes, this code solve my issue of trash bin not showing files problem. I’m using nextcloud v17.0.3.

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();
}

hello, i have some problem. how to change my file?

It was easy for me to do this! Follow this steps and on my server it works!

  1. Deactivate APP Deletet Files
  2. Reboot your Nextcloud
  3. Activate APP Deletet Files
  4. Delete one File
  5. Trashbin was working

Funktioniert bei mir leider nicht. Ich verwende einen Raspberry pi 4 und Nextcloud 18.
Ich bin gerade draufgekommen das mir ein ganzer Ordner Bilder abgeht und wollte ihn im gelöschten Ordner suchen dieser lässt sich aber nicht öffnen… Ich möchte jetzt ungern was verändern falls es da noch was zu retten gibt

Öffne eine Shell und schaue in das data/[user]/files_trashbin/files-Verzeichnis. Dort solltest Du alle gelöschten Dateien finden.

Danke für den Tipp habe Leider die Dateien nicht finden können die ich suchte. Aber das hilft schon mal weiter :slight_smile:

I just solved it with this method in the latest version of Nextcloud for rpi 3,
ORIGINAL
public function getSize(): int {
return $this->data->getSize();
}
CORRECTED
public function getSize(): int {
return (int)$this->data->getSize();
}

the path for which you don’t know it is :
/var/www/nextcloud/apps/files_trashbin/lib/Sabre/AbstractTrash.php
Thanks

5 Likes

Worked for me. Thank you very much

For some reason, the problem just occurred again. Thanks for your tip, by forcing (int) the error message no longer appears and I can access my trash again! Hurray!

1 Like

My System is Raspi 3 with Raspian Buster. NextCloud Version 21.0.1

The Bug with the Trash is still there. On my system it occurred, when I added external smb storage from a Synology box.

The described fix from fernandoJG worked for me as well.
One would be enforced to repeat that every time after an update.

How can this fix be integrated into the official fork?

Best regards and many thanks for the solution.

My System is Raspberry Pi 4 Model B Rev 1.1 with Raspian Buster.

The Bug with the Trash is still there in NextCloud Version 21.0.11

The described fix worked for me as well.

Best regards and many thanks for posting it!