Bug 433816 - Crash recovery is not working
Summary: Crash recovery is not working
Status: NEEDSINFO WAITINGFORINFO
Alias: None
Product: kdenlive
Classification: Applications
Component: User Interface (show other bugs)
Version: 20.12.1
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-01 21:23 UTC by duncanSF
Modified: 2024-04-14 03:47 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
fritzibaby: Brainstorm+


Attachments
project backup list, annotated (15.17 KB, image/png)
2021-03-01 22:32 UTC, duncanSF
Details

Note You need to log in before you can comment on or make changes to this bug.
Description duncanSF 2021-03-01 21:23:48 UTC
SUMMARY
Crash recovery is not working.  The project seems to revert to the last saved version when being loaded after a crash.

STEPS TO REPRODUCE
1. load a project, edit until Kdenlive goes unresponsive. (sorry, not specific)
2. wait for Windows to recover: resmon updating, no open files assigned to kdenlive, etc.
3. relaunch Kdenlive. 
4. reopen the project.

OBSERVED RESULT
I get a choice between the automatically and manually saved versions of the project.

EXPECTED RESULT
It just loads the project as it was when I last saved it.

SOFTWARE/OS VERSIONS
Windows: Windows 8.1 as of 2021-Mar-01
Kdenlive v20.12.1 (standalone, one minor revision behind)
MLT v6.25.0 (distributed together with the kdenlive)

ADDITIONAL INFORMATION
I don't know if the automatic saves aren't happening, if the crash is happening during the writing of one of those recovery versions or if it's just not finding them when being launched again or when the relevant project is loaded again.
Comment 1 duncanSF 2021-03-01 21:26:07 UTC
Obviously I got "observed" and "expected" backwards.  Sorry.
Comment 2 Julius Künzel 2021-03-01 21:57:35 UTC
Can you try whether you can open a more recent version with menu: Project > Open Backup File ?
Comment 3 duncanSF 2021-03-01 22:32:30 UTC
Created attachment 136301 [details]
project backup list, annotated
Comment 4 duncanSF 2021-03-01 22:56:50 UTC
(In reply to Julius Künzel from comment #2)
> Can you try whether you can open a more recent version with menu: Project >
> Open Backup File ?

Yes, and thanks for asking.

The first time I visited that menu path I found the most recent backup listed there was from about 3.5 hours ago, older than the most recently saved version.

I saved the current project then visited the menu path again.  A new version was shown, but it was still apparently from about three hours before the one I'd just saved.

An annotated screenshot of the dialog box has been attached.
Comment 5 duncanSF 2021-03-01 23:01:26 UTC
I then saved the project with a new name, reopened it with the previous name, went to the backup versions list and selected the top one on the list. 

The most recently added clip was not on the timeline.

The automatically saved crash recovery backup was out of date.
Comment 6 Julius Künzel 2021-04-03 16:45:23 UTC
Maybe you are expecting the wrong behavior?

Backups (Project > Open Backup File) are added each time you save your project. Some older backups are might cleaned up so there is only one backup per week, month,…

In addition kdenlive create "auto saves". A auto save is triggered 3 seconds after you changed something. The latest "auto saves" can be restored if you open your project again and kdenlive crashed previously. In this case you will get a message asking if you want to recover the auto save backup.

Please check if we can close this report or if there are questions / problems left…
Comment 7 duncanSF 2021-04-03 17:16:53 UTC
Thank you for the followup, Julias.

It feels like the "open backup file" conversation was a tangent: those only reflect versions *before* the most recent one I saved on purpose.  The automatically saved version from three seconds after the most recent change is not among that list.

The automatic saves, newer than the one I pressed save for, are the problem. 
 You write:
"The latest "auto saves" can be restored if you
open your project again and kdenlive crashed previously. In this case you will
get a message asking if you want to recover the auto save backup."

When I opened the project after a crash it reverted to the last version I'd saved (on purpose) without offering me any automatically saved version.

Where are those versions saved?  Maybe I can load one of them after noticing that the app appears to have lost recent changes.
Comment 8 Julius Künzel 2021-04-03 18:27:35 UTC
Thanks for your answer! The list at Project > Open Backup File has nothing to do with auto-saves.

However it doesn't seem to be right that you don't get the recover message. The auto save are special files (no *.kdenlive file). On linux they are saved at ~/.local/share/stalefiles/kdenlive/ but I don't know where they are saved on windows. Maybe it is again a problem with the different paths on window and linux. I will check…
Comment 9 Julius Künzel 2021-04-03 18:45:05 UTC
It is not working for the flatpak too. Appimage and local install on linux are working fine.
Comment 10 Julius Künzel 2021-04-04 10:33:57 UTC
I made some more tests and I was wrong: the flatpak works. I was also able to test on window and it works for me there too.

The autosave files should be saved on C:\Users\USERNAME\AppData\Local\stalefiles\kdenlive

Can you check if this folder contains any files?
Comment 11 duncanSF 2021-04-04 17:37:54 UTC
Thanks for continuing the conversation.  I appreciate the back-and-forth.

Yes, that directory exists (showing my age, there) and has some lettersoup.kdenlivelettersoup files listed.  The extension encodes the path to the project file.  Some end in .lock.  Most of them are empty.  

Looking backwards, comparing the stalefiles list with the list of recently touched projects, I find (sorting by date, grouping by name)

one written 33 minutes before my most recent save on March 13th (empty),
two with a similar name written nine days before that (both empty), and

another cluster starting about 8.5 hours after another project's most recent save (small), with members extending forward a few days from there, Feb 24-27th (newest two with content, earlier ones empty).

I'm not sure looking backwards is helpful.  I'll try looking forward.

Watching that directory, I opened the most recently modified project, made a change and waited without saving.

Two files were added after the change.  Neither is empty.  I made a few more changes (adding timeline guides) without saving.  The timestamp on one of those non-blank files updates a few seconds after an unsaved change.  

It's working but the presence of empty files suggests it doesn't always work.  (actual recovery not tested today.)  In short, "works-for-me," today, but I can prove it doesn't always work-for-me.

Maybe there's a period during the update of that file when it's clobbered but not yet rewritten and my crash experiences coincide with that vulnerable point in the sequence.

On save, the .lock file was removed and the other new file apparently emptied.

Shortly after the next unsaved change the empty file remains and two new files are written.  One is empty.  After another change, the timestamp on the one not named .lock updates but it's still empty.

Okay, that reproduces the empty file situation.  Hope this helps.  Sorry for being verbose.
Comment 12 Julius Künzel 2021-04-04 20:58:33 UTC
Thanks for the detailed description! For me this sounds like everything works as is it should.

One thing left you can test is to make some changes and check if there are autosave files with content (as you already did) and then try to kill kdenlive (e.g. from the Windows Task Manager). Open Kdenlive again. If you did the changes without saving your project you should get a message after the splash screen. If you made the unsaved changes to a project you saved previously at least once open it and you should get the message then.

If you agree I would close this report. If you have problems in the future again you can reopen it or create a new one. Okay?
Comment 13 duncanSF 2021-04-05 01:33:51 UTC
Before you jump on the close button, no, it doesn't look perfect.  Changes made to a project *after* the first deliberate save operation are apparently not noted in the stalefiles\kdenlive folder.

It'll take me a mo to repeat that -- my PC is in a sorry state and everything I do takes hours.  Back with you tomorrow.
Comment 14 diekuhrannte@web.de 2024-03-30 19:02:16 UTC
Can you please report whether the problem still exists? Or can we close the bug report?
Comment 15 Bug Janitor Service 2024-04-14 03:47:47 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!