Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0045729 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] Y. DBSourceManager | minor | have not tried | 2021-01-13 17:52 | 2021-06-11 10:18 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | shuehner | |||||||
Priority | normal | Resolution | fixed | Fixed in Version | PR21Q3 | |||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | PR21Q3 | |||
OS | Any | Database | Oracle | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | SCM revision | |||||||
Merge Request Status | approved | |||||||
Review Assigned To | ||||||||
OBNetwork customer | No | |||||||
Web browser | ||||||||
Modules | Core | |||||||
Support ticket | ||||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0045729: export.database fails with some views on oracle with: An invalid XML character (Unicode: 0x0) was found in the CDATA section. | |||||||
Description | Problem was found in one specific environment for 3 specific views. Running export.database with the module in development containing those views fails with: [java] Caused by: org.apache.ddlutils.DdlUtilsException: An invalid XML character (Unicode: 0x0) was found in the CDATA section. : /srv/ci/workspace/mod-simple-ci34.18102/modules/org.openbravo.cashposition/src-db/database/model/views/OBCP_ACTUALS_V.xml [java] at org.apache.ddlutils.io.DatabaseIO.readplain(DatabaseIO.java:226) [java] at org.openbravo.ddlutils.task.DatabaseUtils.readDatabaseNoChecks(DatabaseUtils.java:300) [java] at org.openbravo.ddlutils.task.DatabaseUtils.readDatabaseNoChecks(DatabaseUtils.java:289) [java] at org.openbravo.ddlutils.task.DatabaseUtils.readDatabaseNoChecks(DatabaseUtils.java:289) [java] at org.openbravo.ddlutils.task.DatabaseUtils.getMergedDatabaseAndInitialize(DatabaseUtils.java:230) [java] at org.openbravo.ddlutils.task.DatabaseUtils.readDatabase(DatabaseUtils.java:207) [java] at org.openbravo.ddlutils.task.DatabaseUtils.readDatabaseModel(DatabaseUtils.java:450) [java] at org.openbravo.ddlutils.task.ExportDatabase.execute(ExportDatabase.java:211) Technically errors comes from code inside export.database re-reading the just exported xml definition files and failing the the export did write wrong data into them. Comparing diff of the wrong view to earlier state shows that 1 or 3 0x0 byte '0' are added just after the view definition itself inside the CDATA section. The attached diff shows the wrong data. Trigger for when this error is happening + cause of adding 1 or 3 of those bytes is currently unclear. Problem can be reproduced 100% reliably in one environment. This code-snapshot file and revision can reproduce the problem: https://gitlab.com/obcustomers/ob_ob/snapshots/-/blob/a4c6300f70768f2c35e49fe39925f64b2b1d6a4a/Snapshot_Dev_HACK [^] | |||||||
Steps To Reproduce | Clone above code-snapshot run install.source on oracle run all modules with type <>'T' into development run export.database Probably just exporting this specific module: "org.openbravo.cashposition" is enough to reproduce the problem | |||||||
Tags | No tags attached. | |||||||
Attached Files | ![]() ![]() ![]() ![]() | |||||||
![]() |
|
![]() |
|
(0125436) shuehner (administrator) 2021-01-13 17:54 |
The 3 xml files attached are the 3 views triggering the problem (just for easy access. They are contained in the code-snapshot referenced above) |
(0129264) hgbot (developer) 2021-06-09 13:54 |
Merge Request created: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/28 [^] |
(0129295) hgbot (developer) 2021-06-10 07:05 |
Repository: https://gitlab.com/openbravo/product/dbsm [^] Changeset: fd92818322bcf48dda05237cfbc28f3ca327ab45 Author: Stefan Huehner <stefan.huehner@openbravo.com> Date: 2021-06-09T13:44:46+02:00 URL: https://gitlab.com/openbravo/product/dbsm/-/commit/fd92818322bcf48dda05237cfbc28f3ca327ab45 [^] ISSUE-45729: Workaround reading some views on oracle (extra 0x0 bytes) Some specific views when having their definition read from the database fail as they have 1-3 0x0 bytes just after their view body. That works around strange Oracle behavior (probably caused by USER_VIEWS.TEXT column we read here having 'LONG' data type and that datatype has some quirks and is marked 'do not use me' (but used in that internal ORACLE view). Apply trim() to the String value read which will strip out any whitespace (including 0x0) before post-processing it. We already strip out \n (newlines) from view bodies and even .trim() the result of the PG translation. --- M src/org/apache/ddlutils/platform/ModelLoaderBase.java --- |
(0129296) hgbot (developer) 2021-06-10 07:05 |
Merge request merged: https://gitlab.com/openbravo/product/dbsm/-/merge_requests/28 [^] |
(0129394) hgbot (developer) 2021-06-11 10:18 |
Directly closing issue as related merge request is already approved. Repository: https://gitlab.com/openbravo/product/openbravo [^] Changeset: 5c9721a21dc89e884c13b3bfb31df376e727ffdb Author: Stefan Huehner <stefan.huehner@openbravo.com> Date: 2021-06-11T10:17:06+02:00 URL: https://gitlab.com/openbravo/product/openbravo/-/commit/5c9721a21dc89e884c13b3bfb31df376e727ffdb [^] fixes ISSUE-47036; fixes ISSUE-45729; fixes ISSUE-47047; fixes ISSUE-28703 dbsm including the fixes for: ISSUE-47036: Remove lots of obsolete support code for obsolete (update.database.mod, ezattributes module, dbmanager.jar references) ISSUE-45729: export.database fails with some views on oracle with: An invalid XML character (Unicode: 0x0) was found in the CDATA section. ISSUE-47047: Reading tables part of PostgreSQL modelloader could be simplified and speed up ISSUE-28703: dbmanager.jar & src-db/src removal --- M src-db/database/lib/dbsourcemanager.jar --- |
![]() |
|||
Date Modified | Username | Field | Change |
2021-01-13 17:52 | shuehner | New Issue | |
2021-01-13 17:52 | shuehner | Assigned To | => platform |
2021-01-13 17:52 | shuehner | File Added: oracle-export.database-problem.diff | |
2021-01-13 17:52 | shuehner | OBNetwork customer | => No |
2021-01-13 17:52 | shuehner | Modules | => Core |
2021-01-13 17:52 | shuehner | Triggers an Emergency Pack | => No |
2021-01-13 17:53 | shuehner | File Added: OBCP_ACTUALS_V.xml | |
2021-01-13 17:53 | shuehner | File Added: OBCP_CASHPOSDETAIL_INT_V.xml | |
2021-01-13 17:53 | shuehner | File Added: OBCP_CASHPOSDETAIL_V.xml | |
2021-01-13 17:54 | shuehner | Note Added: 0125436 | |
2021-06-09 13:54 | hgbot | Merge Request Status | => open |
2021-06-09 13:54 | hgbot | Note Added: 0129264 | |
2021-06-09 20:02 | shuehner | Target Version | => PR21Q3 |
2021-06-09 20:02 | shuehner | Assigned To | platform => shuehner |
2021-06-10 07:05 | hgbot | Merge Request Status | open => approved |
2021-06-10 07:05 | hgbot | Note Added: 0129295 | |
2021-06-10 07:05 | hgbot | Note Added: 0129296 | |
2021-06-11 10:18 | hgbot | Resolution | open => fixed |
2021-06-11 10:18 | hgbot | Status | new => closed |
2021-06-11 10:18 | hgbot | Fixed in Version | => PR21Q3 |
2021-06-11 10:18 | hgbot | Note Added: 0129394 |
Copyright © 2000 - 2009 MantisBT Group |