[SOLVED] Upgrade to 2.1.2

Unimus support forum
Post Reply
User avatar
lweidig
Posts: 31
Joined: Fri Jan 12, 2018 4:43 pm

Fri Sep 17, 2021 3:24 pm

We are attempting to upgrade from 1.10.1 to 2.1.2 using the jar file. During the restart of the service we get:

Code: Select all

2021-09-17 10:13:43.817  INFO 2574 --- [main] n.unimus.starter.composite.Application   : Starting Application v2.1.2 using Java 11.0.11 on unimus-1 with PID 2574 (/opt/unimus/Unimus.jar started by root in /opt/unimus)
2021-09-17 10:13:43.823  INFO 2574 --- [main] n.unimus.starter.composite.Application   : The following profiles are active: jar,composite,unimus,core,unix,unimus-unix
2021-09-17 10:14:05.867  INFO 2574 --- [main] n.unimus.starter.composite.Application   : Started Application in 23.228 seconds (JVM running for 24.435)
2021-09-17 10:14:06.865  INFO 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.LoggingPathAccessibility  : Checking logging subsystem
2021-09-17 10:14:06.868  INFO 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck   : Testing database connection
2021-09-17 10:14:07.137  INFO 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck   : Database connection test passed
2021-09-17 10:14:07.138  INFO 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Connecting to database (MYSQL, jdbc:mysql://localhost:3306/unimus?allowPublicKeyRetrieval=true&useSSL=false&serverTimezone=UTC)
2021-09-17 10:14:07.141  INFO 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Updating database schema
2021-09-17 10:14:10.120  WARN 2574 --- [SimpleAsyncTaskExecutor-1] liquibase.hub                            : Skipping auto-registration
2021-09-17 10:14:10.318 ERROR 2574 --- [SimpleAsyncTaskExecutor-1] n.u.b.d.LiquibaseChangeExecListenerImpl  : Failed to migrate importer configs to sync presets. Default zone not found.
2021-09-17 10:14:10.321 ERROR 2574 --- [SimpleAsyncTaskExecutor-1] n.u.b.d.LiquibaseChangeExecListenerImpl  : Failed to execute, rolling-back transaction

java.lang.RuntimeException: Failed to migrate importer configs to sync presets. Default zone not found.
        at net.unimus.business.database.LiquibaseChangeExecListenerImpl.getDefaultZoneId(LiquibaseChangeExecListenerImpl.java:1427)
        at net.unimus.business.database.LiquibaseChangeExecListenerImpl.migrateNetxmsImporterConfigToSyncPreset(LiquibaseChangeExecListenerImpl.java:962)
        at net.unimus.business.database.LiquibaseChangeExecListenerImpl.migrateImporterConfigsToSyncPresets(LiquibaseChangeExecListenerImpl.java:885)
        at net.unimus.business.database.LiquibaseChangeExecListenerImpl.ran(LiquibaseChangeExecListenerImpl.java:348)
        at liquibase.changelog.visitor.UpdateVisitor.fireRan(UpdateVisitor.java:79)
        at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:57)
        at liquibase.changelog.ChangeLogIterator$2.lambda$null$0(ChangeLogIterator.java:111)
        at liquibase.Scope.lambda$child$0(Scope.java:160)
        at liquibase.Scope.child(Scope.java:169)
        at liquibase.Scope.child(Scope.java:159)
        at liquibase.Scope.child(Scope.java:138)
        at liquibase.changelog.ChangeLogIterator$2.lambda$run$1(ChangeLogIterator.java:110)
        at liquibase.Scope.lambda$child$0(Scope.java:160)
        at liquibase.Scope.child(Scope.java:169)
        at liquibase.Scope.child(Scope.java:159)
        at liquibase.Scope.child(Scope.java:138)
        at liquibase.Scope.child(Scope.java:222)
        at liquibase.changelog.ChangeLogIterator$2.run(ChangeLogIterator.java:94)
        at liquibase.Scope.lambda$child$0(Scope.java:160)
        at liquibase.Scope.child(Scope.java:169)
        at liquibase.Scope.child(Scope.java:159)
        at liquibase.Scope.child(Scope.java:138)
        at liquibase.Scope.child(Scope.java:222)
        at liquibase.Scope.child(Scope.java:226)
        at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:66)
        at liquibase.Liquibase.lambda$null$0(Liquibase.java:273)
        at liquibase.Scope.lambda$child$0(Scope.java:160)
        at liquibase.Scope.child(Scope.java:169)
        at liquibase.Scope.child(Scope.java:159)
        at liquibase.Scope.child(Scope.java:138)
        at liquibase.Scope.child(Scope.java:222)
        at liquibase.Liquibase.lambda$update$1(Liquibase.java:272)
        at liquibase.Scope.lambda$child$0(Scope.java:160)
        at liquibase.Scope.child(Scope.java:169)
        at liquibase.Scope.child(Scope.java:159)
        at liquibase.Scope.child(Scope.java:138)
        at liquibase.Liquibase.runInScope(Liquibase.java:2322)
        at liquibase.Liquibase.update(Liquibase.java:216)
        at liquibase.Liquibase.update(Liquibase.java:202)
        at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:322)
        at net.unimus.business.database.DatabaseUpdateSupport.update(DatabaseUpdateSupport.java:56)
        at net.unimus.business.database.Database.update(Database.java:246)
        at net.unimus.business.database.Database$$FastClassBySpringCGLIB$$47ee56e2.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692)
        at net.unimus.business.database.Database$$EnhancerBySpringCGLIB$$a1959b51.update(<generated>)
        at net.unimus.system.bootstrap.boot.step.DatabaseUpdate.run(DatabaseUpdate.java:33)
        at net.unimus.system.bootstrap.boot.Boot.boot(Boot.java:94)
        at net.unimus.system.bootstrap.boot.Boot$$FastClassBySpringCGLIB$$e357c3b1.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:779)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.lang.Thread.run(Thread.java:829)

2021-09-17 10:14:10.647 ERROR 2574 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Failed to update database schema. Reason = 'liquibase.exception.LiquibaseException: java.lang.RuntimeException: Failed to migrate importer configs to sync presets'
This is an Ubuntu 20.04.3 system.
Last edited by lweidig on Tue Sep 21, 2021 9:48 pm, edited 1 time in total.
Vik@Unimus
Posts: 198
Joined: Thu Aug 05, 2021 6:35 pm

Fri Sep 17, 2021 3:53 pm

Hello,

Thank you for the log. I have forwarded the log you sent to our developer. We will investigate the problem and I will update you ASAP.
User avatar
lweidig
Posts: 31
Joined: Fri Jan 12, 2018 4:43 pm

Fri Sep 17, 2021 4:17 pm

Thanks for quick response, hope a quick fix as well! Just for completeness we tried reverting to 1.10.1 but that now fails with:

Code: Select all

2021-09-17 10:27:09.860  INFO 2848 --- [main] net.unimus.Application                   : Starting Application v1.10.1 on unimus-1 with PID 2848 (/opt/unimus/Unimus.jar started by root in /opt/unimus)
2021-09-17 10:27:09.865  INFO 2848 --- [main] net.unimus.Application                   : The following profiles are active: together,unix,jar
2021-09-17 10:27:14.132  INFO 2848 --- [main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat initialized with port(s): 443 (https)
2021-09-17 10:27:26.625  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.LoggingPathAccessibility  : Checking logging subsystem
2021-09-17 10:27:26.664  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck   : Testing database connection
2021-09-17 10:27:26.989  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.b.step.DatabaseConnectionCheck   : Database connection test passed
2021-09-17 10:27:26.990  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Connecting to database (MYSQL, jdbc:mysql://localhost:3306/unimus?allowPublicKeyRetrieval=true&useSSL=false)
2021-09-17 10:27:26.991  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Updating database schema
2021-09-17 10:27:27.215  INFO 2848 --- [main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 443 (https)
2021-09-17 10:27:27.227  INFO 2848 --- [main] net.unimus.Application                   : Started Application in 18.441 seconds (JVM running for 18.977)
2021-09-17 10:27:30.175  INFO 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Database schema updated successfully
2021-09-17 10:27:31.049  WARN 2848 --- [SimpleAsyncTaskExecutor-1] net.unimus.business.database.Database    : Connection failed

javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [job_type] in table [device]
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:396)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:371)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:336)
        at net.unimus.business.database.Database.connect(Database.java:176)
        at net.unimus.business.database.Database$$FastClassBySpringCGLIB$$47ee56e2.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:671)
        at net.unimus.business.database.Database$$EnhancerBySpringCGLIB$$a03ca44c.connect(<generated>)
        at net.unimus.system.bootstrap.boot.step.DatabaseUpdate.run(DatabaseUpdate.java:37)
        at net.unimus.system.bootstrap.boot.Boot.boot(Boot.java:94)
        at net.unimus.system.bootstrap.boot.Boot$$FastClassBySpringCGLIB$$e357c3b1.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:736)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor$1.call(AsyncExecutionInterceptor.java:115)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [job_type] in table [device]
        at org.hibernate.tool.schema.internal.SchemaValidatorImpl.validateTable(SchemaValidatorImpl.java:85)
        at org.hibernate.tool.schema.internal.SchemaValidatorImpl.doValidation(SchemaValidatorImpl.java:50)
        at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:91)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:475)
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)
        at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:360)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:384)
        ... 20 common frames omitted

2021-09-17 10:27:31.050  WARN 2848 --- [SimpleAsyncTaskExecutor-1] n.u.s.b.boot.step.DatabaseUpdate         : Failed to update database schema. Reason = javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.tool.schema.spi.SchemaManagementException: Schema-validation: missing column [job_type] in table [device]
We are pretty much stuck with no working system at this point.
User avatar
lweidig
Posts: 31
Joined: Fri Jan 12, 2018 4:43 pm

Tue Sep 21, 2021 9:49 pm

Thanks to the Unimus team for fixing this issue through a set of custom scripts run on our server. We are up and running with the latest release and look forward to exploring the new features.

Thanks again!
Vik@Unimus
Posts: 198
Joined: Thu Aug 05, 2021 6:35 pm

Fri Oct 22, 2021 12:21 pm

As an update, we brought a fix for the root cause of this issue in the new Unimus version 2.1.3 to make sure this issue will not pop up again.
Post Reply