Bug 382787

Summary: Currency EUR not found - Version 3.8.0-39fe1124
Product: [Applications] kmymoney Reporter: J Kerckhofs <jimmy.kerckhofs>
Component: fileAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED WORKSFORME    
Severity: critical CC: ralf.habacker
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description J Kerckhofs 2017-07-27 08:39:26 UTC
Version 3.8.0-39fe1124

Opening my kmy file, this file was created/modified with the lastest stable 4.8.0 (from 2016-06-14), now tested with the latest version, give the following error, direcly after opening the file, and kMyMoney closes after confirming the error.

Error: Cannot load file U:\KMyMoney\myfile.kmy. Reason: File was not parsable!
Details: 
Currency 'EUR' not found. in file /home/abuild/rpmbuild/BUILD/kmymoney-4.8.1.39fe1124/kmymoney/mymoney/mymoneyfile.cpp line 2 656

Kind regards,
Jimmy
Comment 1 Ralf Habacker 2017-07-27 12:21:07 UTC
(In reply to J Kerckhofs from comment #0)
> Version 3.8.0-39fe1124
> 
> Opening my kmy file, this file was created/modified with the lastest stable
> 4.8.0 (from 2016-06-14), now tested with the latest version, give the
> following error, direcly after opening the file, and kMyMoney closes after
> confirming the error.
> 
> Error: Cannot load file U:\KMyMoney\myfile.kmy. Reason: File was not
> parsable!
> Details: 
> Currency 'EUR' not found. in file
> /home/abuild/rpmbuild/BUILD/kmymoney-4.8.1.39fe1124/kmymoney/mymoney/
> mymoneyfile.cpp line 2 656
This indicates an incomplete kmy file written by 4.8.0. 

A workaround is to unpack the kmy file to a raw xml file (the kmy file is a simple zip archive) and load this file instead. Using this code path currency related issues are catched and fixed.

In the xml file the following xml fragment should be there: 

<CURRENCIES count="186">
  ... 
  <CURRENCY saf="100" symbol="€" type="3" id="EUR" name="Euro" ppu="100" scf="100"/>
  ... 
</CURRENCIES>

If not it indicates the incomplete file case.
Comment 2 J Kerckhofs 2017-07-29 10:46:27 UTC
Hi Ralf,

You're right, my kmy file was incomplete, file size was reduced to 20%.

With the latest good backup it all works fine with version 4.8.1.39fe1124.

Thanks for the prompt reply.

Kind regards,
Jimmy