Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flyway migrations does not work anymore on JDK8 after upgrade to 1.7.1.Final #11780

Closed
rmanibus opened this issue Sep 1, 2020 · 7 comments · Fixed by #11781
Closed

Flyway migrations does not work anymore on JDK8 after upgrade to 1.7.1.Final #11780

rmanibus opened this issue Sep 1, 2020 · 7 comments · Fixed by #11781
Labels
area/flyway kind/bug Something isn't working
Milestone

Comments

@rmanibus
Copy link
Contributor

rmanibus commented Sep 1, 2020

Describe the bug

Flyway migration does not work anymore on quarkus 1.7.1 with jdk 8 when executing from inside a jar

Reproducer:

https://github.com/rmanibus/quarkus-reproducer

# with open-jdk 8 (it works in jdk 14):

mvn clean install
java -jar target/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar

This seems to have been introduced by #11300

Expected behavior

Flyway migrations are executed

Actual behavior

The application throws with:

 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2020-09-01 15:31:30,945 INFO  [org.fly.cor.int.lic.VersionPrinter] (main) Flyway Community Edition 6.5.3 by Redgate
2020-09-01 15:31:31,103 INFO  [org.fly.cor.int.dat.DatabaseFactory] (main) Database: jdbc:h2:mem:secondary (H2 1.4)
2020-09-01 15:31:31,235 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (main) Creating Schema History table "PUBLIC"."flyway_schema_history" ...
2020-09-01 15:31:31,304 ERROR [io.qua.application] (main) Failed to start application (with profile prod): org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: db/migration/h2-global/../h2-global/V1.0.1__Quarkus.sql
	at org.flywaydb.core.internal.resource.classpath.ClassPathResource.read(ClassPathResource.java:90)
	at org.flywaydb.core.internal.resolver.ChecksumCalculator.calculateChecksumForResource(ChecksumCalculator.java:67)
	at org.flywaydb.core.internal.resolver.ChecksumCalculator.calculate(ChecksumCalculator.java:46)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.getChecksumForLoadableResource(SqlMigrationResolver.java:143)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.addMigrations(SqlMigrationResolver.java:181)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.resolveMigrations(SqlMigrationResolver.java:88)
	at org.flywaydb.core.internal.resolver.sql.SqlMigrationResolver.resolveMigrations(SqlMigrationResolver.java:44)
	at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.collectMigrations(CompositeMigrationResolver.java:127)
	at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.doFindAvailableMigrations(CompositeMigrationResolver.java:109)
	at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.resolveMigrations(CompositeMigrationResolver.java:95)
	at org.flywaydb.core.internal.resolver.CompositeMigrationResolver.resolveMigrations(CompositeMigrationResolver.java:46)
	at org.flywaydb.core.internal.info.MigrationInfoServiceImpl.refresh(MigrationInfoServiceImpl.java:130)
	at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:185)
	at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:54)
	at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:162)
	at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:159)
	at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate$1.call(TableLockingExecutionTemplate.java:38)
	at org.flywaydb.core.internal.jdbc.TransactionalExecutionTemplate.execute(TransactionalExecutionTemplate.java:66)
	at org.flywaydb.core.internal.jdbc.TableLockingExecutionTemplate.execute(TableLockingExecutionTemplate.java:33)
	at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:129)
	at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:140)
	at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:159)
	at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:137)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:206)
	at org.flywaydb.core.Flyway$1.execute(Flyway.java:158)
	at org.flywaydb.core.Flyway.execute(Flyway.java:527)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:158)
	at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:54)
	at io.quarkus.deployment.steps.FlywayProcessor$createBeansAndStartActions-1520831253.deploy_0(FlywayProcessor$createBeansAndStartActions-1520831253.zig:91)
	at io.quarkus.deployment.steps.FlywayProcessor$createBeansAndStartActions-1520831253.deploy(FlywayProcessor$createBeansAndStartActions-1520831253.zig:40)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:553)
	at io.quarkus.runtime.Application.start(Application.java:90)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:92)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)

@gsmet
Copy link
Member

gsmet commented Sep 1, 2020

@jaikiran I would be interested in your opinion on this if you have one?

Looks like the fix I made does not work everywhere.

@jaikiran
Copy link
Member

jaikiran commented Sep 1, 2020

I will reproduce this locally and see what's going on.

@jaikiran jaikiran self-assigned this Sep 1, 2020
@gsmet
Copy link
Member

gsmet commented Sep 1, 2020

Hmmm, thinking about it, I think I should have normalized the path. Let me give it a try.

@gsmet
Copy link
Member

gsmet commented Sep 1, 2020

Yeah that was it...

@gsmet
Copy link
Member

gsmet commented Sep 1, 2020

I created #11781 .

@gsmet gsmet added this to the 1.8.0 - master milestone Sep 1, 2020
gsmet added a commit to gsmet/quarkus that referenced this issue Sep 1, 2020
@gsmet gsmet changed the title Flyway migrations does not work anymore on JDK8 after upgrade to 1.7.1-Final Flyway migrations does not work anymore on JDK8 after upgrade to 1.7.1.Final Sep 1, 2020
@jaikiran jaikiran removed their assignment Sep 1, 2020
@rmanibus
Copy link
Contributor Author

rmanibus commented Sep 1, 2020

Thank you very much :)

@gsmet
Copy link
Member

gsmet commented Sep 1, 2020

Thanks for the reproducer. It helped a lot.

@gsmet gsmet modified the milestones: 1.8.0.CR1, 1.7.2.Final Sep 2, 2020
gsmet added a commit to gsmet/quarkus that referenced this issue Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flyway kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants