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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036886
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Y. DBSourceManagermajorhave not tried2017-09-19 11:542018-01-03 12:38
ReporterAugustoMauchView Statuspublic 
Assigned Toinigosanchez 
PrioritynormalResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revision480124c13f1d
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036886: install.source finishes with success even if a view cannot be created

DescriptionIf there is a problem with the definition of a view (i.e. the view references a table that does not exist), the install.source task will finish with a success message, even though the following log will be written during the create.database subtask:

SQL Command failed with: ERROR: relation "butipay_payment" does not exist
  Position: 2041
SQL Command failed with: ERROR: relation "butipay_payment" does not exist
  Position: 1740
SQL Command failed with: ERROR: relation "butipay_payment" does not exist
  Position: 1139
There are still 3 forced commands not executed sucessfully (likely related to failed view statements).

If the update.database task is executed instead of install.source, the task will end with error, at is should:

     [java] 91617 INFO - Executed 6 forced SQL command(s) with 3 error(s)
     [java] 91625 INFO - Executed 3 forced SQL command(s) with 3 error(s)
     [java] 91632 INFO - Executed 3 forced SQL command(s) with 3 error(s)
     [java] 91639 INFO - Executed 3 forced SQL command(s) with 3 error(s)
     [java] 91645 INFO - Executed 3 forced SQL command(s) with 3 error(s)
     [java] 91650 WARN - SQL Command failed with: ERROR: relation "butipay_payment" does not exist
     [java] Position: 2041
     [java] 91654 WARN - SQL Command failed with: ERROR: relation "butipay_payment" does not exist
     [java] Position: 1740
     [java] 91659 WARN - SQL Command failed with: ERROR: relation "butipay_payment" does not exist
     [java] Position: 1139
     [java] 91664 WARN - There are still 3 forced commands not executed sucessfully (likely related to failed view statements).
     [java] 91669 INFO - Enabling Foreign Keys and Triggers
     [java] 91708 INFO - Executed 11 SQL command(s) successfully
     [java] 91766 INFO - Executed 265 SQL command(s) successfully
     [java] 91775 INFO - Executing default postscript
     [java] 91953 INFO - Executed 14 SQL command(s) successfully
     [java] java.lang.Exception: There were serious problems while updating the database. Please review and fix them before continuing with the application rebuild
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:277)
     [java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:86)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:57)
     [java] Exception in thread "main" java.lang.Exception: There were serious problems while updating the database. Please review and fix them before continuing with the application rebuild
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:296)
     [java] at org.openbravo.ddlutils.task.BaseDatabaseTask.execute(BaseDatabaseTask.java:86)
     [java] at org.openbravo.ddlutils.task.AlterDatabaseJava.main(AlterDatabaseJava.java:57)
     [java] Caused by: java.lang.Exception: There were serious problems while updating the database. Please review and fix them before continuing with the application rebuild
     [java] at org.openbravo.ddlutils.task.AlterDatabaseDataAll.doExecute(AlterDatabaseDataAll.java:277)
     [java] ... 2 more
     [java] 92653 ERROR - Not all the commands in the final update step were executed correctly. This likely means at least one foreign key was not activated successfully. Please review which one, and fix the missing references, or recover the backup of your sources.

BUILD FAILED

Steps To Reproduce- Modify a view so that it will fail when it is created.
- Run install.source
- The log will show the "There are still 3 forced commands not executed sucessfully (likely related to failed view statements)" message, but the task will finish with a BUILD SUCCESSFUL message
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0099665)
inigosanchez (developer)
2017-09-28 17:57

Attached the patch (issue36886_18q1.export) with the fix to be applied for the next release.
(0099757)
hgbot (developer)
2017-10-04 11:22

Repository: erp/devel/dbsm-main
Changeset: 97e319900015eb7457b23b89b53979ce3c88fe3f
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Thu Sep 28 17:37:08 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/97e319900015eb7457b23b89b53979ce3c88fe3f [^]

Fixed bug 36886:install.source finishes with success even if an error is raised

The problem is that install.source task could finished with success even if a view cannot be created. If there is a
problem with the definition of a view (i.e. the view references a table that does not exist), the install.source
task will finish with a success message, even though error logs will be written in console output. If the
update.database task is executed instead of install.source, the task will end with error.

Now the problem has been resolved by take into account the same errors/problems on install.source task than on
update.database. The following methods now are managed in order to retrieve the potential errors and stop the
task if and error is raised:
- platform.createTables(..)
- platform.createAllFKs(..)
- platform.enableAllTriggers(..)

Now on install.source taks the errors are handle properly.

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
M src/org/openbravo/ddlutils/task/CreateDatabase.java
---
(0099758)
hgbot (developer)
2017-10-04 11:23

Repository: erp/devel/dbsm-main
Changeset: ad0e5d2a1fb1b964375df924d24731e0433a4961
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Oct 04 10:07:52 2017 +0200
URL: http://code.openbravo.com/erp/devel/dbsm-main/rev/ad0e5d2a1fb1b964375df924d24731e0433a4961 [^]

Related with issue 36886: enableAllTriggers method retrieves errors properly

---
M src/org/apache/ddlutils/Platform.java
M src/org/apache/ddlutils/platform/PlatformImplBase.java
---
(0099759)
hgbot (developer)
2017-10-04 11:26

Repository: erp/devel/pi
Changeset: 480124c13f1d0d87de52336196baa91fb912de6c
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Wed Oct 04 11:08:32 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/480124c13f1d0d87de52336196baa91fb912de6c [^]

Fixed bug 36886:install.source finishes with success even if an error is raised

The problem is that install.source task could finished with success even if a view cannot be created. If there is a
problem with the definition of a view (i.e. the view references a table that does not exist), the install.source
task will finish with a success message, even though error logs will be written in console output. If the
update.database task is executed instead of install.source, the task will end with error.

Now the problem has been resolved by take into account the same errors/problems on install.source task than on
update.database. The following methods now are managed in order to retrieve the potential errors and stop the
task if and error is raised:
- platform.createTables(..)
- platform.createAllFKs(..)
- platform.enableAllTriggers(..)

Now on install.source taks the errors are handled properly.

---
M src-db/database/lib/dbsourcemanager.jar
---
(0099797)
alostale (manager)
2017-10-06 12:54

reviewed + tested
(0101316)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-09-19 11:54 AugustoMauch New Issue
2017-09-19 11:54 AugustoMauch Assigned To => platform
2017-09-19 11:54 AugustoMauch Modules => Core
2017-09-19 11:54 AugustoMauch Triggers an Emergency Pack => No
2017-09-19 11:57 AugustoMauch Description Updated View Revisions
2017-09-19 16:28 inigosanchez Issue Monitored: inigosanchez
2017-09-25 10:23 inigosanchez Assigned To platform => inigosanchez
2017-09-25 10:23 inigosanchez Status new => acknowledged
2017-09-25 10:38 inigosanchez Status acknowledged => scheduled
2017-09-28 17:55 inigosanchez File Added: issue36886_18q1.export
2017-09-28 17:57 inigosanchez Note Added: 0099665
2017-10-04 11:22 hgbot Checkin
2017-10-04 11:22 hgbot Note Added: 0099757
2017-10-04 11:23 hgbot Status scheduled => resolved
2017-10-04 11:23 hgbot Resolution open => fixed
2017-10-04 11:23 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/97e319900015eb7457b23b89b53979ce3c88fe3f [^]
2017-10-04 11:23 hgbot Checkin
2017-10-04 11:23 hgbot Note Added: 0099758
2017-10-04 11:26 hgbot Checkin
2017-10-04 11:26 hgbot Note Added: 0099759
2017-10-04 11:27 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/dbsm-main/rev/97e319900015eb7457b23b89b53979ce3c88fe3f [^] => http://code.openbravo.com/erp/devel/pi/rev/480124c13f1d0d87de52336196baa91fb912de6c [^]
2017-10-04 11:28 inigosanchez Review Assigned To => alostale
2017-10-04 11:28 inigosanchez File Deleted: issue36886_18q1.export
2017-10-06 12:54 alostale Note Added: 0099797
2017-10-06 12:54 alostale Status resolved => closed
2017-10-06 12:54 alostale Fixed in Version => 3.0PR18Q1
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101316


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker