question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.13.0.Final: Flyway Migration checksum mismatch

See original GitHub issue

Describe the bug

I just updated my service from Quarkus 1.12.3.Final to 1.13.0.Final and now it crashes (no other changes) during startup due to the following Flyway error: Validate failed: Migrations have failed validation.

2022-09-29 16:42:35,209 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation
Migration checksum mismatch for migration version 2.2.0
-> Applied to database : 489677976
-> Resolved locally    : -1831618313
Either revert the changes to the migration, or run repair to update the schema history.
Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE
	at org.flywaydb.core.Flyway.lambda$migrate$0(Flyway.java:134)
	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:204)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:128)
	at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:79)
	at io.quarkus.deployment.steps.FlywayProcessor$startActions1770701860.deploy_0(Unknown Source)
	at io.quarkus.deployment.steps.FlywayProcessor$startActions1770701860.deploy(Unknown Source)
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:110)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:69)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:122)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:833)

2022-09-29 16:42:35,213 INFO  [io.qua.dep.dev.IsolatedDevModeMain] (main) Attempting to start live reload endpoint to recover from previous Quarkus startup failure
2022-09-29 16:42:35,215 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/shared/utils/cli/CommandLineException
	at io.quarkus.deployment.dev.IsolatedDevModeMain$1.accept(IsolatedDevModeMain.java:117)
	at io.quarkus.deployment.dev.IsolatedDevModeMain$1.accept(IsolatedDevModeMain.java:93)
	at io.quarkus.runtime.ApplicationLifecycleManager.lambda$setDefaultExitCodeHandler$0(ApplicationLifecycleManager.java:364)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:208)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:69)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:122)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.utils.cli.CommandLineException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:490)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:440)
	... 14 more

2022-09-29 16:42:35,215 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.NoClassDefFoundError: org/apache/maven/shared/utils/cli/CommandLineException
	at io.quarkus.deployment.dev.IsolatedDevModeMain$1.accept(IsolatedDevModeMain.java:117)
	at io.quarkus.deployment.dev.IsolatedDevModeMain$1.accept(IsolatedDevModeMain.java:93)
	at io.quarkus.runtime.ApplicationLifecycleManager.lambda$setDefaultExitCodeHandler$0(ApplicationLifecycleManager.java:364)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:208)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:69)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:122)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.maven.shared.utils.cli.CommandLineException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:490)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:440)
	... 14 more

To be clear, no migration should be triggered. The database is already at the newest migration and the exact same service works with 1.12.3.Final.

Furthermore, I wonder if these ClassNotFoundExceptions are “normal” or “expected”. They certainly look wrong.

I’ll try to create a reproducer later.

Expected behavior

Flyway should still work with the newer Quarkus version.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

All my dependencies in the project:


dependencies {
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation 'io.quarkus:quarkus-arc'

    implementation 'io.quarkus:quarkus-resteasy-reactive'
    implementation 'io.quarkus:quarkus-resteasy-reactive-kotlin'
    implementation 'io.quarkus:quarkus-resteasy-reactive-jackson'

    implementation 'io.quarkus:quarkus-kotlin'
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
    implementation 'com.fasterxml.jackson.module:jackson-module-kotlin'

    implementation 'io.quarkus:quarkus-hibernate-orm'
    implementation 'io.quarkus:quarkus-jdbc-postgresql'
    implementation 'io.quarkus:quarkus-flyway'
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:14 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
gsmetcommented, Sep 30, 2022

I added the entry in the migration guide, thanks @rmanibus .

I also fixed the CNFE for 2.13.1.Final so all should be good. Closing.

1reaction
rmanibuscommented, Sep 29, 2022

I noticed the same thing on my project, flyway started to validate checksums in quarkus 2.13. enabling quarkus.flyway.repair-at-start align all the checksums in the history table and allow the application to start again. I think this only happen if a migration has been modified after it has been applied.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Flyway - Quarkus
Flyway is a popular database migration tool that is commonly used in JVM environments. Quarkus provides first class support for using Flyway as...
Read more >
neo4j-migrations/CHANGELOG.md at main - GitHub
Automated script runner aka "Migrations" for Neo4j. Inspired by Flyway. - neo4j-migrations/CHANGELOG.md at main · michael-simons/neo4j-migrations.
Read more >
java Cookbook - Chef Supermarket
This recipe installs the openjdk flavor of Java. It also uses the alternatives system on RHEL/Debian families to set the default Java. On ......
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Compare Packages Between Distributions - DistroWatch.com
accuraterip-checksum-1.5 acd_cli-0.3.2 ace-0.6 ace-7.0.8. AC-EasyRaster-GTK-1.1.3 ... assertion-error-20191227-git ... base-compat-migrate-0.2.0.1 based-0.1
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found