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
When using Flyway with an empty database and flyway.datasources.default.create-schemas=true, the Datasource doesn't collect until the the schema is created
Actual Behaviour
When instancing the HikariUrlDataSource, the connection is checked, leading to an exception
[main] INFO i.m.c.DefaultApplicationContext$RuntimeConfiguredEnvironment - Established active environments: [test]
[main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
[main] WARN o.m.jdbc.message.server.ErrorPacket - Error: 1049-42000: Unknown database 'examples'
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [io.micronaut.data.jdbc.config.SchemaGenerator] could not be loaded: Error instantiating bean of type [javax.sql.DataSource]
Message: Failed to initialize pool: (conn=158) Unknown database 'examples'
Path Taken: DatasourceFactory.dataSource(DatasourceConfiguration datasourceConfiguration)
...
Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: (conn=158) Unknown database 'examples'
at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:584)
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:571)
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:98)
at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:80)
at io.micronaut.configuration.jdbc.hikari.HikariUrlDataSource.(HikariUrlDataSource.java:35)
at io.micronaut.configuration.jdbc.hikari.DatasourceFactory.dataSource(DatasourceFactory.java:66)
at io.micronaut.configuration.jdbc.hikari.$DatasourceFactory$DataSource0$Definition.instantiate(Unknown Source)
at io.micronaut.context.BeanDefinitionDelegate.instantiate(BeanDefinitionDelegate.java:159)
at io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2311)
I've tested with various version in Micronaut 4, and all have the same behavior
I don't know if something is incorrectly configured or not, but following documentation these config should be enough
Expected Behavior
When using Flyway with an empty database and
flyway.datasources.default.create-schemas=true
, the Datasource doesn't collect until the the schema is createdActual Behaviour
When instancing the
HikariUrlDataSource
, the connection is checked, leading to an exceptionI've tested with various version in Micronaut 4, and all have the same behavior
I don't know if something is incorrectly configured or not, but following documentation these config should be enough
Steps To Reproduce
Environment Information
No response
Example Application
https://github.com/FrogDevelopper/micronaut-examples/tree/example/flyway
Version
4.4.3
The text was updated successfully, but these errors were encountered: