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

upgrade from 6.x -> 7.x fails because artifactory fails to check if logback.xml exists

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: 4 - Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 7.11.1, 7.12.3
    • Component/s: None
    • Labels:
      None
    • Severity:
      Medium
    • Release Notes:
      No

      Description

      The upgrade from 6.x -> 7.x fails because artifactory fails to check if logback.xml exists with
      org.artifactory.logging.version.LoggingVersion#convert(org.artifactory.version.ArtifactoryVersion, java.io.File, java.io.File)
      error in the logs: 

       

      2020-10-29T17:39:04.307Z [jfrt ] [ERROR] [5293ccc551733b18] [o.a.l.v.LoggingVersion:83     ] [ocalhost-startStop-2] - Error occurred while converting logback config for conversion: File '/opt/jfrog/artifactory/var/etc/artifactory/logback.xml' does not exist.2020-10-29T17:39:04.307Z [jfrt ] [ERROR] [5293ccc551733b18] [o.a.l.v.LoggingVersion:83     ] [ocalhost-startStop-2] - Error occurred while converting logback config for conversion: File '/opt/jfrog/artifactory/var/etc/artifactory/logback.xml' does not exist.2020-10-29T17:39:04.311Z [jfrt ] [ERROR] [5293ccc551733b18] [o.a.l.c.LoggingConverter:69   ] [ocalhost-startStop-2] - Failed to execute logging conversion.java.io.FileNotFoundException: File '/opt/jfrog/artifactory/var/etc/artifactory/logback.xml' does not exist at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:2368) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:2486) at org.apache.commons.io.FileUtils.readFileToString(FileUtils.java:2503) at org.artifactory.logging.version.LoggingVersion.convert(LoggingVersion.java:80) at org.artifactory.logging.version.LoggingVersion.convert(LoggingVersion.java:113) at org.artifactory.logging.converter.LoggingConverter.convert(LoggingConverter.java:60) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.runConverters(ConverterManagerImpl.java:300) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convert(ConverterManagerImpl.java:183) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convertHome(ConverterManagerImpl.java:144) at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.convertAndInit(PostDbSchemaInitializationManager.java:65) at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideLock(HaInitLock.java:120) at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideInitLockIfNeeded(HaInitLock.java:85) at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.init(PostDbSchemaInitializationManager.java:50) at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initArtifactoryInstallation(BasicConfigurationManager.java:141) at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initialize(BasicConfigurationManager.java:125) at org.artifactory.lifecycle.webapp.servlet.ArtifactoryHomeConfigListener.contextInitialized(ArtifactoryHomeConfigListener.java:57) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155) 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:614) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1822) 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)
      2020-10-29T17:41:05.188Z [jfrt ] [INFO ] [841ef59a7a709e88] [d.c.m.ConverterManagerImpl:181] [ocalhost-startStop-2] - Triggering PRE_INIT conversion, from 6.14.2 to 7.10.2
      2020-10-29T17:41:05.189Z [jfrt ] [INFO ] [841ef59a7a709e88] [InitReplaceLogbackConverter:33] [ocalhost-startStop-2] - Starting logback conversion --> Backup up old log dir reference
      2020-10-29T17:41:05.195Z [jfrt ] [INFO ] [841ef59a7a709e88] [d.c.m.ConverterManagerImpl:184] [ocalhost-startStop-2] - Finished PRE_INIT conversion, current version is: 7.10.2
       
      

       

       This causes Artifactory to constantly restart from the beginning causing duplicate columns errors while the db is attempting schema changes, ultimately causing the upgrade to fail. 

      do conversion errors: 

      2020-11-04T18:46:31.668Z [jfrt ] [ERROR] [83999dcce6cb452c] [d.c.m.ConverterManagerImpl:249] [ocalhost-startStop-2] - Conversion failed. You should analyze the error and retry launching Artifactory. Error is: Could not convert DB using v219_add_type_to_node_event_cursor converter : Duplicate column name 'type'2020-11-04T18:46:31.668Z [jfrt ] [ERROR] [83999dcce6cb452c] [d.c.m.ConverterManagerImpl:249] [ocalhost-startStop-2] - Conversion failed. You should analyze the error and retry launching Artifactory. Error is: Could not convert DB using v219_add_type_to_node_event_cursor converter : Duplicate column name 'type'2020-11-04T18:46:31.668Z [jfrt ] [ERROR] [83999dcce6cb452c] [tifactoryHomeConfigListener:62] [ocalhost-startStop-2] - Failed initializing Home. Caught exception: java.lang.IllegalStateException: Could not convert DB using v219_add_type_to_node_event_cursor converter : Duplicate column name 'type' at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.handleException(ConverterManagerImpl.java:252) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.serviceConvert(ConverterManagerImpl.java:210) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convertDatabase(ConverterManagerImpl.java:150) at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.convertAndInit(PostDbSchemaInitializationManager.java:61) at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideLock(HaInitLock.java:120) at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideInitLockIfNeeded(HaInitLock.java:85) at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.init(PostDbSchemaInitializationManager.java:50) at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initArtifactoryInstallation(BasicConfigurationManager.java:141) at org.artifactory.lifecycle.webapp.servlet.BasicConfigurationManager.initialize(BasicConfigurationManager.java:125) at org.artifactory.lifecycle.webapp.servlet.ArtifactoryHomeConfigListener.contextInitialized(ArtifactoryHomeConfigListener.java:57) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155) 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:614) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1822) 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)Caused by: java.lang.RuntimeException: Could not convert DB using v219_add_type_to_node_event_cursor converter at org.artifactory.storage.db.version.converter.DbSqlConverterUtil.convert(DbSqlConverterUtil.java:95) at org.artifactory.storage.db.version.converter.DBSqlConverter.lambda$convert$0(DBSqlConverter.java:49) at org.jfrog.storage.util.DbUtils.doWithConnection(DbUtils.java:516) at org.artifactory.storage.db.version.converter.DBSqlConverter.convert(DBSqlConverter.java:49) at org.artifactory.storage.db.DatabaseConverterAdapter.convert(DatabaseConverterAdapter.java:58) at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.serviceConvert(ConverterManagerImpl.java:206) ... 23 common frames omittedCaused by: java.sql.SQLSyntaxErrorException: Duplicate column name 'type' at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122) at com.mysql.cj.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1335) at com.mysql.cj.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2108) at com.mysql.cj.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1245) 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:54) 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) ... 28 common frames omitted

      Solution: make the converter check if the logback.xml file exists

        Attachments

          Activity

            People

            Assignee:
            nadavy Nadav Yogev
            Reporter:
            mariy Mari Yamaguchi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Sync Status

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