Closed kraeftbraeu closed 1 month ago
/cc @cristhiank (flyway), @gastaldi (flyway), @geoand (devservices,flyway), @gsmet (flyway)
This seems to be a common problem when using TestContainers. I am investigating a workaround and may propose a PR soon
Wow @gastaldi, thanks a lot, that was quick!
@kraeftbraeu you're welcome, I created https://github.com/quarkusio/quarkus/pull/47766 documenting the steps to make that work too
Thanks again for your quick solution @gastaldi, I just tried it out with quarkus 3.22.3 and although your fix made the schema creation working I then failed to introduce flyway scripts since the quarkus user lacks permissions for this new schema (ORA-02420).
But this made me pop the hood with help of quarkus.datasource.devservices.show-logs=true
and I realized the solution is a lot easier:
quarkus.flyway.migrate-at-start=true
quarkus.flyway.schemas=myschema
quarkus.datasource.username=myschema
Just use the schema's standard user instead of "quarkus" and flyway can rely on the schema's owner user. Maybe that helps others who run into the same issue.
@kraeftbraeu you need to grant the DBA role to the quarkus
user in that case, as documented in this PR
Describe the bug
A quarkus application with plugins quarkus-jdbc-oracle and quarkus-flyway fails when starting a devservices oracle instance and trying to create a schema inside. All it takes to reproduce this bug is to include the dependencies
and add these lines to application.properties:
Then the quarkus:dev startup fails with
Error : 1031, Position : 0, SQL = CREATE USER "myschema" IDENTIFIED BY "FFllyywwaayy00!!", Original SQL = CREATE USER "myschema" IDENTIFIED BY "FFllyywwaayy00!!", Error Message = ORA-01031: Keine ausreichenden Berechtigungen
Expected behavior
Expected is that flyway is able to create a schema in the oracle instance provided by quarkus devservices.
Actual behavior
Tthe quarkus:dev startup fails with
How to Reproduce?
oracleexample.zip
Output of
uname -a
orver
Linux 6.8.0-59-generic #61~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:03:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Zulu21.32+17-CA (build 21.0.2+13-LTS) OpenJDK 64-Bit Server VM Zulu21.32+17-CA (build 21.0.2+13-LTS, mixed mode, sharing)
Quarkus version or git rev
3.20.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937) Java version: 21.0.2, vendor: Azul Systems, Inc. Default locale: de_DE, platform encoding: UTF-8 OS name: "linux", version: "6.8.0-59-generic", arch: "amd64", family: "unix"
Additional information
No response