View Issue Details

IDProjectCategoryView StatusLast Update
0002642PartDesignBugpublic2017-09-24 21:58
Reporterian.rees Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
OSMacOSOS Version10.11 
Target Version0.17Fixed in Version0.17 
Summary0002642: Can't open saved file (undiscovered bug/s from PDN?)
DescriptionShould mention that I haven't spent much time in FreeCAD lately, so might be doing something dumb...

Attached file seemed to be working OK from what I noticed, but now can't open it. Report view shows:

Can't find Origin for "Body"
Can't find Origin for "Body"
Can't find Origin for "Body001"
Can't find Origin for "Body001"
Fatal Error at file GuiDocument.xml, line 872, char 30
Reading failed from embedded file: GuiDocument.xml (83898 bytes, 3209 bytes compressed)

There should be two separate Bodies; the first one opens but second doesn't.

That part of GuiDocument.xml seems a bit funky - Vim shows <ViewProvider name="^\<9a><8f><93>^?" expanded="0"> , but when I try to copy-and-paste in to Chrome it shows: <ViewProvider name="??" expanded="0">.
Additional InformationOS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.8046 (Git)
Build type: Debug
Branch: master
Hash: 67458d5bd2d3518adc02caf0fa89b62c06a48eb4
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 7.0.0
TagsPart Design
FreeCAD Information

Relationships

related to 0002857 closed Placement incorrect in exported files 

Activities

ian.rees

2016-07-26 10:56

developer  

spool pulley GT2.FCStd (147,469 bytes)

wmayer

2016-07-27 19:55

administrator   ~0007217

The XML has some strange characters which you can actually only determine with a hex-editor. When doing so the sequence e.g. is: 0x9a 0x8f 0x93 0x7f but there are a few places more with funny characters.

When looking at the Document.xml you can see that it contains 26 objects but the GuiDocument.xml has 31 view providers which cannot be correct. Now when going through the view provider names there are three with strange names and two have no name -- five invalid ones.

So, my guess is that at some point you have deleted a few objects but their view providers were not removed from the document which IMO must be another undiscovered bug from the PartDesignNext branch. This would explain the funny characters.

The easiest to repair your project is by deleting the GuiDocument.xml from the zip file.

Kunda1

2017-01-12 12:28

administrator   ~0007666

renamed for better comprehension

abdullah

2017-05-29 13:58

manager   ~0009185

@kunda1

I think this report does not allow to reproduce the issue. Yes, definitely something happened that originated those characters in the file. A solution was provided to try to recover the data. However we can not or reproduce what originated it.

As such, if the people involved have nothing against it, it may be better to close it.

ian.rees

2017-05-29 18:12

developer   ~0009188

There are two separate issues here - one is that the file got corrupted, the second is that FreeCAD didn't handle the corrupted file well. I'd prefer to leave the bug; even if there isn't a good way to reproduce the first part, the second would be nice to fix.

abdullah

2017-05-29 20:21

manager   ~0009189

@ian.rees

Sorry Ian, I did not understand from the report that you wanted a change of behaviour in FreeCAD when opening a corrupted file.

I am not sure how you would expect FreeCAD to handle the corrupted file (it did not crash, it complained about something it could not understand). The provided workaround by Werner relies on the fact that Werner as a human figures it out which ViewProviders to remove, so that they match in number.

In any case, of course, if there is something that needs fixing, there is no reason to close the bug report.

ian.rees

2017-05-29 20:32

developer   ~0009190

No need to apologise - the bug was just to record some weird behaviour.

I think it should be fairly easy to make FreeCAD handle this type of issue better - if there's an issue opening the file due to the view stuff, just (optionally?) try opening the file without it.

But, I don't have time for FreeCAD lately and likely won't for a few more weeks.

wmayer

2017-09-24 21:58

administrator   ~0010178

With https://github.com/FreeCAD/FreeCAD/commit/276781fb07b1c55e69b32f8ee976ece2406e2443 the dependencies of the objects are restored.
The xerces-c xml parser raises an exception when it reaches the invalid characters and thus it's not possible to read completely in GuiDocument.xml. This however only results into missing visual properties but the data are all read in -- so no loss of data.

The reason of the broken xml must be bugs in an early implementation of PDN which have been fixed in the meantime.

Issue History

Date Modified Username Field Change
2016-07-26 10:56 ian.rees New Issue
2016-07-26 10:56 ian.rees File Added: spool pulley GT2.FCStd
2016-07-26 10:56 ian.rees Tag Attached: Part Design
2016-07-27 06:25 ian.rees Project Assembly => PartDesign
2016-07-27 19:55 wmayer Note Added: 0007217
2016-07-27 19:55 wmayer Status new => confirmed
2017-01-12 12:28 Kunda1 Note Added: 0007666
2017-01-12 12:28 Kunda1 Summary Can't open saved file. => Can't open saved file (undiscovered bug/s from PDN?)
2017-02-14 12:17 kkremitzki Target Version => 0.17
2017-05-11 12:37 Kunda1 Relationship added related to 0002857
2017-05-29 13:58 abdullah Note Added: 0009185
2017-05-29 15:50 Kunda1 Status confirmed => feedback
2017-05-29 18:12 ian.rees Note Added: 0009188
2017-05-29 18:12 ian.rees Status feedback => new
2017-05-29 19:33 Kunda1 Status new => confirmed
2017-05-29 20:21 abdullah Note Added: 0009189
2017-05-29 20:32 ian.rees Note Added: 0009190
2017-09-24 21:58 wmayer Status confirmed => closed
2017-09-24 21:58 wmayer Resolution open => fixed
2017-09-24 21:58 wmayer Fixed in Version => 0.17
2017-09-24 21:58 wmayer Note Added: 0010178