Forum Discussion

dabrochu's avatar
dabrochu
New Contributor
10 years ago

ERROR [LiquibaseDbInitializer] Failed to initialize database after upgrading to 1.4.1 ReadyAPI.

I recently upgraded from Ready API 1.3.1 to 1.4.1. After upgrading, when I run tests from testrunner.sh, I'm getting errors pointing to LiquibaseDBInitalizer. These weren't seen with the previous version of Ready API. The tests don't have any DB configuration and don't require a DB connection, so I'm not sure why this is happening other than a new configuration in 1.4.1 or some other issue.

 

12:23:13,268 INFO  [LiquibaseDbInitializer] Initializing database..
12:26:54,602 ERROR [LiquibaseDbInitializer] Failed to initialize database
liquibase.exception.LockException: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-176]
	at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:215)
	at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:154)
	at liquibase.Liquibase.update(Liquibase.java:186)
	at liquibase.Liquibase.update(Liquibase.java:181)
	at com.smartbear.ready.db.init.liquibase.LiquibaseDbInitializer.initdb(LiquibaseDbInitializer.java:38)
	at com.smartbear.ready.db.init.liquibase.LiquibaseDbInitializer$$FastClassByGuice$$2a5f2037.invoke(<generated>)
	at com.google.inject.internal.cglib.reflect.$FastMethod.invoke(FastMethod.java:53)
	at com.google.inject.internal.SingleMethodInjector$1.invoke(SingleMethodInjector.java:56)
	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:90)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:83)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.ExposedKeyFactory.get(ExposedKeyFactory.java:54)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:38)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:62)
	at com.google.inject.internal.SingleMethodInjector.inject(SingleMethodInjector.java:83)
	at com.google.inject.internal.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:110)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:94)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.InjectorImpl$4$1.call(InjectorImpl.java:978)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:974)
	at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1013)
	at com.eviware.soapui.SoapUIPro$SoapUIProCore.initCoreComponents(SoapUIPro.java:718)
	at com.eviware.soapui.DefaultSoapUICore.init(DefaultSoapUICore.java:141)
	at com.eviware.soapui.SoapUIPro$SoapUIProCore.init(SoapUIPro.java:574)
	at com.eviware.soapui.SoapUIPro$SoapUIProCore.<init>(SoapUIPro.java:516)
	at com.eviware.soapui.SoapUIPro$SoapUIProCore$$FastClassByGuice$$e6b56c2e.newInstance(<generated>)
	at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
	at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:60)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:85)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:254)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:54)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1031)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.Scopes$1$1.get(Scopes.java:65)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:40)
	at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:204)
	at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:198)
	at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1024)
	at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:198)
	at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:179)
	at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:109)
	at com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:217)
	at com.netflix.governator.guice.LifecycleInjector.createChildInjector(LifecycleInjector.java:254)
	at com.netflix.governator.guice.LifecycleInjector.createInjector(LifecycleInjector.java:321)
	at com.netflix.governator.guice.LifecycleInjector.createInjector(LifecycleInjector.java:275)
	at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.a(AbstractSoapUIRunner.java:242)
	at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.initAfterPropertiesSet(AbstractSoapUIRunner.java:95)
	at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.run(AbstractSoapUIRunner.java:220)
	at com.smartbear.ready.cmd.runner.AbstractSoapUIRunner.runFromCommandLine(AbstractSoapUIRunner.java:145)
	at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.init(SoapUIProTestCaseRunner.java:77)
	at com.smartbear.ready.cmd.runner.pro.SoapUIProTestCaseRunner.main(SoapUIProTestCaseRunner.java:72)
Caused by: liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-176]
	at liquibase.database.AbstractJdbcDatabase.rollback(AbstractJdbcDatabase.java:1119)
	at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187)
	... 71 more
Caused by: liquibase.exception.DatabaseException: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-176]
	at liquibase.database.jvm.JdbcConnection.rollback(JdbcConnection.java:340)
	at liquibase.database.AbstractJdbcDatabase.rollback(AbstractJdbcDatabase.java:1117)
	... 72 more
Caused by: org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-176]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
	at org.h2.message.DbException.get(DbException.java:178)
	at org.h2.message.DbException.get(DbException.java:154)
	at org.h2.engine.SessionRemote.checkClosed(SessionRemote.java:539)
	at org.h2.engine.SessionRemote.removeServer(SessionRemote.java:469)
	at org.h2.command.CommandRemote.executeUpdate(CommandRemote.java:196)
	at org.h2.jdbc.JdbcConnection.rollbackInternal(JdbcConnection.java:1500)
	at org.h2.jdbc.JdbcConnection.rollback(JdbcConnection.java:488)
	at liquibase.database.jvm.JdbcConnection.rollback(JdbcConnection.java:337)
  • Hi dabrochu!

     

    I'm sorrry that you experience these problems.

    Ready! API uses an internal database to collect test run history, so you can compare runs with each other etc, so it's not really related to your tests. This feature was introduced in 1.4.0.

    For some reason this is not working for you and I will try to figure our why.

     

    Does it stop you from running tests or is it more of an annoyance that you get these ugly messages in the log?

     

    Regards,

    Anders

    Ready! API developer

     

    • dabrochu's avatar
      dabrochu
      New Contributor

      Thank you.

       

      To add more context, I'm running testrunner.sh from Jenkins, and I've got mutiple jobs that call out to testrunner.sh to run our regression tests. I'm starting to think that maybe this issue is introduced when multiple runs are calling testrunner.sh and there is a lock on the db file due to multiple test runs?

       

      Is there a way to turn off this new feature? 

      • AJaensson's avatar
        AJaensson
        Staff

        Ok, that makes sense although running multiple instances at once should work. I will have to investigate that.

         

        Unfortunately there is no way to turn this feature off completely at the moment, but it will be possible in the next release.

         

        Regards,

        Anders

        Ready! API developer

         

  • cbaker's avatar
    cbaker
    New Contributor

    I am having this issue when i run in Jenkins.  Delays my tests for over 5 minutes while it tries to resolve the lock.  Very inconvenient.  Please advise.

    • AJaensson's avatar
      AJaensson
      Staff

      Hi,

       

      In 1.5+ you can use the flag -Dtest.history.disabled=true to disable test history completely.

       

      In 1.4.x the easiest way to fix this is to delete your test history database. It's located in $HOME/.readyapi/db. Of course this means that you will loose any test history.

       

      Hope this helps,

      Anders

      Ready! API developer

       

      • cbaker's avatar
        cbaker
        New Contributor

        I have version 1.6.0.   I  did try to use the flag -Dtest.history.disabled=true in my Jenkins shell command as shown below, but still got the same error.

          

        cd RegContactValidationWebSvcSoapUITest/TestSuites
        ${SOAP_UI_PRO_BIN_HOME}/testrunner.sh -j -r -E${Server} -Dtest.history.disabled=true RegContactValidation-soapui-project.xml

         

         

        Please provide steps of how to delete test history database.  I don't know how to get to $HOME/.readyapi/db