Bug 390411 - Sqlite opening broken
Summary: Sqlite opening broken
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: database (show other bugs)
Version: 5.0.0
Platform: Neon Linux
: NOR critical
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-02-13 21:46 UTC by Pyroman
Modified: 2019-01-19 20:29 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pyroman 2018-02-13 21:46:07 UTC
Version 5.0.0 doesn't open sqlite3 database through File -> Open database menu. 
No error shown in the interface, but "Invalid URL ''"  message appear in console.
Comment 1 Thomas Baumgart 2018-02-15 08:10:24 UTC
I am unable to duplicate this. What are you doing exactly? The error message you mention does not contain a filename for the db (which is usually printed between the two single-quotes), but the UI does not allow to get there. So there must be something else.
Comment 2 Pyroman 2018-02-15 19:35:15 UTC
> What are you doing exactly?

Just trying to load an existing kmymoney sqlite file: https://i.imgur.com/4bQiab0.png
After pressing "Ok" blank window shown and "Invalid URL ''" message appears on stderr. Nothing else. https://i.imgur.com/HZLaqMa.png

File is valid, it's still possible to open it manually from command line running as `kmymoney sql:/path/kmymoney.sqlite?driver=QSQLITE`
Comment 3 sergio_nsk 2018-05-02 04:38:49 UTC
I have the same problem. Tried to open sqlite database used in kmymoney 4.8 from a command line in Ubuntu Bionic:

WebConnect: Try to connect to WebConnect server
WebConnect: Connect to server failed
WebConnect: Running in server mode
Plugins: checkprinting loaded
Plugins: csvexporter loaded
Plugins: csvimporter loaded
Plugins: gncimporter loaded
Plugins: icalendarexporter loaded
Plugins: kbanking loaded
KBankingPlugin: No AqB4 config found.
KBankingPlugin: No AqB3 config found.
Plugins: kbanking pluged
Plugins: ofximporter loaded
Plugins: qifexporter loaded
Plugins: qifimporter loaded
Plugins: reconciliation report loaded
Plugins: weboob loaded
Online plugins found 3
Cost center model created with items 0
Payees model created with items 0
Error in function bool MyMoneyStorageSqlPrivate::alterTable(const MyMoneyDbTable&, int) : Error inserting into new table kmmSecurities
Driver = QSQLITE, Host = , User = , Database = /home/<...>/Geld.sqlite
Driver Error: 
Database Error No -1: 
Text:  
Error type 0
Executed: INSERT INTO kmmSecurities (id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency) SELECT id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency FROM kmmtmpSecurities;
Query error No -1: No query Unable to fetch row
Error type 1
void MyMoneyStorageSql::cancelCommitUnit(const QString&) - bool MyMoneyStorageSqlPrivate::alterTable(const MyMoneyDbTable&, int) s/be int MyMoneyStorageSqlPrivate::upgradeToV11()
terminate called after throwing an instance of 'MyMoneyException'
zsh: abort      kmymoney 'sql:/home/<...>/Geld.sqlite?driver=QSQLITE'
Comment 4 Christian David 2018-05-05 18:40:14 UTC
Could this be connected with or caused by bug 341304?
Comment 5 sergio_nsk 2018-05-06 05:59:22 UTC
I'm not sure that it is connected with https://bugs.kde.org/show_bug.cgi?id=341304 The mentioned bug is fixed on 2015-01-10 and kmymony 5.0 released later on 2018-02-06, thus includes this fix.
Moreover my Geld.sqlite is of version 3, but the mentioned bug report discusses versions 0 and 1.
Comment 6 sergio_nsk 2018-05-11 17:00:25 UTC
I have built kmymoney from sources and got the errors:

Error in function bool MyMoneyStorageSqlPrivate::alterTable(const MyMoneyDbTable &, int) : Error inserting into new table kmmSecurities
Driver = QSQLITE, Host = localhost, User = <...>, Database = //home/<...>/Geld.sqlite
Driver Error: 
Database Error No -1: 
Text:  
Error type 0
Executed: INSERT INTO kmmSecurities (id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency) SELECT id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency FROM kmmtmpSecurities;
Query error No -1: No query Unable to fetch row
Error type 1

It seems the bug is connected with the bug 341304.
Comment 7 Pyroman 2018-07-01 04:55:04 UTC
(In reply to Christian David from comment #4)
> Could this be connected with or caused by bug 341304?

I don't thik so. It's possible to open sqlite db manually from terminal supplying file as kmymoney sql:/home/username/kmymoney.sqlite?driver=QSQLITE
Comment 8 Andrew Crouthamel 2018-09-28 03:26:00 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 9 Pyroman 2018-09-28 07:27:41 UTC
What kind of info is needed?
Comment 10 Jack 2018-09-28 14:21:42 UTC
I'm changing this back to confirmed, since the second report was after Thomas asked for additional information.  Also, there have been other BD backend problems discovered recently, and this may or may not be related.  Unless Thomas has other questions, the main thing you could do now is to compile from the 5.0 branch of git to confirm the problem still exists there, especially as any changes get made in the near future.
Comment 11 Thomas Baumgart 2018-10-13 14:27:18 UTC
I made some changes to the DB code which should help here. Can you please check if the problem persists or has gone by compiling from the 5.0 branch and report back here? Many thanks in advance.
Comment 12 Pyroman 2018-10-14 06:13:54 UTC
I didn't compile, but tried this nightly appimage build https://binary-factory.kde.org/job/KMyMoney_Nightly_Appimage_Build/
and it was able to open my sqlite file, despite DB driver was named "SQLCipher Version 3 (encrypted SQLite)".
Comment 13 Jack 2018-10-30 16:54:10 UTC
So does this count as resolution, or do we need to change back to REPORTED?
Comment 14 Pyroman 2018-10-30 19:59:53 UTC
I'm not sure. Tested appimage uses different sqlite driver.

Kmymoney from Neon repo uses QSQLITE: https://i.imgur.com/t5ZqEXl.png
This version fails to open sqlite file from menu but cat open it from command line launched as `kmymoney sql:kmymoney.sqlite?driver=QSQLITE`

Kmymoney from nightly appimage uses QSQLCIPHEER: https://i.imgur.com/tW2o5X7.png
and it works ok with same db file, created by previous version.
Comment 15 Jack 2018-10-30 20:25:06 UTC
I believe there have been changes in how the SQL plugins are set up.  It is possible old versions included the encryption, but now the explicit QSQLCIPHER is required.  (It may also just be a rename of the plugin, but I don't use SQL, so I can't be sure.)  The code in the appimage you used should be included in the next version, so perhaps it's OK to leave this as confirmed until then, unless one of the developers thinks otherwise.
Comment 16 Thomas Baumgart 2018-10-31 21:17:38 UTC
What is the exact version number of 'Kmymoney from Neon repo' you mention in comment 14?
Comment 17 Pyroman 2018-11-01 18:36:31 UTC
5.0.1-2+16.04+xenial+build4 (I didn't upgrade to 18.04 yet)
Comment 18 Pyroman 2018-11-04 10:36:07 UTC
I've upgraded Neon to Bionic and Kmymoney build from Neon repo ( https://i.imgur.com/7qmZWnz.png ) still has same issue.
Not possible to open sqlite from "File" menu but ok from command line as sql:/tmp/kmymoney.sqlite?driver=QSQLITE
Comment 19 kde1 2018-11-05 00:43:03 UTC
I ran into the same issue today after upgrading to Ubuntu 18.04.1 LTS with kmymoney v5.0.1-2.

Neither the UI or command line works for me. In the software itself it won't open the sqlite file. 

On the command line the error looks like this:

$ kmymoney sql:/tmp/kmy.sqlite3?driver=QSQLITE
WebConnect: Try to connect to WebConnect server
WebConnect: Connect to server failed
WebConnect: Starting server failed. Try to remove stale socket.
WebConnect: Running in server mode
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/16/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/22/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/24/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/32/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/48/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/64/"
Invalid Context= "stock" line for icon theme:  "/usr/share/icons/ubuntu-mono-light/stock/128/"
Plugins: checkprinting loaded
Plugins: csvexporter loaded
Plugins: csvimporter loaded
Plugins: gncimporter loaded
Plugins: icalendarexporter loaded
Plugins: kbanking loaded
KBankingPlugin: No AqB4 config found.
KBankingPlugin: No AqB3 config found.
Plugins: kbanking pluged
Plugins: ofximporter loaded
Plugins: qifexporter loaded
Plugins: qifimporter loaded
Plugins: reconciliation report loaded
Plugins: weboob loaded
Online plugins found 3
Cost center model created with items 0
Payees model created with items 0
Error in function bool MyMoneyStorageSqlPrivate::alterTable(const MyMoneyDbTable&, int) : Error inserting into new table kmmSecurities
Driver = QSQLITE, Host = , User = , Database = /tmp/kmy.sqlite3
Driver Error: 
Database Error No -1: 
Text:  
Error type 0
Executed: INSERT INTO kmmSecurities (id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency) SELECT id, name, symbol, type, typeString, smallestAccountFraction, pricePrecision, tradingMarket, tradingCurrency FROM kmmtmpSecurities;
Query error No -1: No query Unable to fetch row
Error type 1
void MyMoneyStorageSql::cancelCommitUnit(const QString&) - bool MyMoneyStorageSqlPrivate::alterTable(const MyMoneyDbTable&, int) s/be int MyMoneyStorageSqlPrivate::upgradeToV11()
terminate called after throwing an instance of 'MyMoneyException'
Aborted (core dumped)


It's worth noting that the same file opened fine yesterday before the upgrade, which I believe was kmymoney v4.x (forgot the minor version number) on Ubuntu 16.04 LTS.
Comment 20 Thomas Baumgart 2019-01-19 11:00:03 UTC
Does the problem still persist in recent versions? Can you check that against a nightly build? Visit https://binary-factory.kde.org/job/KMyMoney_Nightly_Appimage_Build/ to obtain the latest AppImage build.
Comment 21 Pyroman 2019-01-19 20:29:19 UTC
No. Nightly appimage and current Kmymoney from Neon repo (5.0.2-0xneon+18.04+bionic+build10) hasn't this problem. Thanks for fixing.