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
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Java API
What database are you using (type & version)?
Oracle 12.1.0.2.0 & MySQL 5.6
What operating system are you using?
Linux Docker Containers
What did you do?
We're using Flyway to execute the initial DB migration scripts before starting our webapp. Since our webapp is packaged inside a docker alpine image & is run as a swarm of containers simultaneously, all different container nodes start executing the migration scripts together on a single centralized database instance (Oracle 12c or MySQL) and the migration fails on all but one node.
The configuration is pretty straight-forward:
final Flyway flyway = new Flyway();
flyway.setDataSource(datasource);
flyway.setLocations("filesystem:"+script.getAbsolutePath());
flyway.migrate();
flyway.validate();
and the containers of our webapp are brought up using:
docker service create --replicas=10 .....database properties
What did you expect to see?
Shouldn't flyway be using database locks and allow just one container service to create the database? We expected to see any one node to successfully create the database while others say something like 'no migration necessary'.
What did you see instead?
All nodes (except one) throw FlywayExceptions saying
org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
Script failed
-------------
SQL State : 42000
Error Code : 955
Message : ORA-00955: name is already used by an existing object
Line : 17
Statement : CREATE TABLE "MYWEBAPP"."schema_version" (
"installed_rank" INT NOT NULL,
"version" VARCHAR2(50),
"description" VARCHAR2(200) NOT NULL,
"type" VARCHAR2(20) NOT NULL,
"script" VARCHAR2(1000) NOT NULL,
or
org.flywaydb.core.api.FlywayException: Found non-empty schema "MYWEBAPP" without metadata table! Use baseline() or set baselineOnMigrate to true to initialize the metadata table.
at org.flywaydb.core.Flyway$1.execute(Flyway.java:943)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:917)
at org.flywaydb.core.Flyway.execute(Flyway.java:1373)
Is there something obvious that we are missing?
Thanks!
The text was updated successfully, but these errors were encountered:
What version of Flyway are you using?
4.0.3
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)
Java API
What database are you using (type & version)?
Oracle 12.1.0.2.0 & MySQL 5.6
What operating system are you using?
Linux Docker Containers
What did you do?
We're using Flyway to execute the initial DB migration scripts before starting our webapp. Since our webapp is packaged inside a docker alpine image & is run as a swarm of containers simultaneously, all different container nodes start executing the migration scripts together on a single centralized database instance (Oracle 12c or MySQL) and the migration fails on all but one node.
The configuration is pretty straight-forward:
and the containers of our webapp are brought up using:
docker service create --replicas=10 .....database properties
What did you expect to see?
Shouldn't flyway be using database locks and allow just one container service to create the database? We expected to see any one node to successfully create the database while others say something like 'no migration necessary'.
What did you see instead?
All nodes (except one) throw FlywayExceptions saying
or
Is there something obvious that we are missing?
Thanks!
The text was updated successfully, but these errors were encountered: