Bug 493992 - Getting "unable to fetch row" error when making any change whatsover to a large document
Summary: Getting "unable to fetch row" error when making any change whatsover to a lar...
Status: RESOLVED WORKSFORME
Alias: None
Product: skrooge
Classification: Applications
Component: general (show other bugs)
Version: 2.30.0
Platform: Other Linux
: NOR normal
Target Milestone: 25.1.0
Assignee: Stephane MANKOWSKI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-02 20:40 UTC by Johannes Goller
Modified: 2024-11-22 03:46 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Goller 2024-10-02 20:40:46 UTC
SUMMARY


STEPS TO REPRODUCE
I can only reproduce this with my main document, which includes more than 10 years of transactions across 30 or so accounts.

Since today, whenever I attempt to change the date of a transaction, or make another change like setting to "checked", or attempt to add another transaction, I get this error message:

##WARNING: delete from doctransaction where id in (select id from doctransaction limit max(0,((select count(1) from doctransaction)-(50))))
##         returns :database disk image is malformed Unable to fetch row

And the change cannot be made.

When I use the document saved a day before, I can make a few changes and transactions, until I hit the same problem again.

Is it possible that there is a maximum total number of transactions that can be stored in a document, and I have hit it?

OBSERVED RESULT
The error message described above.

EXPECTED RESULT
No error and the change is made.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 40, Kernel 6.10.11
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Comment 1 Johannes Goller 2024-10-03 10:14:41 UTC
I now created a new document and imported the old one completely. In the new one, I can now add and make changes as usual. So that is fine as a workaround.

Interestingly, the size of my old document was about 11 MB, the size of the new one is 56 MB.
Comment 2 Stephane MANKOWSKI 2024-10-03 18:01:42 UTC
Hi,

Could you tell me what is the sqlcipher version of your system ?
You can have this kind of issue when the document is created with sqlcipher 3 and the new sqlcipher 4 is installed.

For the size of the document, this could be due to a huge history.
If you clean the history from the "History" doc, you should reduce the size of the document.
Comment 3 Bug Janitor Service 2024-10-18 03:47:56 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Johannes Goller 2024-10-22 05:22:39 UTC
Indeed the sqlcipher version is 4.5.2, but that must have been the case for quite a while before I started getting that problem. It's been that version in Fedora 39 and Fedora 40, so I must have been using it for more than a year.

(On a separate note, the document size has meanwhile decreased back to 11MB. I didn't do anything, but perhaps it removed the history automatically?)
Comment 5 Stephane MANKOWSKI 2024-10-23 07:48:30 UTC
Hi,

I have in skrooge all my transaction since 2004 without issue.
I think the issue is due to sqlcipher 4.

Could you try this from a console ?
- export SKGTRACE=1
- skrooge

Now you should have a new "Debug" item in the left list.
Open it and launch the following commands ?
PRAGMA cipher_page_size
pragma cipher_integrity_check
PRAGMA cipher_provider
PRAGMA cipher_version
PRAGMA cipher_compatibility

Could you put here the result of each of them ?

You can have some details about those command here: https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_settings

I can also to propose you the following workaround:
- Open skrooge
- Export you document in SQLCipher format (sqlcipher_export() will be used an clean your document).
- Create a new document
- Import the exported SQLCipher document

You should have exactly the same content but without the "database disk image is malformed" issue.
Comment 6 Bug Janitor Service 2024-11-07 03:46:40 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 7 Bug Janitor Service 2024-11-22 03:46:47 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.