Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036886Openbravo ERPY. DBSourceManagerpublic2017-09-19 11:542018-01-03 12:38
AugustoMauch 
inigosanchez 
normalmajorhave not tried
closedfixed 
5
 
3.0PR18Q1 
alostale
Core
No
0036886: install.source finishes 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 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

- 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
No tags attached.
Issue History
2017-09-19 11:54AugustoMauchNew Issue
2017-09-19 11:54AugustoMauchAssigned To => platform
2017-09-19 11:54AugustoMauchModules => Core
2017-09-19 11:54AugustoMauchTriggers an Emergency Pack => No
2017-09-19 11:57AugustoMauchDescription Updatedbug_revision_view_page.php?rev_id=15931#r15931
2017-09-19 16:28inigosanchezIssue Monitored: inigosanchez
2017-09-25 10:23inigosanchezAssigned Toplatform => inigosanchez
2017-09-25 10:23inigosanchezStatusnew => acknowledged
2017-09-25 10:38inigosanchezStatusacknowledged => scheduled
2017-09-28 17:55inigosanchezFile Added: issue36886_18q1.export
2017-09-28 17:57inigosanchezNote Added: 0099665
2017-10-04 11:22hgbotCheckin
2017-10-04 11:22hgbotNote Added: 0099757
2017-10-04 11:23hgbotStatusscheduled => resolved
2017-10-04 11:23hgbotResolutionopen => fixed
2017-10-04 11:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/dbsm-main/rev/97e319900015eb7457b23b89b53979ce3c88fe3f [^]
2017-10-04 11:23hgbotCheckin
2017-10-04 11:23hgbotNote Added: 0099758
2017-10-04 11:26hgbotCheckin
2017-10-04 11:26hgbotNote Added: 0099759
2017-10-04 11:27hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/dbsm-main/rev/97e319900015eb7457b23b89b53979ce3c88fe3f [^] => http://code.openbravo.com/erp/devel/pi/rev/480124c13f1d0d87de52336196baa91fb912de6c [^]
2017-10-04 11:28inigosanchezReview Assigned To => alostale
2017-10-04 11:28inigosanchezFile Deleted: issue36886_18q1.export
2017-10-06 12:54alostaleNote Added: 0099797
2017-10-06 12:54alostaleStatusresolved => closed
2017-10-06 12:54alostaleFixed in Version => 3.0PR18Q1
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101316

Notes
(0099665)
inigosanchez   
2017-09-28 17:57   
Attached the patch (issue36886_18q1.export) with the fix to be applied for the next release.
(0099757)
hgbot   
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   
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   
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   
2017-10-06 12:54   
reviewed + tested
(0101316)
hudsonbot   
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