Can't access files in trash bin after upgrade to NC 15.
TypeError: Argument 2 passed to OCA\Files_Trashbin\Trash\TrashItem::__construct() must be of the type string, null given, called in /var/www/nextcloud/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php on line 62
Nextcloud 15.0.0
Ubuntu 16.04
PHP 7.0.32
I have this error too, and I too can't access my Trashcan. I get a circle of death when I try to access the deleted files, and the log entry is repeated.
TypeError: Argument 2 passed to OCA\Files_Trashbin\Trash\TrashItem::__construct() must be of the type string, null given, called in /var/www/html/apps/files_trashbin/lib/Trash/LegacyTrashBackend.php on line 62
Nextcloud 15.0.0
Ubuntu 16.04 (running in an LXC container)
PHP 7.2
I was unable to fix this by restarts / re-logging in etc., so I deleted the account and re-created it. That works again. Not a great solution, but it's working again SO FAR.
UPDATED: Same error re-surfaced, so it's looking to be quite a chronic problem. Deleting accounts and re-opening is not much fun, so I am stuck with this until a fix is issued.
This seems to be related with #13160 and happens here, too.
As a workarround you can delete the trashbin with the occ command.
For Ubuntu und other Debian based systems that should be:
sudo -u www-data php occ trashbin:cleanup --all-users
If you don't want to loose your files in the trashbin you can backup, the data folder, or more specific you only have to backup the files_trashbin folder, in each user directory in the data folder.
Very useful to know that - will save me deleting accounts and getting them re-created - thanks Freshdouble.
Thanks, works as a workaround...
New Nextcloud 15, same thing.
I have the same Problem when I deleted or moved files in a synchronized folder. Doing this directly in the web ui works fine.
Same problem here with Nextcloud 15.0.2 with the error :
TypeError: Return value of OCA\Files_Trashbin\Sabre\AbstractTrash::getSize() must be of the type integer, float returned
Thanks a lot for the workaround.
This helped me on my Nextcloud 15.0.2
iocage console nextcloud
occ trashbin:cleanup --all-users
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see http://php.net/manual/en/book.pcntl.php
The current PHP memory limit is below the recommended value of 512MB.
Remove deleted files for all users
Remove deleted files for users on backend Database
User1
This helps only temporary. As soon as there are files moved again in a synchronized folder it happens again.
can you see if https://github.com/nextcloud/server/pull/13886 fixes the problem
Yes #13886 fix the problem.
Thanks!
Unfortunately I face the same problem with what @dnclain mentioned above. I updated manually from 15.0.2 to 15.0.4, and the error message after a "spinning circle" request for the trash bin starts with"message":{"Exception":"TypeError","Message":"Return value of OCA\Files_Trashbin\Sabre\AbstractTrash::getSize() must be of the type integer, float returned","Code":0,"Trace":[{"file":"\/path_to\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/PropFind.php","line":98,"function":"getSize","class":"OCA\Files_Trashbin\Sabre\AbstractTrash","type":"->","args":[]}`
I've got the same exact problem as @atsag on 15.0.5
Ditto @atsag here on 15.0.5
I accidently removed a bunch of files and no (easy) way to undo this.
Is there an alternate way / workaround to restore deleted directories (preserving directory structure) from trash?
Same thing here, I want to recover from bin.
Most helpful comment
As a workarround you can delete the trashbin with the occ command.
For Ubuntu und other Debian based systems that should be:
sudo -u www-data php occ trashbin:cleanup --all-users
If you don't want to loose your files in the trashbin you can backup, the data folder, or more specific you only have to backup the files_trashbin folder, in each user directory in the data folder.