StefanSchubert / sabi

Seawater Aquarium Business Intelligence (sabi) aims to gain knowledge from aquarists for aquarists based on collected seawater parameters.
https://sabi-project.net
MIT License
4 stars 3 forks source link

Flyway maven plugin won't connect to docker database #117

Closed StefanSchubert closed 1 year ago

StefanSchubert commented 2 years ago

Describe the bug SDK through docker is running flyway init container just fine. However if I do database engineering and would like to use the flyway maven plugin in the database module, flyway is not able to find the database in the docker container.

To Reproduce Steps to reproduce the behavior:

  1. Build up your docker based SDK as descriped by the README.md2.
  2. Add an sql script in the database module3.
  3. Do da maven flyway migrate

Expected behavior Instead of an error message, about not being able to find the database, we should see a proper flayway run un the console.

StefanSchubert commented 1 year ago

Revisit-Result:

While running flyway as step within docker-compose against mariadb 10.9.3 without any problem, we won't be able to simply do a flyway migrate "from outside" via maven against mariadb in docker or on pi (production site)

flyway-maven-plugin:9.4.0

Maria DB version in docker-compose: mariadb:10.9.3 / platform: linux/arm64 Maria DB version on Production: mariadb Ver 15.1 Distrib 10.3.36-MariaDB

Though Port 3306 is available and other DB-Tools can connect against it. There seems to be an implementation difference between maven flyway plugin and the flyway container: flyway/flyway:9.3.1

StefanSchubert commented 1 year ago

I opened a ticket at flyway for support: https://github.com/flyway/flyway/issues/3534 As I'm out of clues what goes wrong here.

StefanSchubert commented 1 year ago

As I didn't found so much articles about the same problem on the web it must have been a configuration issue at my site (my setup worked the flyway 8 epoche).

Finally I found that my plugin required an additional mysql dependeny to get the flyway plugin working. My plugin dependencies looks now like this:

                    <dependencies>
                        <dependency>
                            <groupId>org.mariadb.jdbc</groupId>
                            <artifactId>mariadb-java-client</artifactId>
                            <version>${mariadb.client.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.flywaydb</groupId>
                            <artifactId>flyway-mysql</artifactId>
                            <version>${flyway.version}</version>
                        </dependency>
                    </dependencies>

closed

Anyway a suggestion

StefanSchubert commented 1 year ago

fixed on Develop Branch