During Stash 1.3.0-beta2 installation I get such error:

      The schema could not be created.
      	com.atlassian.stash.internal.migration.DefaultMigrationService.createSchema(DefaultMigrationService.java:572)
      	com.atlassian.stash.internal.migration.DefaultMigrationService.startMigration(DefaultMigrationService.java:933)
      	com.atlassian.stash.internal.migration.DefaultMigrationService.setup(DefaultMigrationService.java:212)
      	...
      Migration failed for change set liquibase/r1_3/m01.xml::STASHDEV-1023-11::bturner:
           Reason: liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE GITPILOTTMP.sta_diff_comment_anchor ADD CONSTRAINT fk_sta_diff_comment_comment FOREIGN KEY (comment_id) REFERENCES GITPILOTTMP.sta_comment (id) ON DELETE CASCADE: ORA-00604: error occurred at recursive SQL level 1
      ORA-20000: For GoldenGate, delete cascade constraints must be deferrable
      ORA-06512: at line 64
      :
                Caused By: Error executing SQL ALTER TABLE GITPILOTTMP.sta_diff_comment_anchor ADD CONSTRAINT fk_sta_diff_comment_comment FOREIGN KEY (comment_id) REFERENCES GITPILOTTMP.sta_comment (id) ON DELETE CASCADE: ORA-00604: error occurred at recursive SQL level 1
      ORA-20000: For GoldenGate, delete cascade constraints must be deferrable
      ORA-06512: at line 64
      :
                Caused By: ORA-00604: error occurred at recursive SQL level 1
      ORA-20000: For GoldenGate, delete cascade constraints must be deferrable
      ORA-06512: at line 64
      
      	liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
      	liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
      	liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
      	...
      Error executing SQL ALTER TABLE GITPILOTTMP.sta_diff_comment_anchor ADD CONSTRAINT fk_sta_diff_comment_comment FOREIGN KEY (comment_id) REFERENCES GITPILOTTMP.sta_comment (id) ON DELETE CASCADE: ORA-00604: error occurred at recursive SQL level 1
      ORA-20000: For GoldenGate, delete cascade constraints must be deferrable
      ORA-06512: at line 64
      
      	liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
      	liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
      	liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
      	...
      ORA-00604: error occurred at recursive SQL level 1
      ORA-20000: For GoldenGate, delete cascade constraints must be deferrable
      ORA-06512: at line 64
      
      	oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:440)
      	oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)
      	oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:837)
      
      

            [BSERV-2699] Cannot initialize Oracle schema

            Stefan Saasen (Inactive) added a comment - According to https://answers.atlassian.com/questions/85152/stash-1-3beta-and-oracle-problem suppressing the trigger fixed this.

            Our DBA team will look into this. As for now they were able to circumvent it somehow.
            Error occured on installation using new, empty schema.

            Wojciech Olearczyk added a comment - Our DBA team will look into this. As for now they were able to circumvent it somehow. Error occured on installation using new, empty schema.

            Hi,

            A brief look at the GoldenGate documentation (E21406-02 - Oracle Installation and Setup Guide 11g Release 1 Patch Set 1 (11.1.1.1)) does not indicate that constraints on the source need to be DEFERRABLE (only that "If constraints are DEFERRABLE on the source, the constraints on the target must also be DEFERRABLE.").
            On the target on the other hand "You will need to make some changes to the triggers, cascade update, and cascade delete constraints", listing the following options:

            • For Oracle 10.2.0.5 and later patches to 10.2.0.5, and for Oracle 11.2.0.2 and later 11gR2 versions, you can use the Replicat parameter DBOPTIONS with the SUPPRESSTRIGGERS option to cause Replicat to disable the triggers during its session.
            • For Oracle 9.2.0.7 and later, you can use the Replicat parameter DBOPTIONS with the DEFERREFCONST option to delay the checking and enforcement of cascade update and cascade delete constraints until the Replicat transaction commits.
            • For earlier Oracle versions, you must disable triggers and integrity constraints or alter them manually to ignore the Replicat database user.

            Is any of those option applicable to your situation?

            Does the migration error occur on the source or target database?

            Cheers,
            Stefan

            Stefan Saasen (Inactive) added a comment - Hi, A brief look at the GoldenGate documentation (E21406-02 - Oracle Installation and Setup Guide 11g Release 1 Patch Set 1 (11.1.1.1)) does not indicate that constraints on the source need to be DEFERRABLE (only that "If constraints are DEFERRABLE on the source, the constraints on the target must also be DEFERRABLE."). On the target on the other hand "You will need to make some changes to the triggers, cascade update, and cascade delete constraints", listing the following options: For Oracle 10.2.0.5 and later patches to 10.2.0.5, and for Oracle 11.2.0.2 and later 11gR2 versions, you can use the Replicat parameter DBOPTIONS with the SUPPRESSTRIGGERS option to cause Replicat to disable the triggers during its session. For Oracle 9.2.0.7 and later, you can use the Replicat parameter DBOPTIONS with the DEFERREFCONST option to delay the checking and enforcement of cascade update and cascade delete constraints until the Replicat transaction commits. For earlier Oracle versions, you must disable triggers and integrity constraints or alter them manually to ignore the Replicat database user. Is any of those option applicable to your situation? Does the migration error occur on the source or target database? Cheers, Stefan

            Do you plan to solve this problem somehow? Will Stash support GoldenGate (e.g. by using deferrable constraints with Oracle db only)?
            It seems to be a roadblock for our future Stash installation.

            Wojciech Olearczyk added a comment - Do you plan to solve this problem somehow? Will Stash support GoldenGate (e.g. by using deferrable constraints with Oracle db only)? It seems to be a roadblock for our future Stash installation.

            Hi,
            It looks like you are using Oracle GoldenGate which Stash does not support. Unfortunately MySQL does not support deferrable constraints, which seems to be causing GoldenGate a few issues.

            Regards,
            Seb

            Seb Ruiz (Inactive) added a comment - Hi, It looks like you are using Oracle GoldenGate which Stash does not support. Unfortunately MySQL does not support deferrable constraints, which seems to be causing GoldenGate a few issues. Regards, Seb

              Unassigned Unassigned
              3e793c65704f Wojciech Olearczyk
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: