Artifactory database migration to Postgres error

  artifactory, postgresql, windows

I tried to migrate from the embedded derby database to PostgreSQL without success. I managed to get the connections settings on the system.yaml config but now it is failing on initialization with the following error: org.postgresql.util.PSQLException: ERROR: relation "artifactory_servers" does not exist

This is on artifactory version 7.6.3 running on Windows Server 2019, connecting to an Azure PosrgreSQL db instance

If I check on the Postgres server I see that a bunch of tables were created.

Full stack:

    `021-03-07T17:53:22.467Z [1;32m[jfrt ][0;39m [1;31m[ERROR][0;39m [860e6cabc013fca9] [tifactoryHomeConfigListener:62] [ocalhost-startStop-2] - Failed initializing Home. Caught exception: 
        org.artifactory.storage.StorageException: Failed to get Artifactory server [artifactory]
        at org.artifactory.storage.db.servers.service.ArtifactoryServersServiceImpl.getArtifactoryServer(ArtifactoryServersServiceImpl.java:68)
        at org.artifactory.lifecycle.storage.db.servers.service.ArtifactoryServersCommonServiceImpl.getArtifactoryServer(ArtifactoryServersCommonServiceImpl.java:142)
        at org.artifactory.state.ArtifactoryStateManagerUtil.createOrUpdateArtifactoryServerState(ArtifactoryStateManagerUtil.java:32)
        at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.createInitialServerState(PostDbSchemaInitializationManager.java:72)
        at org.artifactory.lifecycle.storage.db.init.PostDbSchemaInitializationManager.convertAndInit(PostDbSchemaInitializationManager.java:63)
        at org.artifactory.lifecycle.storage.db.init.HaInitLock.runInsideInitLockIfNeeded(HaInitLock.java:81)
        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:4697)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5163)
        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: org.postgresql.util.PSQLException: ERROR: relation "artifactory_servers" does not exist
        Position: 15
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2553)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2285)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:323)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:481)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:401)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:164)
        at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:114)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
        at com.sun.proxy.$Proxy32.executeQuery(Unknown Source)
        at org.jfrog.storage.JdbcHelper.executeSelect(JdbcHelper.java:120)
        at org.jfrog.storage.JdbcHelper.executeSelect(JdbcHelper.java:92)
        at org.artifactory.storage.db.servers.dao.ArtifactoryServersDao.getArtifactoryServer(ArtifactoryServersDao.java:74)
        at org.artifactory.storage.db.servers.service.ArtifactoryServersServiceImpl.getArtifactoryServer(ArtifactoryServersServiceImpl.java:66)
        ... 22 common frames omitted`

Source: Windows Questions

LEAVE A COMMENT