Could not save work, files lost

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Could not save work, files lost

Post by MarkkuTM »

Is there a temp file from which I could recover about 3 hours worth of work?

I was presented with a message that declared I could not save my work for some reason. I tried several ways to save and got the same message. I closed the app, and when I reopened it, my file is not listed on the recent files, except for one that is 3 hours old. I did a lot in those 3 hours, and would like to recover it if I can.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16093 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: 690774c0effe4fd7b8d2b5e2fb2b8c8d145e21ce
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
freedman
Veteran
Posts: 3466
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Could not save work, files lost

Post by freedman »

I hope this works for you, the saving of backups or at least the number of them is set in Preferences. Last week I had an issue and no backups were being created, I went and looked in Preferences and it appeared to be set to zero backups. I hope that isn't the default.

So goto Edit-Preferences-Document and check the backup settings.

If backups are on your hard drive they will numbered, filename.FCStd1 and next filename.FCStd2. These files are created every time you click save.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Could not save work, files lost

Post by chrisb »

Sorry for the loss, but I'm afraid there is not much you can do. Nevertheless you can check the following.

There are two mechanisms creating backup files. Both depend on correct configuration in the preferences.
  • On every save there is a backup created by renaming the current FCStd file. Hopefully your try to save was able to rename the file and failed only on writing the new one. The backup files live in the same directory as the main file. Sort your backup files by date, the numbers are used in a cyclic way.

    The default for the number of backup files is 1. For future use: set the number of backup files to a ridiculously high number, e.g. 10 and save often. After having finished a project or a milestone you can remove the backup files.
  • If you have autosave files configured with auto recovery - the default is yes every 20 minutes - then FreeCAD automatically checks on restart if such a file exists and offers recovery in a dialog.
    However, this file is removed on regular close of FreeCAD, it is kept only in the case of an undesired crash.

    Someone else may tell you where these backups are kept so you can check.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Re: Could not save work, files lost

Post by MarkkuTM »

Thanks for your replies.

My backup settings are at 1, and autorecovery saves at 15 minutes. I have not changed them. I have always maintained a "save often" routine, and never before had this occur. (since version 0.15)

I found the backup file in the same directory as the originally saved file. I renamed it (took off the last digit) so I could open it with FreeCAD. The time stamp on that file was 3 hours before I tried to save and close my file, which means that it did not contain any of the 3 hours of work that I had done since it had been created.

Also, it seems that for some reason the saves for autorecovery were not happening as there is no indication of any such file existing when I restarted.

Where are the saves for autorecovery stored? If I knew that, I could manually look through them. I assume they are separate from the backups;

OR

Could there be a feature added to the system to be able to browse through the last several autosaves? I am thinking it might mean that autosaves should be stored for some period of time even after closing the app. For example, the last 3 or 4 autosaves (or a selectable number in settings) would be stored. When a new one is made, the oldest one is deleted.

(Backups are easy to browse as they are plainly available in the regular saved file directory).
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Re: Could not save work, files lost

Post by MarkkuTM »

Further to above:

I reopened the "3 hour old" starting file to edit. I added an item and tried to save. Here is the message I got:
Failure message.GIF
Failure message.GIF (119.26 KiB) Viewed 2520 times
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Re: Could not save work, files lost

Post by MarkkuTM »

Further to above:

I reopened the "3 hour old" starting file to edit. I added an item and tried to save. Here is the message I got:
Failure message.PNG
Failure message.PNG (42.71 KiB) Viewed 2519 times
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Could not save work, files lost

Post by TheMarkster »

I think the autorecovery files are deleted when you close FreeCAD normally. It's only when there is a crash, power outage, etc. that the recovery files remain. It makes sense if you think about it, because they're no longer needed presumably if you're able to exit normally. The files, I believe, are kept in appdata/local/temp. To get that folder open file explorer and enter %appdata% in the address bar. This would bring you to appdata/roaming, so you need to then navigate up one level, then go to local/temp. If you see other freecad temp folders, then you know this is probably the right place. Look for a folder called FreeCAD_Doc_37e5f7-abcd-a-bunch-of-hex-digits. In that folder there should be a file called fc_recovery_file.fcstd and another called fc_recovery_file.xml. I don't know for sure if you can just open fc_recovery_file.fcstd or not. Could be the xml file is also needed. (I'm basing this information on what I just found looking in my own temp folder with FreeCAD open and with a document loaded that I've been working on.)

The FCStd1, FCStd2, etc., files are generated as you save your file. If you don't save your file, you don't get those backups. Kinda works like this: when you save your file your old FCStd file becomes your new FCStd1 file. Your old FCStd1 file becomes your new FCStd2 file, and so on. AFAIK, these are not automatically saved. You only get them updated when you save your file.

Why you're getting the errors you're getting, I don't know. It could be you have some logical errors on your hard drive. I would run chkdsk utility. From an administrative command prompt. To get that press Windows+R to open the “Run” box. Type “cmd” into the box and then press Ctrl+Shift+Enter to run the command as an administrator. Then type:

Code: Select all

chkdsk c: /f
It should tell you it can't do it right now, but it will schedule it on the next startup. If you get that message, go ahead and restart so it can run the test. The /f bit tells it to fix any issues. You can leave that off if you just want to get a report. It can probably run this test without restarting.
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Re: Could not save work, files lost

Post by MarkkuTM »

Yet more to messages above.

I did some additional experimenting.

If I open a previously saved file for additional work, I can save it in the original location without failure. Then I got failure messages in a few situations:

1. If I go to the saved directory and do a right click copy and then right click paste it into a new directory, I cannot rename it and save.

2. If I open the file, and then do a "save as" with new name in a new directory, it fails.

But now for some reason, the failures don't appear any longer.

Could there be some kind of counter that is interfering with saves? Or do I have a corrupted FreeCAD file?
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Could not save work, files lost

Post by TheMarkster »

Upload your file. I'll see if I'm able to load it.
MarkkuTM
Posts: 33
Joined: Sun Dec 31, 2017 6:57 pm

Re: Could not save work, files lost

Post by MarkkuTM »

Yet one more.

Regarding info from TheMarkster:

I found the FreeCAD recovery file in the Appdata Local Temp directory for a currently open FreeCAD file. It had a different name from my original file, but I was able to open that file with FreeCAD. I closed it, and I still had my original file open in FreeCAD. As soon as I closed the original file, the FreeCAD recovery file disappeared from the Temp directory.

Another interesting observation: There was inititally a folder for the recovery file in the Temp directory but it was empty. After a period of time, the recovery file had been added. Presumably this is based on the document settings page where there is an autosave for recovery every 15 minutes in my case.

It would be a good feature to be able to go to a particular recovery file that is persistent for at least a few cycles of using the FreeCAD app, rather than having the file disappear on closing the app.

Since my save failures seem to have gone away (I hope not only temporarily), I will do the chkdsk to see if I have a memory or storage issue. Thanks for the input.
Post Reply