This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Saving Encrypted. 100% Data Loss

Tags: None
(comma "," separated)
lesturner
Registered Member
Posts
21
Karma
0

Saving Encrypted. 100% Data Loss

Sun Jan 26, 2020 1:44 pm
Hi,

I'm using Windows 10 Home (version 10.0.18363); KMyMoney (Version 5.0.6-8.1); GPG4 (Version 3.1.11)

I installed this updated version of KMyMoney earlier this month and shortly afterwards tried to get encryption sorted, so updated and applied GPG4. The keys are recognised and I can load the encrypted file fine.

When I tried to save the encrypted KMymoney file all data in the file was lost. Explorer still lists the file but with size 0KB. Fortunately KMyMoney kept a backup so it was just the newly entered data that was lost.

I've tried saving an un-encrypted version of the file with KMyMoney and it works perfectly. Please can anyone suggest what I can do to find the problem? Thanks,

Les
newlynx
Registered Member
Posts
1
Karma
0
lesturner wrote:Hi,

I'm using Windows 10 Home (version 10.0.18363); KMyMoney (Version 5.0.6-8.1); GPG4 (Version 3.1.11)

I installed this updated version of KMyMoney earlier this month and shortly afterwards tried to get encryption sorted, so updated and applied GPG4. The keys are recognised and I can load the encrypted file fine.

When I tried to save the encrypted KMymoney file all data in the file was lost. Explorer still lists the file but with size 0KB. Fortunately KMyMoney kept a backup so it was just the newly entered data that was lost.

I've tried saving an un-encrypted version of the file with KMyMoney and it works perfectly. Please can anyone suggest what I can do to find the problem? Thanks,

Les


I also have the exact same problem with the latest Kmymoney for Windows (pro version). Is there a solution to that?
lesturner
Registered Member
Posts
21
Karma
0
I've not discovered the problem yet. I'm thinking it may be the Gpg4win encryption software that we are using doing a 'file wipe'. I've posted a message on their website
lesturner
Registered Member
Posts
21
Karma
0

Re: Saving Encrypted. 100% Data Loss

Tue Feb 11, 2020 11:40 am
Hi newlynx,
The GnuPG people think this is more likely a KMyMoney issue so I've raised a bug report here: https://bugs.kde.org/show_bug.cgi?id=417385
Regards
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Saving Encrypted. 100% Data Loss

Tue Feb 11, 2020 11:56 am
Unfortunately, it does not seem to be that easy. The source of the problem has to be searched in the combination of KMyMoney, KF5::Gpgmepp, GnuPG and Windows and possibly some specifics of the installation (I am by far no MS-Win expert). The combination of KMyMoney, KF5::Gpgmepp, GnuPG and Linux is just working without problems for many people, including myself. So let's get this fixed. I can provide changes to the code but would need some ideas on what is failing. Also, I don't have the environment at hand and thus cannot debug.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
lesturner
Registered Member
Posts
21
Karma
0

Re: Saving Encrypted. 100% Data Loss

Tue Feb 11, 2020 12:09 pm
Hi ipwizard, I'm sure you're absolutely right.
My main purpose in my last post was to update newlynx on the problem which he says he's also having.
I had no intention to imply that GnuPG were washing their hands of it (so I apologise to them).
What they actually said was 'If it's an issue with the encryption / GPGME GnuPG integration I can offer to help with that from the GnuPG side, but as I'm no KMymoney user / dev myself I would need a more qualified bug report'
Regards
lesturner
Registered Member
Posts
21
Karma
0
I've just run KMyMoney from the Windows terminal to check for any errors. This is the output:

C:\Program Files\kmymoney5\bin>kmymoney.exe

C:\Program Files\kmymoney5\bin>3:2020/02/11 18-44-19:gwen(1768):i18n.c: 120: No translation found for WIN32 locale [English_United Kingdom.1252]
3:2020/02/11 18-44-19:gwen(1768):plugin.c: 379: Plugin "aqofxconnect" not found.
4:2020/02/11 18-44-19:aqbanking(1768):banking_init.c: 507: Could not load backend "aqofxconnect", ignoring
path of the process "dbus-daemon" seems to be outside of the installPath: "C:/Program Files/kmymoney5/bin" "/usr/x86_64-w64-mingw32/sys-root/mingw"

I've no idea whether these have anything to do with the encryption data loss but it doesn't look promising.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
Combining the information in this thread and the one found on the bug tracker it seems that the problem lies in replacing an already existing file with new data because writing to non-existent file works without problems. And this only in case encryption is activated. Replacing an existing .kmy file without encryption does work. Is all of this correct so far? What did I miss?


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
lesturner
Registered Member
Posts
21
Karma
0
That's it Ipwizard.
However this renders automatic (encrypted) backups impossible.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS

Re: Saving Encrypted. 100% Data Loss

Wed Feb 12, 2020 10:21 pm
I know, but to solve a problem you have to understand it in the first place. And we now have some indicators to check what might be causing the behavior.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
lesturner
Registered Member
Posts
21
Karma
0
Hi Ipwizard,
In trying to understand the problem with encrypted saving I’ve noted this sequence during saving. I wonder if it’s ‘file wiping’ during clean up of the hard disk?

Pressed ‘save’ at 19:40:53, Explorer shows:
    [Name] [Date Modified] [Size] [Type]
    [encrypted 01.kmy] [13/02/2020; 18:37] [829KB] [KMY File]
At 19:40:54: Explorer shows:
    [encrypted 01.kmy] [13/02/2020; 18:37] [829KB] [KMY File]
    [encrypted 01.kmy.1~] [13/02/2020; 18:37] [829KB] [1~ File]
At 19:40:55: Explorer shows:
    [encrypted 01.kmy] [13/02/2020; 18:37] [829KB] [KMY File]
    [encrypted 01.kmy.1~] [13/02/2020; 18:37] [829KB] [1~ File]
    [encrypted 01.kmy.oy6312] [18/02/2020; 19:40] [0KB] [oy6312 File]
At 19:40:57: Explorer shows:
    [encrypted 01.kmy] [13/02/2020; 18:37] [829KB] [KMY File]
    [encrypted 01.kmy.1~] [13/02/2020; 18:37] [829KB] [1~ File]
    [encrypted 01.kmy.oy6312] [18/02/2020; 19:40] [0KB] [oy6312 File]
    [encrypted 01.kmy.oy6312.pz6312] [18/02/2020; 19:40] [0KB] [pz6312 File]
At 19:41:02: Explorer shows:
    [encrypted 01.kmy] [18/02/2020; 19:40] [0KB] [KMY File]
    [encrypted 01.kmy.1~] [13/02/2020; 18:37] [829KB] [1~ File]
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
I looked at the code and don't see any obvious reasons why it should behave as it does. I think it requires someone with a Windows development environment to track down the problem. Unfortunately, I don't have such an animal. Anyone out there who could help?


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
lesturner
Registered Member
Posts
21
Karma
0

Re: Saving Encrypted. 100% Data Loss

Wed Feb 26, 2020 12:22 pm
This issue still not solved.
I've installed Dbgview.exe on my PC to collect data about KMyMoney when it tries to save encrypted files and loses all the data.
The log file it has produced includes the following line at the time when the data in the KMyMoney file is lost:
Event No: 00000140 System Time: 18:19:43 Debug Entry: [3572] Warning:QFileDevice::flush: No file engine. Is IODevice open?

I've found an entry in the forum where someone was having encrypted save problems on a Linux install of KMyMoney here
viewtopic.php?f=69&t=119070
His logged output included more information as follows:
QFile::flush: No file engine. Is IODevice open?
Failure while writing file: 'Errore generale'


Consequently I've been through that entry to try to glean anything that may help in my case but as I'm on Windows I'm unable to directly apply suggestions.
Does anyone have any ideas please?
lesturner
Registered Member
Posts
21
Karma
0

Re: Saving Encrypted. 100% Data Loss

Sun Apr 05, 2020 11:11 am
Hello ipwizard,
The problem with KMyMoney 5.0.6 on Windows 10 encryption is unresolved.
KMM 5.0.80 for Windows 10 is now available and I've installed version -KMM 5.0.80-f753dc0fa (#720).
This runs OK without encryption (which I cannot enable). The encryption box is greyed out. GPG files are in kmymoney/bin/ directory. I have a working encryption key pair which GPG2 recognises.
I've looked through all the previous posts where people have had this problem before (I've had the same issue previously a few times myself ;) ) but am unable to find the issue.
The KMM error message says: "GPG is not available for decryption of file C:/users/renru/Documents/encrypted.kmy C:\_\be855f17\kmymoney\kmymoney\plugins\xml\xmlstorage.cpp(385)"
#720 Console Log file includes these lines which look like there may have been problems in generating xmlstorage.cpp:
"kmymoney\plugins\xml\CMakeFiles\xmlstorage.dir\mymoneystoragexml.cpp.obj
06:00:27 [375/974] Linking CXX executable bin\csvdate-test.exe
06:00:27 LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
06:00:27 LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
06:00:27 [376/974] Automatic MOC for target mymoneystoragenames-test
06:00:27 [377/974] Building CXX object kmymoney\plugins\xml\CMakeFiles\xmlstorage.dir\xmlstorage.cpp.obj
06:00:27 C:\_\be855f17\kmymoney\kmymoney\plugins\xml\xmlstorage.cpp(385): warning C4101: 'e': unreferenced local variable"
I can't find xmlstorage.cpp or xmlstorage.exe anywhere on my PC.
I'm still hoping to move forward with the 100% encryption data loss, but with the installation of KMM 5.0.8, I seem to have taken a step backwards. Please can you assist?
Thanks in advance.
Stay Safe :)
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
lesturner wrote:The KMM error message says: "GPG is not available for decryption of file C:/users/renru/Documents/encrypted.kmy C:\_\be855f17\kmymoney\kmymoney\plugins\xml\xmlstorage.cpp(385)"

That is the real problem! In fact, this tells me that KMyMoney could not find a GPG installation on your system. KMyMoney simply uses the GpgME library to check for it and I have no idea what it needs on MS-Windows to work properly.
lesturner wrote:#720 Console Log file includes these lines which look like there may have been problems in generating xmlstorage.cpp:
"kmymoney\plugins\xml\CMakeFiles\xmlstorage.dir\mymoneystoragexml.cpp.obj
06:00:27 [375/974] Linking CXX executable bin\csvdate-test.exe
06:00:27 LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
06:00:27 LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/FORCE' specification
06:00:27 [376/974] Automatic MOC for target mymoneystoragenames-test
06:00:27 [377/974] Building CXX object kmymoney\plugins\xml\CMakeFiles\xmlstorage.dir\xmlstorage.cpp.obj
06:00:27 C:\_\be855f17\kmymoney\kmymoney\plugins\xml\xmlstorage.cpp(385): warning C4101: 'e': unreferenced local variable"

That's just a compiler warning and absolutely unrelated to our problem here. Don't worry-
lesturner wrote:I can't find xmlstorage.cpp or xmlstorage.exe anywhere on my PC.

Yes, xmlstorage.cpp is a source code file which is compiled and ends up as xmlstorage.dll on your system. The link to it will drop you at the source code area that is looking for GPG and generates the error message you see.
lesturner wrote:I'm still hoping to move forward with the 100% encryption data loss, but with the installation of KMM 5.0.8, I seem to have taken a step backwards. Please can you assist?
Thanks in advance.
Stay Safe :)

Hope to do all of the above, though I am not a windows expert. For that matter, I added a bit of source code to the master branch which hopefully provides a bit more information about what is failing (see code change) as debug output. That change will make it into build #723 so try that next. That build seems to start at 5 a.m. UTC, so there is some time left.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft