GnuCash
Contact   Instructions
Bug 796977 - No amounts displaying after upgrade from 2.6.19 to 3.3
Summary: No amounts displaying after upgrade from 2.6.19 to 3.3
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Backend - SQL (show other bugs)
Version: 3.3
Hardware: PC Linux
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-14 10:00 EST by Justin
Modified: 2021-09-23 16:09 EDT (History)
3 users (show)

See Also:


Attachments
Tracefile (168.97 KB, text/plain)
2019-03-06 14:53 EST, Justin
no flags Details

Description Justin 2018-12-14 10:00:59 EST
when upgrading from 2.6 to 3.3 with a Postgres backend, all splits are blank and transactions show zero. Had the same issue with 2 separate Postgres databases. Reported on IRC channel and was able to achieve a workaround solution by reverting to 2.6, saving as XML, upgrading to 3.3, and saving as Postgres.
Comment 1 Justin 2018-12-14 11:21:12 EST
locale = en_US.UTF8
OS = Ubuntu 18.04
Comment 2 John Ralls 2018-12-25 18:08:40 EST
I'm not able to replicate this when starting from GnuCash 2.6.21 using Postgres 9.6.10 on Debian 9. What version of Gnucash 2.6 and what version of Postgres?
Comment 3 Justin 2018-12-26 14:50:01 EST
gnucash version 2.6.19
postgres version 10.6

Thanks!
Comment 4 John Ralls 2018-12-27 19:55:56 EST
I can't duplicate that setup. I can run GnuCash2.6.19 on the Debian 9 VM and write to a Postgres11.1 DB on a Debian Sid (unstable) VM, and then open it with GnuCash3.3 on the latter. That works mostly fine. Mostly because if I start with a Postgres9.6 database on the Debian 9 VM and save it to the Postgres11.1 server the id_seqs for the tables that use SEQUENCE primary keys don't get set correctly and GnuCash won't write to them. If I save directly from an XML file I don't see that problem.

Do you still have the 2.6-created databases available? If so, can you start GnuCash 3.3 with '--log gnc.backend.dbi=debug", try to open one of them, and then attach the resulting tracefile (https://wiki.gnucash.org/wiki/Trace_file)?
Comment 5 Justin 2019-01-03 09:47:32 EST
Okay, will be a bit before I can test it out, my test box is being used for another project at the moment. Will report back.

Thanks
Comment 6 Justin 2019-03-06 14:53:52 EST
Created attachment 373197 [details]
Tracefile

Here is the tracefile when attempting to open my old database in 3.3.

Thanks!
Comment 7 Justin 2019-03-06 14:55:20 EST
I built version 3.3 from source on my Ubuntu 16.04 system and experienced the same issue as going from 16.04 & 2.6.19 to 3.3 on Ubuntu 18.04. I was able to workaround the issue by saving as XML, opening the XML in 3.3, and re-saving as postgres.

Thanks again,
Justin
Comment 8 John Ralls 2019-03-06 20:12:50 EST
Please run the following in the psql command-line tool after connecting to the database:

SELECT count(splits.guid) FROM splits INNER JOIN transactions ON splits.tx_guid = transactions.guid;

SELECT count(guid) FROM splits;

What values do you get?
Comment 9 Justin 2019-03-07 12:29:11 EST
3752 for both queries.
Comment 10 John Ralls 2019-03-08 09:41:23 EST
So the problem isn't the join. 

Try 

SELECT select transactions.description, splits.amount, splits.value FROM splits INNER JOIN transactions ON splits.tx_guid = transactions.guid LIMIT 20;

to see if the amounts and values are being properly retrieved.
Comment 11 Justin 2019-03-08 16:01:37 EST
uh, amount and value aren't valid columns in the splits table. I can run it for splits.quantity_num, splits.value_num and values are returned...
Comment 12 John Ralls 2021-09-23 16:09:13 EDT
Sorry, I dropped the ball on this, but I think that we're long past the 2.6->3.x database backend migration, so marking it obsolete.

Note You need to log in before you can comment on or make changes to this bug.