View Issue Details

IDProjectCategoryView StatusLast Update
0004098FreeCADBugpublic2019-08-26 12:51
ReporterTheMarksterAssigned To 
PrioritynormalSeveritymajorReproducibilitysometimes
Status confirmedResolutionopen 
Product Version0.19 
Target Version0.19Fixed in Version 
Summary0004098: FreeCAD should not exit if unable to rename backup file to project file while exiting
Descriptionhttps://forum.freecadweb.org/viewtopic.php?f=3&t=38788

Always when saving the attached file I get a warning in the report view:

FreeCAD wrote

Cannot rename project file to backup file
Cannot rename file from 'C:/Users/mwganson/Downloads/GoProMount.FCStd.c27e1393-a630-4287-80f0-e7503c09798a' to 'C:/Users/mwganson/Downloads/GoProMount.FCStd'


When I open that folder I see multiple files in the form of GoProMount.FCStd.long-guid-sequence-of-letters-and-numbers. The project file: GoProMount.FCStd does not contain the latest changes, which instead are (presumably) in the latest guid file.

The workaround for this is to delete all of those files (or just the GoProMount.FCStd file) and try again. No warnings and the file gets updated that way (until I need to save it again). This is only an inconvenience for me because I understand the workaround and how to recover my data, but most users will not understand. Their data is there, but might as well not be there because they won't know.

There is something failing for some reason during this process of creating the temporary guid file and renaming it to the project file.

The worst part of this is if I exit FreeCAD with unsaved changes and elect to save the changes on exit the save fails and yet FreeCAD still exits without any warning message. FreeCAD should not exit. It should remain open so the user can save as the file to another location or at least be told his data is safe in this new guid file, which must be renamed manually.
Steps To ReproduceIt is unlikely anyone can reproduce, but the file is attached. Open it, make some change to it, then click save. A warning will appear in the report view about being unable to rename the project file if you are able to reproduce. I am always 100% of the time able to reproduce with this file on my system if it is in the c:\users\mwganson\downloads folder, but if I move it from that folder, then I can no longer reproduce the issue.

One thing to try, which I haven't tried, is to step through in debug mode with a breakpoint at the line where the file is about to be renamed. Open the folder containing the file and if GoProMount.FCStd does not exist, then add it there before allowing the code to proceed past the breakpoint. I suspect the reason the renaming fails is because the file of the same name still exists. If that is what is happening, then this should reproduce the warning message upon continuing past the breakpoint.
Additional InformationThis issue existed prior to the Link merge, and is unrelated to that. I believe the warning was added to code in a commit some 10 months ago.

OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17877 (Git)
Build type: Release
Branch: master
Hash: 1e19ef5be4735f4200eaf99ce9e487d2be6f4151
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
TagsNo tags attached.

Activities

Kunda1

2019-08-26 12:50

administrator   ~0013468

Last edited: 2019-08-26 12:51

View 2 revisions

Changed to confirmed status since @chrisb mentions in the thread his may result in data loss.
I'll also assign it to 0.19 so devs can implement or defer it.

Issue History

Date Modified Username Field Change
2019-08-25 17:42 TheMarkster New Issue
2019-08-26 12:50 Kunda1 Status new => confirmed
2019-08-26 12:50 Kunda1 Note Added: 0013468
2019-08-26 12:50 Kunda1 Target Version => 0.19
2019-08-26 12:51 Kunda1 Note Edited: 0013468 View Revisions