Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038827Openbravo ERPA. Platformpublic2018-06-25 14:002023-07-21 09:07
shuehner 
caristu 
normalminorhave not tried
closedfixed 
5
pi 
3.0PR18Q3 
AugustoMauch
Core
No
0038827: Some trigger error messages are not shown nicely when using PostgreSQL version 10 (shows part of technical error)
When a database transaction throws an exception the ErrorTextParser class tries to parse it and translates it into a usable end-user message and shows that instead.

That parsing fails with pg10 and parts of the technical exception is shown mixed with the translated message.

When fixing the issue the existing unit tests (in ErrorTextParserTest class) for the parser should get a new test-case to cover the fix.
Start with instance having 18Q3 (or at least pi containing those)
Important: Have project to 'reject setting a module in development' when instance purpose is 'Production'.

Change Role to System Administrator
Set instance purpose to 'Production'
Go to module window
Edit entry to 'core' module and mark 'In Development' as active.
Save the edited record.

Expected error message:
Saving failed. Cannot have modules in "In Development" status in a Production instance

Actual error message when using postgresql version10.
Saving failed. Cannot have modules in "In Development" status in a Production instance Where: PL/pgSQL function ad_module_trg() line 33 at RAISE

Here part of the 'Stacktrace' of the error message comes up in the translated text.
No tags attached.
related to feature request 0036911 closed alostale support PostgreSQL 10 
depends on backport 00388293.0PR18Q2.2 closed caristu Some trigger error messages are not shown nicely when using PostgreSQL version 10 (shows part of technical error) 
causes defect 0038907 closed caristu DB errors which several OB messages are not correctly parsed in PG 
Issue History
2018-06-25 14:00shuehnerNew Issue
2018-06-25 14:00shuehnerAssigned To => platform
2018-06-25 14:00shuehnerModules => Core
2018-06-25 14:00shuehnerTriggers an Emergency Pack => No
2018-06-25 14:02shuehnerNote Added: 0105359
2018-06-25 15:18caristuRelationship addedrelated to 0036911
2018-06-25 15:18caristuStatusnew => scheduled
2018-06-26 18:02caristuAssigned Toplatform => caristu
2018-06-28 12:21hgbotCheckin
2018-06-28 12:21hgbotNote Added: 0105487
2018-06-28 12:27hgbotCheckin
2018-06-28 12:27hgbotNote Added: 0105488
2018-06-28 12:27hgbotStatusscheduled => resolved
2018-06-28 12:27hgbotResolutionopen => fixed
2018-06-28 12:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ed73bce3ae3b093cba0908df13b6ffabb73f6564 [^]
2018-06-28 12:30hgbotCheckin
2018-06-28 12:30hgbotNote Added: 0105489
2018-06-28 12:31caristuReview Assigned To => AugustoMauch
2018-06-28 16:25hgbotCheckin
2018-06-28 16:25hgbotNote Added: 0105498
2018-06-29 15:04AugustoMauchNote Added: 0105510
2018-06-29 15:04AugustoMauchStatusresolved => closed
2018-06-29 21:06hudsonbotCheckin
2018-06-29 21:06hudsonbotNote Added: 0105512
2018-06-29 21:06hudsonbotCheckin
2018-06-29 21:06hudsonbotNote Added: 0105513
2018-06-29 21:06hudsonbotCheckin
2018-06-29 21:06hudsonbotNote Added: 0105514
2018-06-29 21:06hudsonbotCheckin
2018-06-29 21:06hudsonbotNote Added: 0105517
2018-08-02 09:12alostaleFixed in Version => 3.0PR18Q3
2018-08-02 09:12alostaleRelationship addedcauses 0038907
2023-07-21 09:07Chris79Note Added: 0152771
2023-07-21 10:36priyamNote Deleted: 0152771

Notes
(0105359)
shuehner   
2018-06-25 14:02   
Note:
Issue can be seen when using postgres version 10. Difference in behavior may have been introduced earlier already.

Also issue was found in CI by weekly test-run against pg10:
https://ci.openbravo.com//job/try-initial-pgsql/7013/ [^]
(0105487)
hgbot   
2018-06-28 12:21   
Repository: erp/devel/pi
Changeset: 9452a1f4fa8a763ee51c1059422034d76245e5ef
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jun 28 12:20:33 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/9452a1f4fa8a763ee51c1059422034d76245e5ef [^]

related to issue 38827: minor code improvements

---
M src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java
---
(0105488)
hgbot   
2018-06-28 12:27   
Repository: erp/devel/pi
Changeset: ed73bce3ae3b093cba0908df13b6ffabb73f6564
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jun 28 12:23:51 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ed73bce3ae3b093cba0908df13b6ffabb73f6564 [^]

fixes issue 38827: Some trigger error messages not shown nicely in PG10

  Using capturing groups to retrieve just the DB message (it is surrounded by @) with the regular expression matcher.

---
M src/org/openbravo/erpCommon/utility/ErrorTextParserPOSTGRE.java
---
(0105489)
hgbot   
2018-06-28 12:30   
Repository: erp/devel/pi
Changeset: d3d16bc3e4bb81d4d55926388be98cec7761de6c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jun 28 12:30:20 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d3d16bc3e4bb81d4d55926388be98cec7761de6c [^]

related to issue 38827: added test case

---
M src-test/src/org/openbravo/test/system/ErrorTextParserTest.java
M src/org/openbravo/test/system/ErrorTextParserTest_data.xsql
---
(0105498)
hgbot   
2018-06-28 16:25   
Repository: erp/devel/pi
Changeset: 25f89f3e6667d80854e3d1b06a251ecb202e49bb
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Thu Jun 28 16:24:40 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/25f89f3e6667d80854e3d1b06a251ecb202e49bb [^]

related to issue 38827: fix to avoid random test failures

---
M src-test/src/org/openbravo/test/system/ErrorTextParserTest.java
M src/org/openbravo/test/system/ErrorTextParserTest_data.xsql
---
(0105510)
AugustoMauch   
2018-06-29 15:04   
Code review and verified
(0105512)
hudsonbot   
2018-06-29 21:06   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0338e029f9f8 [^]
Maturity status: Test
(0105513)
hudsonbot   
2018-06-29 21:06   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0338e029f9f8 [^]
Maturity status: Test
(0105514)
hudsonbot   
2018-06-29 21:06   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0338e029f9f8 [^]
Maturity status: Test
(0105517)
hudsonbot   
2018-06-29 21:06   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0338e029f9f8 [^]
Maturity status: Test