Bug 406087 - akonadictl fsck incorrectly reports success when file_lost+found folder is absent
Summary: akonadictl fsck incorrectly reports success when file_lost+found folder is ab...
Status: RESOLVED FIXED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-31 16:25 UTC by Brendon Higgins
Modified: 2019-04-27 12:53 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.10.1
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brendon Higgins 2019-03-31 16:25:05 UTC
SUMMARY

I ran akonadictl fsck, it reported:
Found unreferenced external file: [...]
[...]
Moved 893 unreferenced files to lost+found.

However, I had deleted the entire file_lost+found folder after the last time I did such a clean-up, assuming akonadi would recreate it when necessary. Not so, apparently. The folder still doesn't exist after running akonadictl fsck. The files have not moved. If I re-run akonadictl fsck, it reports the same unreferenced files, and that (again) it moved them to lost+found. Looks like storagejanitor.cpp neglects to check that the folder exists or the result of the call to QFile::rename(), and so incorrectly reports success when the operation actually fails.

akonadictl fsck works correctly after I create the folder.

EXPECTED RESULT

Create file_lost+found folder automatically and/or report failure to move the files, not success.

ADDITIONAL INFORMATION

akonadictl --version reports 5.9.3 (apparently missing from the version list).
Comment 1 Martin Steigerwald 2019-04-27 08:30:21 UTC
Thank you for your report, Brendon. I can confirm this with PostgreSQL as database backend. Using same Akonadi version 5.9.3 (KDEPIM/Akonadi 18.04) on Debian Sid.

akonadictl fsck does not move any files to lost+found, it does not even create the directory.
Comment 2 Martin Steigerwald 2019-04-27 08:39:02 UTC
I also reported a bug about those unreferenced files to begin with: 

Bug 406958 Unreferenced files in file_db_data
Comment 3 Martin Steigerwald 2019-04-27 08:42:15 UTC
Sorry 5.9.3 is KDEPIM/Akonadi 18.08.
Comment 4 Wolfgang Bauer 2019-04-27 10:09:38 UTC
(In reply to Martin Steigerwald from comment #1)
> akonadictl fsck does not move any files to lost+found, it does not even
> create the directory.

This should be fixed in 18.12.1 (Akonadi version 5.10.1) though:
https://cgit.kde.org/akonadi.git/commit/?h=Applications/18.12&id=28f2916db1a2ad98b00250eb4d5dd92ca1548c50
Comment 5 Martin Steigerwald 2019-04-27 12:53:41 UTC
Thanks, Wolfgang, for letting us know. I hope after release of Debian Buster I can get updated KDEPIM packages for Debian again.