You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.lang.IllegalStateException: Cannot find migrations location in: [filesystem:src/main/resources/db/migration] (please add migrations or check your Flyway configuration)
at org.springframework.util.Assert.state(Assert.java:94)
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.checkLocationExists(FlywayAutoConfiguration.java:168)
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.flyway(FlywayAutoConfiguration.java:152)
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$65b82c95.CGLIB$flyway$1(<generated>)
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$65b82c95$$FastClassBySpringCGLIB$$bf4a67a0.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$65b82c95.flyway(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 70 more
If the prefix is changed to "file:", the FlywayAutoConfiguration check succeeds but then Flyway throws an exception:
Caused by: org.flywaydb.core.api.FlywayException: Unknown prefix for location (should be either filesystem: or classpath:): file:src/main/resources/db/migration
at org.flywaydb.core.api.Location.<init>(Location.java:71) ~[flyway-core-5.1.4.jar:na]
at org.flywaydb.core.internal.util.Locations.<init>(Locations.java:46) ~[flyway-core-5.1.4.jar:na]
at org.flywaydb.core.api.configuration.ClassicConfiguration.setLocationsAsStrings(ClassicConfiguration.java:864) ~[flyway-core-5.1.4.jar:na]
at org.flywaydb.core.Flyway.setLocations(Flyway.java:518) ~[flyway-core-5.1.4.jar:na]
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$SpringBootFlyway.setLocations(FlywayAutoConfiguration.java:285) ~[spring-boot-autoconfigure-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration.flyway(FlywayAutoConfiguration.java:175) ~[spring-boot-autoconfigure-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$ae83b85c.CGLIB$flyway$0(<generated>) ~[spring-boot-autoconfigure-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$ae83b85c$$FastClassBySpringCGLIB$$d56b3dc1.invoke(<generated>) ~[spring-boot-autoconfigure-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.1.0.BUILD-SNAPSHOT.jar:5.1.0.BUILD-SNAPSHOT]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361) ~[spring-context-5.1.0.BUILD-SNAPSHOT.jar:5.1.0.BUILD-SNAPSHOT]
at org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration$FlywayConfiguration$$EnhancerBySpringCGLIB$$ae83b85c.flyway(<generated>) ~[spring-boot-autoconfigure-2.1.0.BUILD-SNAPSHOT.jar:2.1.0.BUILD-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_161]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_161]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_161]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_161]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.1.0.BUILD-SNAPSHOT.jar:5.1.0.BUILD-SNAPSHOT]
... 70 common frames omitted
Flyway locations can be prefixed with "classpath: or "filesystem:".
FlywayAutoConfiguration by default checks at least one location exists.
That check fails when using the "filesystem:" prefix due to:
which results in the following:
If the prefix is changed to "file:", the FlywayAutoConfiguration check succeeds but then Flyway throws an exception:
A workaround is to disable the check:
This repository replicates the issue: https://github.com/andyrbell/spring-boot-flyway-issue
These various issues appear relate to the same problem:
https://stackoverflow.com/questions/49572576/spring-boot-flyway-autoconfiguration
flyway/flyway#1982
#13190
The text was updated successfully, but these errors were encountered: