0

Whenever I modify my entities using import-jdl and restart application liquidbase validation is failing.

I am using JHipster 6.10.4 version and H2 disk persisted database. Below is the error I observe during application startup after entity modification.

Using a Base64-encoded JWT secret key
2020-10-26 16:33:30.157 ERROR 27517 --- [lication-task-1] i.g.j.c.liquibase.AsyncSpringLiquibase   : Liquibase could not start correctly, your database is NOT ready: Validation Failed:
     3 change sets check sum
          config/liquibase/changelog/20201008101647_added_entity_Products.xml::20201008101647-1::jhipster was: 8:5c7c3477fc615bc47d5e38b9f9805feb but is now: 8:70169409b8c2b00caed8c37abc10e540
          config/liquibase/changelog/20201008101647_added_entity_Products.xml::20201008101647-1-relations::jhipster was: 8:d41d8cd98f00b204e9800998ecf8427e but is now: 8:c3a005bac4a15f61fb40521c1a48cde0
          config/liquibase/changelog/20201008101647_added_entity_constraints_Products.xml::20201008101647-2::jhipster was: 8:48e44fda2a93b7f8e669f343d103f792 but is now: 8:8a685c1b7a6c292a43c203c55f7bafb1


liquibase.exception.ValidationFailedException: Validation Failed:
     3 change sets check sum
          config/liquibase/changelog/20201008101647_added_entity_Products.xml::20201008101647-1::jhipster was: 8:5c7c3477fc615bc47d5e38b9f9805feb but is now: 8:70169409b8c2b00caed8c37abc10e540
          config/liquibase/changelog/20201008101647_added_entity_Products.xml::20201008101647-1-relations::jhipster was: 8:d41d8cd98f00b204e9800998ecf8427e but is now: 8:c3a005bac4a15f61fb40521c1a48cde0
          config/liquibase/changelog/20201008101647_added_entity_constraints_Products.xml::20201008101647-2::jhipster was: 8:48e44fda2a93b7f8e669f343d103f792 but is now: 8:8a685c1b7a6c292a43c203c55f7bafb1

    at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:288)
    at liquibase.Liquibase.update(Liquibase.java:198)
    at liquibase.Liquibase.update(Liquibase.java:179)
    at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366)
    at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314)
    at org.springframework.boot.autoconfigure.liquibase.DataSourceClosingSpringLiquibase.afterPropertiesSet(DataSourceClosingSpringLiquibase.java:46)
    at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.initDb(AsyncSpringLiquibase.java:118)
    at io.github.jhipster.config.liquibase.AsyncSpringLiquibase.lambda$afterPropertiesSet$0(AsyncSpringLiquibase.java:93)
    at io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor.lambda$createWrappedRunnable$1(ExceptionHandlingAsyncTaskExecutor.java:78)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

2020-10-26 16:33:30.724 DEBUG 27517 --- [  restartedMain] c.m.l.config.DatabaseConfiguration       : H2 database is available on port 18080

Is there anyway we can stop this happening?

Mahesh Vemula
  • 145
  • 2
  • 14
  • Does this answer your question? [jhipster liquibase validation error after modify entity](https://stackoverflow.com/questions/43207163/jhipster-liquibase-validation-error-after-modify-entity) Please read also the official docs https://www.jhipster.tech/development/#database-updates-with-the-maven-liquibasediff-goal – Gaël Marziou Oct 26 '20 at 22:55
  • Links in the above comment showing alternative ways instead of JHipster auto generated method. @GaëlMarziou: Will JHipster able to automate this process without issues – Mahesh Vemula Oct 27 '20 at 05:05
  • 1
    It's not really about alternative ways, it's just how to use it. Yes this feature is planned for JHipster 7 and is already available on main branch if you want to test it before release https://github.com/jhipster/generator-jhipster/issues/12178 – Gaël Marziou Oct 27 '20 at 09:11

0 Answers0