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

Database Conversion fails if allowExternalConversionScripts set to true

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Affects Version/s: 7.27.3, 7.31.10
    • Fix Version/s: 7.31.11
    • Component/s: Artifactory, Converter
    • Labels:
      None
    • Location:
      External

      Description

      Problem description:

      Artifactory will fail to start up after upgrade if the system property allowExternalConversionScripts is set to true and there is no External Conversion script provided.

      artifactory.sql.converter.allowExternalConversionScripts=true

       

      Steps to reproduce:

      1. Install Artifactory version 7.29.7*
      2. Add artifactory.sql.converter.allowExternalConversionScripts=true to $JFROG_HOME/artifactory/var/etc/artifactory/artifactory.system.properties
      3. Upgrade to 7.31.10 and start Artifactory

      * Not all Convertors use a Script File and can be externalized. We use specific versions here to reproduce the issue. It can happen in different upgrade paths, i.e. between different versions.

       

      Observed behavior:

      The DB Conversion will fail, Artifactory tries to execute "null" SQL query against the Database

       

      2022-01-18T11:46:45.321Z [jfrt ] [INFO ] [966a62a09f2611f3] [o.j.c.AbstractDbConverter:36  ] [ocalhost-startStop-2] - Starting converter v103 with description: "v103_binaries_tasks"
      2022-01-18T11:46:45.333Z [jfrt ] [INFO ] [966a62a09f2611f3] [o.j.c.AbstractDbConverter:51  ] [ocalhost-startStop-2] - Converter `v103` is done with status `FAILED`.
      2022-01-18T11:46:45.340Z [jfrt ] [ERROR] [966a62a09f2611f3] [d.c.m.ConverterManagerImpl:277] [ocalhost-startStop-2] - Conversion failed. You should analyze the error and retry launching Artifactory. Error is: Failed to convert v103 : Failed to convert v103
      2022-01-18T11:46:45.344Z [jfrt ] [ERROR] [966a62a09f2611f3] [tifactoryHomeConfigListener:55] [ocalhost-startStop-2] - Failed initializing Home. Caught exception:
      java.lang.IllegalStateException: Failed to convert v103 : Failed to convert v103
      	at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.handleException(ConverterManagerImpl.java:280)
      	at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.serviceConvert(ConverterManagerImpl.java:238)
      	at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
      	at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
      	at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.convertDatabase(ConverterManagerImpl.java:156)
      	at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.convertAndInit(PostDbSchemaInitializationManager.java:61)
      	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:4763)
      	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5232)
      	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
      	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:727)
      	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:695)
      	at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:673)
      	at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1881)
      	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:829)
      Caused by: org.jfrog.converter.DbConverterRuntimeException: Failed to convert v103
      	at org.artifactory.storage.db.DatabaseConverterAdapter.convert(DatabaseConverterAdapter.java:49)
      	at org.artifactory.storage.db.converter.markers.ConverterManagerImpl.serviceConvert(ConverterManagerImpl.java:234)
      	... 23 common frames omitted
      Caused by: org.jfrog.converter.DbConverterExecutionException: Failed to convert v103
      	at org.jfrog.converter.util.DbConverterUtil.executeConverters(DbConverterUtil.java:79)
      	at org.jfrog.converter.util.DbConverterUtil.calculateAndExecute(DbConverterUtil.java:114)
      	at org.artifactory.storage.db.DatabaseConverterAdapter.convert(DatabaseConverterAdapter.java:44)
      	... 24 common frames omitted
      Caused by: org.jfrog.converter.DbConverterExecutionException: Failed to convert v103
      	at org.jfrog.converter.AbstractDbConverter.convert(AbstractDbConverter.java:49)
      	at org.jfrog.converter.util.DbConverterUtil.executeConverters(DbConverterUtil.java:75)
      	... 26 common frames omitted
      Caused by: java.lang.NullPointerException: null
      	at org.jfrog.converter.predefined.CommonScriptFileDbConverter.executeConverter(CommonScriptFileDbConverter.java:72)
      	at org.jfrog.converter.AbstractDbConverter.convert(AbstractDbConverter.java:39)
      	... 27 common frames omitted
      2022-01-18T11:46:45.347Z [jfrt ] [ERROR] [966a62a09f2611f3] [actoryContextConfigListener:92] [ocalhost-startStop-2] - Failed initializing Artifactory context: Artifactory home not initialized.

       

       

      Expected behavior:

      The expected behavior from Artifactory, in this case, is to fall back to the default SQL Conversion script.

       

      Possible workaround:

      Remove the system property allowExternalConversionScripts or set it to false:

      artifactory.sql.converter.allowExternalConversionScripts=false

       

       

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              valeriyp Valeriy Petrov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26720 -
                  ERROR
                  • Last Sync Date: