devicehive / devicehive-java-server

DeviceHive Java Server
http://www.devicehive.com
Apache License 2.0
364 stars 135 forks source link

how to fix redisson specified at https://github.com/redisson/redisson/issues/4441 #563

Open bhcuong2008 opened 11 months ago

bhcuong2008 commented 11 months ago

Hi, I've had redisson issue in Devicehive frontend and Auth, version latest 4.1.0. And I found the issue fixed at https://github.com/redisson/redisson/issues/4441. Please show me how to update it in frontend and Auth. Currently I use Devicehive docker image 4.1.0.

Thank you.

bhcuong2008 commented 11 months ago

I follow instruction mvn clean package to build devicehive from git, also from release v4.0 zip file. But I found that boot.jar file created different from boot.jar on device docker image. And it could not run due to database schema related, 2023-09-24 04:28:52.947 [main] INFO c.d.a.DeviceHiveBackendApplication - Starting DeviceHiveBackendApplication v4.1.0 using Java 17.0.2 on bcf01f6fcf6c with PID 12 (/opt/devicehive/devicehive-backend-4.1.0-boot.jar started by root in /opt/devicehive) 2023-09-24 04:28:52.967 [main] INFO c.d.a.DeviceHiveBackendApplication - The following 1 profile is active: "ws-kafka-proxy-backend" 2023-09-24 04:28:53.040 [background-preinit] INFO o.h.validator.internal.util.Version - HV000001: Hibernate Validator 6.2.5.Final 2023-09-24 04:28:56.508 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode 2023-09-24 04:28:56.517 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2023-09-24 04:28:56.609 [main] INFO o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 46 ms. Found 0 Redis repository interfaces. 2023-09-24 04:28:59.497 [main] WARN io.undertow.websockets.jsr - UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used 2023-09-24 04:28:59.577 [main] INFO io.undertow.servlet - Initializing Spring embedded WebApplicationContext 2023-09-24 04:28:59.577 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 6395 ms 2023-09-24 04:29:00.719 [main] INFO o.f.c.i.license.VersionPrinter - Flyway Community Edition 8.5.13 by Redgate 2023-09-24 04:29:00.719 [main] INFO o.f.c.i.license.VersionPrinter - See what's new here: https://flywaydb.org/documentation/learnmore/releaseNotes#8.5.13 2023-09-24 04:29:00.719 [main] INFO o.f.c.i.license.VersionPrinter - 2023-09-24 04:29:00.741 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting... 2023-09-24 04:29:01.121 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed. 2023-09-24 04:29:01.177 [main] INFO o.f.c.i.d.base.BaseDatabaseType - Database: jdbc:postgresql://postgres:5432/postgres (PostgreSQL 14.7) 2023-09-24 04:29:01.308 [main] INFO o.f.core.internal.command.DbValidate - Successfully validated 39 migrations (execution time 00:00.079s) 2023-09-24 04:29:01.350 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "public" but no schema history table. Use baseline() or set baselineOnMigrate to true to initialize the schema history table. 2023-09-24 04:29:01.353 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown initiated... 2023-09-24 04:29:01.362 [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Shutdown completed. 2023-09-24 04:29:01.385 [main] INFO o.s.b.a.l.ConditionEvaluationReportLoggingListener -

geosk commented 11 months ago

Hi, It happens because DB already exist and we disabled autoupdate for data protection. You can enable it by editing properties files. Before it it's better to make backup of existing database (if you need it) spring.flyway.baselineOnMigrate=true in devicehive-auth/src/main/resources/application.properties devicehive-backend/src/main/resources/application.properties devicehive-frontend/src/main/resources/application.properties

bhcuong2008 commented 11 months ago

Yes, I did it but only for backend, and enabled spring.flyway.baseline-version=3.4.12 then it succeeded. And with redisson 3.18.0 was built successful. I tested 3.19.3 up to 3.25 and all failed. I faced this issue, https://github.com/redisson/redisson/issues/4451 After some days, randomly, maybe up to 1 month, then the issue occurs.

Currently I build with redisson 3.18.0, and wait for some days/weeks. Thank you.