Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-25895

Artifactory upgrade with MSSQL from 6.x to 7.x failing on DB conversions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Upgrade
    • Labels:
      None
    • Location:
      External

      Description

      Description:

      When attempting to upgrade Artifactory with MSSQL database from version 6.x to 7.x the upgrade will fail with database conversion related errors.

       

      Steps to reproduce:

      Tested with Artifactory version *6.23.16 (current latest 6.x) and upgrade to version 7.18.6 (current latest 7.x), MSSQL 2017

      1. Install Artifactory version 6.10 or above
      2. Install MSSQL database and configure Artifactory accordingly.
      3. Start Artifactory and complete the on-boarding process
      4. Stop Artifactory
      5. Upgrade Artifactory to the latest version (currently 7.18.6)
      6. Start Artifactory
      7. Tail the logs during startup and notice it fails on DB conversion error as below
      2021-05-10T08:48:57.350Z [jfrt ] [WARN ] [556cae64e4b524e0] [o.j.s.u.DbStatementUtils:62   ] [ocalhost-startStop-2] - Failed to execute query: The index 'node_events_errors_idx' is dependent on column 'event_category'.:ALTER TABLE node_events_errors ALTER COLUMN event_category VARCHAR(255) NOT NULL2021-05-10T08:48:57.370Z [jfrt ] [ERROR] [556cae64e4b524e0] [.s.d.v.c.DbSqlConverterUtil:94] [ocalhost-startStop-2] - Could not convert DB using v224_change_null_event_category_to_replication converter due to The index 'node_events_errors_idx' is dependent on column 'event_category'.com.microsoft.sqlserver.jdbc.SQLServerException: The index 'node_events_errors_idx' is dependent on column 'event_category'.at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:262)at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1632)at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:872)at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:767)at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:7418)at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:3272)at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:247)at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:222)at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeUpdate(SQLServerStatement.java:710)at com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:120)at com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)at org.jfrog.storage.dbtype.DefaultDbTypeHelper.executeUpdateQuery(DefaultDbTypeHelper.java:68)at org.jfrog.storage.util.DbStatementUtils.executeSqlStream(DbStatementUtils.java:57)at org.artifactory.storage.db.version.converter.DbSqlConverterUtil.doConvert(DbSqlConverterUtil.java:102)at org.artifactory.storage.db.version.converter.DbSqlConverterUtil.convert(DbSqlConverterUtil.java:90)at org.artifactory.storage.db.version.converter.DBSqlConverter.lambda$convert$0(DBSqlConverter.java:49)at org.jfrog.storage.util.DbUtils.doWithConnection(DbUtils.java:537)at org.artifactory.storage.db.version.converter.DBSqlConverter.convert(DBSqlConverter.java:49)at org.artifactory.storage.db.environment.converter.shared.version.v3.NullEventCategoryToReplicationConverter.convert(NullEventCategoryToReplicationConverter.java:31)at org.artifactory.storage.db.environment.converter.shared.version.SharedEnvironmentVersion.convert(SharedEnvironmentVersion.java:55)at org.artifactory.storage.db.environment.converter.shared.version.SharedEnvironmentConverter.convert(SharedEnvironmentConverter.java:41)at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.runConverters(ConverterManagerImpl.java:328)at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convert(ConverterManagerImpl.java:214)at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convertHomeSync(ConverterManagerImpl.java:141)at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.convertAndInit(PostDbSchemaInitializationManager.java:66)at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideInitLockIfNeeded(HaInitLock.java:110)at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.init(PostDbSchemaInitializationManager.java:50)at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initArtifactoryInstallation(BasicConfigurationManager.java:154)at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initialize(BasicConfigurationManager.java:126)at org.artifactory.lifecycle.webapp.servlet.ArtifactoryHomeConfigListener.initBasicConfigManager(ArtifactoryHomeConfigListener.java:61)at org.artifactory.lifecycle.webapp.servlet.ArtifactoryHomeConfigListener.contextInitialized(ArtifactoryHomeConfigListener.java:53)at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:606)at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1766)at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)at java.base/java.lang.Thread.run(Thread.java:834)2021-05-10T08:48:57.414Z [jfrt ] [ERROR] [556cae64e4b524e0] [d.c.m.ConverterManagerImpl:277] [ocalhost-startStop-2] - Conversion failed. You should analyze the error and retry launching Artifactory. Error is: Failed to execute shared environment conversion: Could not convert DB using v224_change_null_event_category_to_replication converter : Could not convert DB using v224_change_null_event_category_to_replication converter
      

      **Note that the error regarding the conversion task may be different depending on the versions used for the upgrade.

       

      Possible workaround:

      1. Upgrade to any 7.7 ≤ Artifactory version < 7.11, i.e. [7.7; 7.11)  
      2. Proceed with upgrading to 7.11 or above

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              kfira Kfir Avraham
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-25898 -
                  SYNCHRONIZED
                  • Last Sync Date: