Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-3218

Upgrades can fail when constraints are missing on the database.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Won't Fix
    • None
    • Server administration
    • None
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Changing to an improvement request because it turns out its not a bug, but the customer data was somehow missing certain constraints on the database.

      You get the following error.

      Caused by: com.cenqua.crucible.hibernate.CruDBException: SQL script error on line 12: "alter table cru_completed_frx drop foreign key FK927E9E9F1BD6EA47;" 
      (Error on rename of './fisheye/cru_completed_frx' to './fisheye/#sql2-148e-586' (errno: 152)), please contact http://www.atlassian.com/support/
              at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:395)
              at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:347)
              at com.cenqua.crucible.hibernate.DefaultDBControl.doUpgrade(DefaultDBControl.java:332)
              at com.cenqua.crucible.hibernate.DefaultDBControl.upgrade(DefaultDBControl.java:306)
              ... 93 more
      Caused by: java.sql.SQLException: Error on rename of './fisheye/cru_completed_frx' to './fisheye/#sql2-148e-586' (errno: 152)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
              at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3558)
              at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3490)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2109)
              at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2642)
              at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1647)
              at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1566)
              at com.cenqua.crucible.hibernate.DefaultDBControl.executeScript(DefaultDBControl.java:377)
              ... 96 more

      If its possible, we should check to see if the constraint exists before trying to drop it. If it doesn't exist its no big deal in this case because we were dropping the table right afterwards.

      Attachments

        Activity

          People

            Unassigned Unassigned
            andrew.myers Andrew Myers [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: