I have thousands of errors like these in my system log: kdeinit5[5195]: kf5.kio.trash: couldn't stat "/home/bjourne/.local/share/Trash/files/generator.m" kdeinit5[28666]: kf5.kio.trash: couldn't stat "/home/bjourne/.local/share/Trash/files/svt" These are files I deleted months or even years ago the old fashioned way using rm .local/share/Trash/* so I don't understand why KDE keeps a record of them. Since it sometimes tries to stat thousands of files per second it completely freezes my computer for the duration.
The records are kept because IIUC users are supposed to be able to restore deleted files from the Trash. Examine ~/.local/share/Trash/info/* and ~/.local/share/Trash/directorysizes I don't think this is a bug, you basically deleted the files in the Trash, without telling kio_trash about it... :)
(In reply to Ahmad Samir from comment #1) > The records are kept because IIUC users are supposed to be able to restore > deleted files from the Trash. Exact > > Examine ~/.local/share/Trash/info/* and ~/.local/share/Trash/directorysizes > > I don't think this is a bug, you basically deleted the files in the Trash, > without telling kio_trash about it... :) Still we tru to dectect orhpaned files such as here where we have the metadata but not the files. Your bug shows it does not clean its record, once it has noticed the files are orphaned, since this repeats or at least not correctly.
(In reply to Méven Car from comment #2) [..] > > Still we tru to dectect orhpaned files such as here where we have the > metadata but not the files. Your bug shows it does not clean its record, > once it has noticed the files are orphaned, since this repeats or at least > not correctly. Good point, non-existing files should indeed be removed from the Trash records/info.
Git commit 73cc5a82de887b197ddfd35e0dce3d1a34d5eb47 by Méven Car, on behalf of Ahmad Samir. Committed on 16/06/2020 at 08:59. Pushed by meven into branch 'master'. [Trash] Remove trashinfo files referencing files/dirs that don't exist If the user moves a file to trash, the deletes that file without using kio_trash (e.g. with rm), then the relevant trashinfo file should be deleted the next time we try to list/stat that trashed file; otherwise kio_trash keep trying to stat that file every time the Trash dir is stat'ed/listed. The testtrash unit test still passes. Thanks to meven for pointing out how to fix this bug. FIXED-IN: 5.72 M +2 -1 src/ioslaves/trash/kio_trash.cpp M +24 -0 src/ioslaves/trash/tests/testtrash.cpp M +1 -0 src/ioslaves/trash/tests/testtrash.h https://invent.kde.org/frameworks/kio/commit/73cc5a82de887b197ddfd35e0dce3d1a34d5eb47