Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0021908 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 02. Master data management | major | have not tried | 2012-10-11 11:44 | 2015-05-13 14:02 | |||
Reporter | shuehner | View Status | public | |||||
Assigned To | naiaramartinez | |||||||
Priority | normal | Resolution | out of date | Fixed in Version | ||||
Status | closed | Fix in branch | pi | Fixed in SCM revision | ||||
Projection | none | ETA | none | Target Version | ||||
OS | Any | Database | Any | Java version | ||||
OS Version | Database version | Ant version | ||||||
Product Version | 3.0MP15.1 | SCM revision | ||||||
Review Assigned To | ||||||||
Web browser | ||||||||
Modules | Core | |||||||
Regression level | ||||||||
Regression date | ||||||||
Regression introduced in release | ||||||||
Regression introduced by commit | ||||||||
Triggers an Emergency Pack | No | |||||||
Summary | 0021908: update.database fails as ModuleScript UpdateADClientInfo fails under some (rare) condition | |||||||
Description | The modulescript updateadclientinfo does among other things create a new record in ad_tree. I some scenario it happens that it tries to create a tree which does already exist thus it fails and stops/breaks all the update.database process. [java] 86658 INFO - Executing moduleScript: org.openbravo.modulescript.UpdateADClientInfo [java] 86675 ERROR - SQL error in query: INSERT INTO ad_tree( ad_tree_id, ad_client_id, ad_org_id, created, createdby, updated, updatedby, isactive, name, description, treetype, isallnodes) VALUES (?, ?, '0', now(), '0', now(), '0', 'Y', ?, ?, ?, 'Y')Exception:org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "ad_tree_name" [java] 86685 ERROR - Error executing moduleScript org.openbravo.modulescript.UpdateADClientInfo: @CODE=0@ERROR: duplicate key value violates unique constraint "ad_tree_name" [java] 86695 ERROR - Error executing moduleScript: org.openbravo.modulescript.UpdateADClientInfo | |||||||
Steps To Reproduce | Note: steps based on analysis, not based on actucally testing them: a.) install mp15.1 b.) downgrade that instance to mp11 + update.db + compile c.) update it again to mp15.1 d.) update.database note that in step d.) the described error will happen. | |||||||
Proposed Solution | Improve the modulescript to be saved against that rare usecase, so to only insert a new tree if it does not yet exist. | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Notes | |
(0053303) shuehner (administrator) 2012-10-11 11:52 |
Note: following sql can be used to fix the data as a workaround until it is fixed: UPDATE AD_CLIENTINFO SET AD_TREE_ASSET_ID = (SELECT AD_TREE_ID FROM AD_TREE T WHERE TREETYPE = 'AS' AND T.AD_CLIENT_ID = AD_CLIENTINFO.AD_CLIENT_ID) |
(0053304) shuehner (administrator) 2012-10-11 11:53 |
Small problem description: the problem is that the AD_CLIENTINFO.AD_TREE_ASSET_ID is deleted when you downgrade and the code uses that to decide if it alredy did insert the data or note. As on downgrade the column gets deleted (and thus its value) but not the inserted_tree on sub-sequent update the code assumes nothing was done and tries to re-insert the ad_tree. |
(0053353) naiaramartinez (developer) 2012-10-15 15:50 |
Test plan: 1) install mp15.1 2) downgrade that instance to mp11 + update.db + compile 3) update it again to mp15.1 4) update.database Notice that now the error is not showing anymore and the compilation is successful. |
(0077384) naiaramartinez (developer) 2015-05-13 14:02 |
The issue has been closed because it is too old. The issue is not reproducible in the oldest openbravo version. |
Issue History | |||
Date Modified | Username | Field | Change |
2012-10-11 11:44 | shuehner | New Issue | |
2012-10-11 11:44 | shuehner | Assigned To | => vmromanos |
2012-10-11 11:44 | shuehner | Modules | => Core |
2012-10-11 11:51 | shuehner | Assigned To | vmromanos => dmiguelez |
2012-10-11 11:52 | shuehner | Note Added: 0053303 | |
2012-10-11 11:53 | shuehner | Note Added: 0053304 | |
2012-10-15 12:52 | naiaramartinez | Assigned To | dmiguelez => naiaramartinez |
2012-10-15 15:50 | naiaramartinez | Note Added: 0053353 | |
2012-10-15 15:51 | naiaramartinez | Status | new => scheduled |
2012-10-15 15:51 | naiaramartinez | fix_in_branch | => pi |
2015-05-13 14:02 | naiaramartinez | Note Added: 0077384 | |
2015-05-13 14:02 | naiaramartinez | Status | scheduled => closed |
2015-05-13 14:02 | naiaramartinez | Resolution | open => out of date |
Copyright © 2000 - 2009 MantisBT Group |