Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18094

Bamboo upgrade fails with 'ENTITY_NAME' is already in use as a COLUMN name on Microsoft SQL Server

    XMLWordPrintable

Details

    Description

      Summary

      During an upgrade to 5.13 or greater, upgrade task 51301 : Change column names to uppercase on Microsoft SQL fails with 51301 : Change column names to uppercase on MS SQL. This occurs when the Containment Type of the database is Partial or Full (e.g. in Azure). Due to the system catalog being a case-insensitive collation, sp_rename to change the column casing thinks there is a duplicate and fails.

      Environment

      • Microsoft SQL 2012+ with a Containment type on the database of Partial or Full (Azure)
      • Upgrade to Bamboo 5.13 or above

      Steps to Reproduce

      • Upgrade a Bamboo Microsoft SQL database with Partial containment type from a version older than 5.13 to a version >=5.13.

      Expected Results

      Upgrade succeeds.

      Actual Results

      The below exception is thrown in the atlassian-bamboo.log file:

      2016-12-19 12:01:58,310 INFO [localhost-startStop-1] [AbstractUpgradeManager] --------------------------------------------------
      2016-12-19 12:01:58,310 INFO [localhost-startStop-1] [AbstractUpgradeManager] 51301 : Change column names to uppercase on MS SQL
      2016-12-19 12:01:58,310 INFO [localhost-startStop-1] [AbstractUpgradeManager] --------------------------------------------------
      2016-12-19 12:01:58,341 ERROR [localhost-startStop-1] [AbstractUpgradeManager] java.sql.SQLException: Error: The new name 'ENTITY_NAME' is already in use as a COLUMN name and would cause a duplicate that is not permitted.
      java.sql.SQLException: Error: The new name 'ENTITY_NAME' is already in use as a COLUMN name and would cause a duplicate that is not permitted.
      	at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
      	at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
      	at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
      	at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:809)
      	at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1282)
      	at com.mchange.v2.c3p0.impl.NewProxyStatement.execute(NewProxyStatement.java:75)
      	at com.atlassian.bamboo.utils.db.MsSqlDbmsBean.renameColumn(MsSqlDbmsBean.java:200)
      	at com.atlassian.bamboo.upgrade.tasks.v5_13.UpgradeTask51301UpperCaseDbColumnNames.doUpgrade(UpgradeTask51301UpperCaseDbColumnNames.java:59)
      

      Workaround

      None

      Attachments

        Issue Links

          Activity

            People

              achystoprudov Alexey Chystoprudov
              jowen@atlassian.com Jeremy Owen
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: