[ Ticket #4085 ] [ Bug ] TechDraw: Recompute fails due to template?

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!
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

[ Ticket #4085 ] [ Bug ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Sun Sep 08, 2019 11:53 am

I have an issue with the attached file. If I recompute the document I get this error in the Report view:
<Exception> PropertyFileIncluded::Copy(): Renaming the file 'C:/Users/UserName/AppData/Local/Temp/FreeCAD_Doc_b841dcd3-ecc1-4efe-9677-98ec2e637e5f_bc6c86_3128/A0_Landscape_ISO7200TD.svg' to 'C:/Users/UserName/AppData/Local/Temp/FreeCAD_Doc_b841dcd3-ecc1-4efe-9677-98ec2e637e5f_bc6c86_3128/A0_Landscape_ISO7200TD.svg.b28d365a-4775-43ef-872e-c1df278ba1bc' failed.
Recompute failed! Please check report view.


Is there a way to fix this or is this perhaps a bug?

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18024 (Git)
Build type: Release
Branch: master
Hash: 9cc8f6eb666b0a0ae2dc256f7bc0beb8c987710c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
House.FCStd
(68.41 KiB) Downloaded 9 times
Last edited by Roy_043 on Thu Sep 26, 2019 2:11 pm, edited 1 time in total.
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Mon Sep 09, 2019 12:43 pm

Additional info:
This recompute issue only occurs if you reopen a file that already has TechDraw pages. The issue also occurs if the page is empty.
User avatar
wandererfan
Posts: 3162
Joined: Tue Nov 06, 2012 5:42 pm

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby wandererfan » Mon Sep 09, 2019 4:51 pm

Roy_043 wrote:
Sun Sep 08, 2019 11:53 am
I have an issue with the attached file. If I recompute the document I get this error in the Report view:
<snip>
Given that I can't reproduce this behaviour here:
OS: Linux Mint 19 Tara (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18151 +2 (Git)
Build type: debug
Branch: fixSelect
Hash: 43f48101e5c1861107d18caf37d93c3640f95e0e
Python version: 2.7.15+
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/Canada (en_CA)

I'm going to guess that this is related to issue #0004085 as that is also Windows only and involves renaming of PropertyFileIncluded temporary files.

Can you reproduce this on demand? If so, please generate the failure, then look in your Temp folder and try to rename "C:/Users/UserName/AppData/Local/Temp/FreeCAD_Doc_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx_xxxxxx_xxxx/A0_Landscape_ISO7200TD.svg" manually. The string of hex digits will be different each time.

Theory 1 is that this is a permission issue of some sort.

Theory 2 is that somehow, a temp file with the new name already exists.

Theory 3 is that the new name is problematic in some way. The new path is 162 characters which should be ok. The new filename is 125 characters which should also be ok. Can you check the system variable MAX_PATH? It is normally somewhere around 256.
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Mon Sep 09, 2019 7:29 pm

The error is perfectly reproducible.

When a file with a TechDraw page is opened a dedicated folder is created. For example:
C:/Users/UserName/AppData/Local/Temp/FreeCAD_Doc_203e9470-37a6-4670-be49-9a4c141425a4_d40e3b_4072/
And an SVG template is put in that folder. For example:
A4_LandscapeTD.svg
After a recompute there is a new file in the folder. For example:
A4_D825.tmp
The TMP file has the same size as the template, is also an SVG file, but is different. See Template_Recompute_Error.zip.

Theory 1:
I can rename both files in the dedicated folder and when I create a new FreeCAD file, add a TechDraw page and recompute, the error does not occur. See Template_Recompute_OK.zip for an example of the 2 files that are then in the dedicated folder.

Theory 2:
A dedicated folder is created so there is no existing temp file.

Theory 3:
The length of the filename is not the cause of the issue. In the 'new FreeCAD file scenario' a name with an identical length is used (see Template_Recompute_OK.zip).
Attachments
Template_Recompute_OK.zip
(23.14 KiB) Downloaded 4 times
Template_Recompute_Error.zip
(23.01 KiB) Downloaded 4 times
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Thu Sep 26, 2019 12:18 pm

I have rechecked this and find the problem still exists. Attached a simpler test file.
Maybe the problem only occurs on Windows?

V0.19 version:

Code: Select all

OS: Windows 8.1 (6.3)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18234 (Git)
Build type: Release
Branch: master
Hash: 3af5d97e9b2a60823815f662aba25422c4bc45bb
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
V0.18 does not have this problem:

Code: Select all

OS: Windows 8.1
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16117 (Git)
Build type: Release
Branch: releases/FreeCAD-0-18
Hash: dbb4cc6415bac848a294f03b80f65e888d531742
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Dutch/Netherlands (nl_NL)
Attachments
TD_Test.FCStd
(19.4 KiB) Downloaded 4 times
Syres
Posts: 386
Joined: Thu Aug 09, 2018 11:14 am

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby Syres » Thu Sep 26, 2019 12:43 pm

Roy_043 wrote:
Thu Sep 26, 2019 12:18 pm
I have rechecked this and find the problem still exists. Attached a simpler test file.
Maybe the problem only occurs on Windows?
@wandererfan is aware that the symptom is a Windows only issue (see https://forum.freecadweb.org/viewtopic.php?f=35&t=37286) and is trying his best to build a Windows environment to get a fix, it's not being neglected.
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Bug? ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Thu Sep 26, 2019 2:10 pm

OK, thanks.
Trying to follow the guidelines, I thought that this bug was not yet confirmed, and still being discussed. Hence the bump.
Roy_043
Posts: 563
Joined: Thu Dec 27, 2018 12:28 pm

Re: [ Ticket #4085 ] [ Bug ] TechDraw: Recompute fails due to template?

Postby Roy_043 » Wed Oct 02, 2019 7:33 am

@wandererfan: Thank you for fixing this.