Bug 479251 - kmymoney is not working on Debian testing with latest packages
Summary: kmymoney is not working on Debian testing with latest packages
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: database (show other bugs)
Version: 5.1.3
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-01 14:45 UTC by nils
Modified: 2024-01-12 09:16 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Dialog which appears after typing in my password (13.28 KB, image/png)
2024-01-01 14:45 UTC, nils
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nils 2024-01-01 14:45:51 UTC
Created attachment 164592 [details]
Dialog which appears after typing in my password

SUMMARY

I ran kmymoney flawlessly on my Debian testing system over the past few months. When I recently switched to a new
system, I wasn't able to unlock my encrypted sqlite db because kmymoney keeps prompting for my paasword (see screenshot attached).

After a little discussion in the Telegram group I compared the versions of

- sqlite3
- libsqlite3

on booth systems. The old system was running

- sqlite3 3.43.2
- libsqlite3 3.43.2

and I moved to

- sqlite3 33.44.2
- libsqlite3 3.44.2

When I downgrade the packages on my new system the issue still occurs. Upgrading the packages on my old system
leads to the described issue and it's not resolvable by downgrading again.


STEPS TO REPRODUCE
1.  Install kmymones on  a system with sqlite=3.43.2 and - libsqlite3=3.43.2
2. Create a password protected sqlite db
3. Unlocking the db should be possible
4. Updrade packages to sqlite3=33.44.2 and libsqlite3=3.44.2
5. Unlocking the db should not be possible

OBSERVED RESULT

Unlocking the db is not possible.

EXPECTED RESULT

Unlocking should be possible.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian 6.5.13-1 
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version:  5.107.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Comment 1 Jack 2024-01-01 20:46:17 UTC
As I remember (I don't use that backend) sqlite itself does not handle encryption, but requires sqlcipher.   Your problem is likely a version issue with that, and doesn't really have anything at all to do with KMymoney.
What are the relevant version of sqlcipher on your two machines?
Minor question - is your item 5 above a typo?  I would expect it IS NOT possible but SHOULD be possible.
(Even if sqlite on Ubuntu handle encryption itself without using sqlcipher, I would raise this issue on an Ubuntu forum or a sqlite related list or forum.  If the database itself cannot open your file, there is nothing KMyMoney can do.)
Comment 2 nils 2024-01-01 21:58:29 UTC
(In reply to Jack from comment #1)
> As I remember (I don't use that backend) sqlite itself does not handle
> encryption, but requires sqlcipher.   Your problem is likely a version issue
> with that, and doesn't really have anything at all to do with KMymoney.
> What are the relevant version of sqlcipher on your two machines?
> Minor question - is your item 5 above a typo?  I would expect it IS NOT
> possible but SHOULD be possible.
> (Even if sqlite on Ubuntu handle encryption itself without using sqlcipher,
> I would raise this issue on an Ubuntu forum or a sqlite related list or
> forum.  If the database itself cannot open your file, there is nothing
> KMyMoney can do.)

Thanks for your reply. I made an interesting observation regarding sqlcipher. I'm able to open the database with sqlcipher version 3.x.x from local cli. Versions = 4.x.x throw an error. But it is possible to enable a v3 compatibility mode with "PRAGMA cipher_compatibility = 3;" . Then
I can open the db with sqlcipher = 4.x.x.

However mymoney is still broken for me.
Comment 3 Jack 2024-01-01 22:21:31 UTC
I suspect that either you will need to explicitly convert  your database from version 3 to version 4, or else we need to figure out how to get KMyMoney to invoke sqlcipher with the compatability setting.  I don't use sqlcipher, so I'm only guessing, but is there a config file where you can specify to always use compatability mode?
Comment 4 nils 2024-01-01 22:22:44 UTC
(In reply to Jack from comment #3)
> I suspect that either you will need to explicitly convert  your database
> from version 3 to version 4, or else we need to figure out how to get
> KMyMoney to invoke sqlcipher with the compatability setting.  I don't use
> sqlcipher, so I'm only guessing, but is there a config file where you can
> specify to always use compatability mode?

I took that from https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283
Comment 5 nils 2024-01-02 13:25:54 UTC
(In reply to nils from comment #4)
> (In reply to Jack from comment #3)
> > I suspect that either you will need to explicitly convert  your database
> > from version 3 to version 4, or else we need to figure out how to get
> > KMyMoney to invoke sqlcipher with the compatability setting.  I don't use
> > sqlcipher, so I'm only guessing, but is there a config file where you can
> > specify to always use compatability mode?
> 
> I took that from https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283

I got mymoney running again by:

1. Let mymoney create a new encrypted sqlite db
2. Follow step 3 (custom export migration) from https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283
Comment 6 Jack 2024-01-09 21:05:37 UTC
Since this really isn't a bug in KMyMoney, should we close it as WORKSFORME?  The only alternative I can think of is  to make it a wishlist for KMyMoney to recognize a v3 sqlcipher file when running with v4, and automatically convert the file to v4.
Comment 7 nils 2024-01-12 09:16:18 UTC
(In reply to Jack from comment #6)
> Since this really isn't a bug in KMyMoney, should we close it as WORKSFORME?
> The only alternative I can think of is  to make it a wishlist for KMyMoney
> to recognize a v3 sqlcipher file when running with v4, and automatically
> convert the file to v4.

Yep let's close this one. Would be great if mymoney would do the conversion automatically. Thanks for your help.