xTuple.com xTupleU Blog & News Customer Support

Problem with Upgrade 4.2.0 to 4.3.0

Hello everyone,

I am trying to upgrade an old version 3.8.4 to the current release (on Windows). I was able to run the updater without errors all the way to version 4.11.3 (with a Postgres upgrade from 8.4 to 9.6 with the database at 4.4.0).
Upon opening the “sales menu” - “sales orders” - “list open” I do get an error message now:

Sat May 19 15:10:37 2018 Debug: Looking FOR a script  "openSalesOrders"
Sat May 19 15:10:37 2018 ERROR:  stack depth LIMIT exceeded
HINT:  Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
CONTEXT:  PL/pgSQL function "currtocurr" line 13 at IF
SQL statement "SELECT
     ROUND((_x.taxrate_percent * pAmount + currToCurr(_x.curr_id, pCurrId, _x.taxrate_amount, pDate)), 6)"
PL/pgSQL function "calculatesubtax" line 32 at SQL statement
PL/pgSQL function "calculatesubtax" line 53 at FOR over SELECT rows
PL/pgSQL function "calculatesubtax" line 53 at FOR over SELECT rows
PL/pgSQL function "calculatesubtax" line 53 at FOR over SELECT rows
PL/pgSQL function "calculatesubtax" line 53 at FOR over SELECT rows

long version here: https://pastebin.com/VaT22qqv

I redid the upgrade and found that the problem is introduced on the upgrade from 4.2.0 to 4.3.0 (Postgres at 8.4).

Does anyone have an idea what I can do to fix this?

Alex,

What makes you say the problem is introduced between 4.2.0 and 4.3.0? The only change I see in the calculatesubtax() function between those two versions is a change in the copyright comment. There must be something else at work here.

Previous experience says this is a data problem but that conflicts with the evidence so far. Did you change anything about the data? I.e. did you do anything other than upgrade the database, upgrade Postgres, and try to list the sales orders?

Gil

So when I have upgraded for 3.8.4 to 4.11.3 I had to do all the upgrade work on a 9.1 postgres server to get xTuple to 4.4.0. Once at 4.4.0, I migrated to either a 9.5 or a 9.6 server to complete the upgrade to the latest version.

The data was not touched at all. I only ran the updater.
After noticing the problem on 4.11.3 I did the whole upgrade again but this time I checked after each step and found that while 4.2.0 works, 4.3.0 does not.
That being said Postgres hasn’t been updated at that point either. It is still on 8.4.

Another point to mention is that Sales Orders created on the upgraded (broken) version do show correctly (when listing them individually since the whole report doesn’t work). But older SO’s simply don’t show with no error thrown.

It could be a data problem but I am not expert enough to see that. Usually a successful updater-run or exit code = 0 is my green light.