Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0036444 | Openbravo ERP | A. Platform | public | 2017-07-07 11:16 | 2017-09-21 16:49 |
|
Reporter | alostale | |
Assigned To | alostale | |
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR17Q4 | |
Merge Request Status | |
Review Assigned To | shuehner |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0036444: SqlC generated code hides stack traces in case of error |
Description | When a query executed by a generated SqlC method fails, an error is logged but there is no way to see stack trace of where it occurred. |
Steps To Reproduce | - Execute ErrorTextParserTest
-> Check output:
There are output lines like following that do not include stack traces:
14768 [main] ERROR org.openbravo.test.system.ErrorTextParserTestData - SQL error in query: DELETE FROM AD_CLIENT WHERE AD_CLIENT_ID = ?Exception:org.postgresql.util.PSQLException: ERROR: update or delete on table "ad_client" violates foreign key constraint "ad_alert_ad_client" on table "ad_alert"
Detail: Key (ad_client_id)=(0) is still referenced from table "ad_alert". |
Proposed Solution | Statements can fail due to:
1. Technical reasons
2. Functional ones (ie. trying to insert/update prevented by a constraint/trigger)
In general for 2nd cases stack traces are not interesting and would pollute logs whereas stack traces for 1st cases would be interesting to help debugging. Differentiating those cases in code is not possible/easy.
As a compromise solution:
- By default stack traces won't be logged, as currently is done
- In case logger is set to debug level stack trace will be logged |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0036429 | | closed | shuehner | SqlC generates code using printStackTrace which should not be used | has duplicate | feature request | 0011261 | | closed | platform | In Sqlc generated code include stack trace in error logs | blocks | design defect | 0036162 | | acknowledged | Triage Platform Base | clean up openbravo.log |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2017-07-07 11:16 | alostale | New Issue | |
2017-07-07 11:16 | alostale | Assigned To | => platform |
2017-07-07 11:16 | alostale | Modules | => Core |
2017-07-07 11:16 | alostale | Triggers an Emergency Pack | => No |
2017-07-07 11:16 | alostale | Relationship added | related to 0036429 |
2017-07-07 11:17 | alostale | Relationship added | blocks 0036162 |
2017-07-07 11:22 | alostale | Review Assigned To | => shuehner |
2017-07-07 12:29 | alostale | Assigned To | platform => alostale |
2017-07-07 12:33 | hgbot | Checkin | |
2017-07-07 12:33 | hgbot | Note Added: 0097944 | |
2017-07-07 12:33 | hgbot | Status | new => resolved |
2017-07-07 12:33 | hgbot | Resolution | open => fixed |
2017-07-07 12:33 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/36b24dd5e2ff0d8e544868ef18900f92862e22ff [^] |
2017-07-07 12:38 | alostale | Summary | SqlC generates code hides stack traces in case of error => SqlC generated code hides stack traces in case of error |
2017-07-10 08:50 | hgbot | Checkin | |
2017-07-10 08:50 | hgbot | Note Added: 0097961 | |
2017-07-31 13:06 | shuehner | Note Added: 0098274 | |
2017-07-31 13:06 | shuehner | Status | resolved => closed |
2017-07-31 13:06 | shuehner | Fixed in Version | => 3.0PR17Q4 |
2017-09-21 16:49 | hudsonbot | Checkin | |
2017-09-21 16:49 | hudsonbot | Note Added: 0099246 | |
2017-09-21 16:49 | hudsonbot | Checkin | |
2017-09-21 16:49 | hudsonbot | Note Added: 0099251 | |
2017-11-06 08:31 | alostale | Relationship added | has duplicate 0011261 |
Notes |
|
(0097944)
|
hgbot
|
2017-07-07 12:33
|
|
Repository: erp/devel/pi
Changeset: 36b24dd5e2ff0d8e544868ef18900f92862e22ff
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Jul 07 12:28:04 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/36b24dd5e2ff0d8e544868ef18900f92862e22ff [^]
fixed bug 36444: SqlC generates code hides stack traces in case of error
Show stack traces when error occurs in sqlc methods. By default it is still not
shown, but it can be enabled by setting DEBUG log lovel.
---
M src-core/src/org/openbravo/data/Sqlc.java
M src-test/src/org/openbravo/test/base/TestLogAppender.java
M src-test/src/org/openbravo/test/system/ErrorTextParserTest.java
---
|
|
|
(0097961)
|
hgbot
|
2017-07-10 08:50
|
|
Repository: erp/devel/pi
Changeset: 6203c605f7397ef953cb750d930fa143f940da36
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Mon Jul 10 08:49:51 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/6203c605f7397ef953cb750d930fa143f940da36 [^]
related with bug 36444: make optional to log stack traces in tests
In test infrastructure is now optional (and disabled by default) to log stack
traces. This restores the previous behavior where they were never logged.
---
M src-test/src/org/openbravo/test/base/OBBaseTest.java
M src-test/src/org/openbravo/test/base/TestLogAppender.java
M src-test/src/org/openbravo/test/system/ErrorTextParserTest.java
---
|
|
|
|
Tested & reviewed.
Test done via running & checking the junit testcase which has been added to test the change. |
|
|
|
|
|
|
|