Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0043608
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformmajoralways2020-03-30 13:342020-04-16 11:25
ReportervmromanosView Statuspublic 
Assigned Toalostale 
PrioritynormalResolutionfixedFixed in VersionPR20Q3
StatusclosedFix in branchFixed in SCM revision1f9c2cc10bed
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0043608: failed process definition execution not shown in UI

DescriptionWhen a process definition execution fails by throwing an exception, no message is displayed to the user.

There are 2 different cases:

* Case 1: failed DAL's DB trx
If current DAL's DB transaction fails, ie. a trigger raised an exception while executing the process, the process was kept in PROCESSING from UI.

* Case 2: any other exception
When any other exception is thrown, no info is displayed at all (not error nor success message).
Steps To ReproduceCase 1
1 - Create a trigger in the invoice line table with a single line where an exception is thrown, example RAISE EXCEPTION '%', '@SomeErrorMessage@'; --OBTG:-20000--
2 - Create a Purchase Invoice header.
3 - Create lines using the selector "Create lines from Order"

Error message is not displayed on selector (see attached image)

Case 2:
1 - In CreateInvoiceLinesFromHandler throw an exception before doing anything
2 - Create a Purchase Invoice header.
3 - Create lines using the selector "Create lines from Order"

Process popup is closed without displaying any info about the process execution status
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0043581PR20Q4 closedvmromanos selector "Create lines from Order" in "Purchase Invoice" does not show trigger's errors. 

-  Notes
(0118874)
vmromanos (developer)
2020-03-30 13:51
edited on: 2020-03-30 13:56

This issue is a clone from 0043581 to fix the platform side.

The functional code seems to be OK. In CreateInvoiceLinesFromHandler, the method showExceptionInViewAndRetry() properly builds the JSONObject with an error message and it allows to retryExecution.
For example, when you select no lines from the grid, this method properly shows the expected error and allows the execution.
However, when the error comes from the DB, the popup is locked as in the 0043581 attached screenshot.

In browser console I can see the errors:

POST http://localhost:8080/openbravo/org.openbravo.client.kernel?processId=AB2EFCAABB7B4EC0A9B30CFB82963FB6&reportId=null&windowId=183&_action=org.openbravo.common.actionhandler.createlinesfromprocess.CreateInvoiceLinesFromOrderLines [^] 500
isc_c_Comm_sendXmlHttpRequest @ ISC_Combined.js:1051
isc_c_RPCManager__sendQueue @ ISC_Combined.js:11592
isc_c_RPCManager_sendQueue @ ISC_Combined.js:11547
isc_c_RPCManager_sendRequest @ ISC_Combined.js:11430
call @ ff67f802d8c2e29736a69cb8994fa606.js:1507
actionHandlerCall @ ff67f802d8c2e29736a69cb8994fa606.js:3184
doProcess @ ff67f802d8c2e29736a69cb8994fa606.js:3184
actionClick @ ff67f802d8c2e29736a69cb8994fa606.js:3161
isc_StatefulCanvas_handleActivate @ ISC_Combined.js:3562
isc_StatefulCanvas_handleClick @ ISC_Combined.js:3563
isc_c_EventHandler_bubbleEvent @ ISC_Combined.js:1337
isc_c_EventHandler_handleClick @ ISC_Combined.js:1203
isc_c_EventHandler__handleMouseUp @ ISC_Combined.js:1192
isc_c_EventHandler_handleMouseUp @ ISC_Combined.js:1186
isc_c_EventHandler_dispatch @ ISC_Combined.js:1411
eval @ VM39185:3

Uncaught TypeError: _3.match is not a function
    at _2.isc_c_RPCManager_evalResult [as _originalEvalResult] (ISC_Combined.js:11707)
    at _2.evalResult (ff67f802d8c2e29736a69cb8994fa606.js:180)
    at _2.isc_c_RPCManager_fireReplyCallbacks [as fireReplyCallbacks] (ISC_Combined.js:11710)
    at _2.isc_c_RPCManager_performOperationReply [as performOperationReply] (ISC_Combined.js:11704)
    at _2.isc_c_RPCManager__performTransactionReply [as $39d] (ISC_Combined.js:11689)
    at _2.isc_c_RPCManager_performTransactionReply [as _originalperformTransactionReply] (ISC_Combined.js:11621)
    at _2.performTransactionReply (ff67f802d8c2e29736a69cb8994fa606.js:181)
    at eval (eval at isc__makeFunction (ISC_Combined.js:45), <anonymous>:3:16)
    at _2.isc_c_Class_fireCallback [as fireCallback] (ISC_Combined.js:254)
    at _2.isc_c_Comm_performXmlTransactionReply [as performXmlTransactionReply] (ISC_Combined.js:1055)





My feeling, however, is that the problem comes from the database.

When there is an exception in database the transaction is blocked and it doesn't allow new queries to the database. For example, it is impossible to retrieve the message text from the AD_Message. You can debug the OBMessageUtils.messageBD("error") and you will realize that when we try to retrieve the message after an exception in a trigger, the messageDB() execution shows the exception "ERROR: transacción abortada, las órdenes serán ignoradas hasta el fin de bloque de transacción".

Obviously this is a generic problem that must be fixed, because it avoids to show to the user the translated message. But my feeling is that this is the root cause for the lock in the popup.

(0118937)
alostale (developer)
2020-04-03 11:54

Removing OBPS and SLA as the initial issue is fixed by 0043581
(0118938)
alostale (developer)
2020-04-03 12:00

MR: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/55/diffs [^]
(0119114)
hgbot (developer)
2020-04-09 12:10

Repository: erp/devel/pi
Changeset: 1f9c2cc10bed2494df1540eb668b4b299cf83a07
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Apr 03 11:47:15 2020 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/1f9c2cc10bed2494df1540eb668b4b299cf83a07 [^]

fixed BUG-43608: failed process execution does not display error to user

When a process definition execution raises an error, error message is
not seend in the UI.

There were 2 cases:
* An exception is thrown due to DB error in a DAL operation -> now we
  rollback current transacation as it failed in any case, this prevents
  trying to reuse an already rolled back DB trx.
* Any other execption, it was already caught but an emtpy JSON object
  without any info was sent to client -> now we try to generate a user
  readable message or at least to show the technical cause.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/process/BaseProcessActionHandler.java
---
(0119213)
caristu (developer)
2020-04-16 11:25

Reviewed + tested OK

- Issue History
Date Modified Username Field Change
2020-03-30 13:34 vmromanos New Issue
2020-03-30 13:34 vmromanos Assigned To => platform
2020-03-30 13:34 vmromanos Modules => Core
2020-03-30 13:34 vmromanos Triggers an Emergency Pack => No
2020-03-30 13:34 vmromanos Issue generated from 0043581
2020-03-30 13:34 vmromanos Relationship added related to 0043581
2020-03-30 13:51 vmromanos Note Added: 0118874
2020-03-30 13:51 vmromanos Relationship replaced blocks 0043581
2020-03-30 13:56 vmromanos Note Edited: 0118874 View Revisions
2020-03-30 14:10 Practics Issue Monitored: Practics
2020-03-31 12:55 vmromanos Relationship replaced related to 0043581
2020-04-03 11:54 alostale Note Added: 0118937
2020-04-03 12:00 alostale Summary selector "Create lines from Order" in "Purchase Invoice" does not show trigger's errors. => failed process definition execution not shown in UI
2020-04-03 12:00 alostale Description Updated View Revisions
2020-04-03 12:00 alostale Steps to Reproduce Updated View Revisions
2020-04-03 12:00 alostale Note Added: 0118938
2020-04-09 10:52 alostale Assigned To platform => alostale
2020-04-09 12:10 hgbot Checkin
2020-04-09 12:10 hgbot Note Added: 0119114
2020-04-09 12:10 hgbot Status new => resolved
2020-04-09 12:10 hgbot Resolution open => fixed
2020-04-09 12:10 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1f9c2cc10bed2494df1540eb668b4b299cf83a07 [^]
2020-04-09 12:10 alostale Review Assigned To => caristu
2020-04-16 11:25 caristu Note Added: 0119213
2020-04-16 11:25 caristu Status resolved => closed
2020-04-16 11:25 caristu Fixed in Version => 3.0PR20Q3


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker