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

Windows users that have setup a keystore cannot upgrade to 5.x from prior versions due to DB file naming convention

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.0.0, 5.0.1, 5.1.1, 5.1.3
    • Fix Version/s: 5.1.4
    • Component/s: Database, Installer
    • Labels:
      None
    • Environment:

      Windows (any version) and any DB type

      Description

      This bug affects Windows users that are upgrading to 5.x and have setup a keystore in the "Signing Keys" section of the UI.

      The issue is that when you upgrade from any version prior to 5.x and you have configured a keystore for use with GPG signing. When you upgrade to 5.x and the conversion process begins to convert files for 5.x format, it reaches out to the DB and downloads each file from the configs table directly to a temporary directory called db_conversion_temp.

      This is fine in most cases. However, if you have the keystore defined, there exists a file in the configs table called "keystore:password". Artifactory saves the files on the native OS exactly as they appear in the "config_name" part of the configs table. For Windows, you cannot save a file containing the ":" character in it, and therefore the file ends up saved as "keystore" and the contents of it are binary instead of the cleartext keystore password that it should be. This causes the conversion to fail, and thus Artifactory will fail starting up.

      There is a workaround for this: Renaming the file in the DB to keystore.password (notice the "." instead of ":" ) and then starting up Artifactory and then renaming the file back to keystore:password after the conversion was complete will resolve this.

      Steps to reproduce
      1. Create a new instance of Artifactory 4.x or 3.x using Derby or any database you choose on Windows OS, any version.
      2. Insert license
      3. Click on "Signing Keys" in the Admin UI and under Change Key Store Password which is in the Manage Artifactory Signing Keys, create a password and the keystore:password file will be created in the DB
      4. Perform the upgrade and notice the failure in the localhost.<date>.log in $ARTIFACTORY_HOME/logs/catalina

      Startup of Artifactory prior to the workaround of renaming the config_name to not contain the ":" character:
      15-Mar-2017 15:40:08.603 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Using artifactory.home at 'C:/Users/jfrog/Downloads/artifactory-pro-4.14.2/bin/..' resolved from: System property
      15-Mar-2017 15:40:10.697 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.artifactory.webapp.servlet.ArtifactoryHomeConfigListener
      java.lang.RuntimeException: Failed to execute shared environment conversion: Couldn't convert configs table: Illegal char <:> at index 87: C:\Users\jfrog\Downloads\artifactory-pro-4.14.2\bin\..\data\db_conversion_temp\keystore:password : Couldn't convert configs table: Illegal char <:> at index 87: C:\Users\jfrog\Downloads\artifactory-pro-4.14.2\bin\..\data\db_conversion_temp\keystore:password
      at org.artifactory.converter.ConvertersManagerImpl.handleException(ConvertersManagerImpl.java:236)
      at org.artifactory.converter.ConvertersManagerImpl.convert(ConvertersManagerImpl.java:148)
      at org.artifactory.converter.ConvertersManagerImpl.convertHomeSync(ConvertersManagerImpl.java:112)
      at org.artifactory.webapp.servlet.BasicConfigManagers.initHomes(BasicConfigManagers.java:72)
      at org.artifactory.webapp.servlet.BasicConfigManagers.initialize(BasicConfigManagers.java:56)
      at org.artifactory.webapp.servlet.ArtifactoryHomeConfigListener.contextInitialized(ArtifactoryHomeConfigListener.java:53)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4853)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:753)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:729)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:587)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1798)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.RuntimeException: Failed to execute shared environment conversion: Couldn't convert configs table: Illegal char <:> at index 87: C:\Users\jfrog\Downloads\artifactory-pro-4.14.2\bin\..\data\db_conversion_temp\keystore:password
      at org.artifactory.environment.converter.shared.SharedEnvironmentConverter.convert(SharedEnvironmentConverter.java:24)
      at org.artifactory.converter.ConvertersManagerImpl.runConverters(ConvertersManagerImpl.java:274)
      at org.artifactory.converter.ConvertersManagerImpl.convert(ConvertersManagerImpl.java:143)
      ... 17 more
      Caused by: java.lang.RuntimeException: Couldn't convert configs table: Illegal char <:> at index 87: C:\Users\jfrog\Downloads\artifactory-pro-4.14.2\bin\..\data\db_conversion_temp\keystore:password
      at org.artifactory.environment.converter.shared.version.v1.NoNfsDbConfigsTableConverter.doConvert(NoNfsDbConfigsTableConverter.java:53)
      at org.artifactory.environment.converter.shared.version.v1.NoNfsBasicEnvironmentConverter.convert(NoNfsBasicEnvironmentConverter.java:117)
      at org.artifactory.environment.converter.shared.version.SharedEnvironmentVersion.convert(SharedEnvironmentVersion.java:38)
      at org.artifactory.environment.converter.shared.SharedEnvironmentConverter.convert(SharedEnvironmentConverter.java:22)
      ... 19 more
      Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 87: C:\Users\jfrog\Downloads\artifactory-pro-4.14.2\bin\..\data\db_conversion_temp\keystore:password
      at sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
      at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
      at sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
      at sun.nio.fs.WindowsPath.parse(WindowsPath.java:94)
      at sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:255)
      at java.io.File.toPath(File.java:2234)
      at org.artifactory.environment.converter.shared.version.v1.NoNfsDbConfigsTableConverter.createFilesystemBackups(NoNfsDbConfigsTableConverter.java:83)
      at org.artifactory.environment.converter.shared.version.v1.NoNfsDbConfigsTableConverter.doConvert(NoNfsDbConfigsTableConverter.java:47)
      ... 22 more

        Attachments

          Activity

            People

            • Assignee:
              danf Dan Feldman
              Reporter:
              daniela Daniel Augustine
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: