Quarkus: Data source Connection Issue After Updating Quarkus (0.25.0 to 1.1.1.Final)

Created on 10 Jan 2020  路  13Comments  路  Source: quarkusio/quarkus

Describe the bug
After updating Quarkus to 1.1.1.Final the bootstrap process fail with java.sql.SQLException saing Access denied. But it works without any issue with Quarkus 0.25.0 without any configuration change. Apparently quarkus doesn't detect the environment variables.

Expected behavior
It should create the data-source connection successfully.

Actual behavior
I am using the quarkus native image in a docker container which connects to a mariadb database.
But when initializing it fails with
java.sql.SQLException: Access denied for user 'root'@'172.17.42.1' (using password: NO)
in Mariadb log I can see an authentication error
2020-01-10 13:17:28 69 [Warning] Access denied for user 'root'@'172.17.42.1' (using password: NO)

Stacktrace

2020-01-10 18:47:27,158 host NativeImageGeneratorRunner[6486] INFO  [io.quarkus] (main) myapp stopped in 0.014s
2020-01-10 18:47:28,548 host NativeImageGeneratorRunner[32069] INFO  [org.fly.cor.int.lic.VersionPrinter] (main) Flyway Community Edition 6.1.0 by Redgate
2020-01-10 18:47:28,549 host NativeImageGeneratorRunner[32069] WARN  [io.agr.pool] (Agroal_16893719241) Datasource '<default>': Could not connect to address=(host=service1)(port=13306)(type=master) : Access denied for user 'root'@'172.17.42.1' (using password: NO)
2020-01-10 18:47:28,550 host NativeImageGeneratorRunner[32069] WARN  [io.agr.pool] (Agroal_16893719241) Datasource '<default>': Could not connect to address=(host=service1)(port=13306)(type=master) : Access denied for user 'root'@'172.17.42.1' (using password: NO)
2020-01-10 18:47:28,550 host NativeImageGeneratorRunner[32069] ERROR [io.qua.application] (main) Failed to start application: org.flywaydb.core.internal.exception.FlywaySqlException: 
Unable to obtain connection from database: Could not connect to address=(host=service1)(port=13306)(type=master) : Access denied for user 'root'@'172.17.42.1' (using password: NO)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL State  : 28000
Error Code : 1045
Message    : Could not connect to address=(host=service1)(port=13306)(type=master) : Access denied for user 'root'@'172.17.42.1' (using password: NO)

    at org.flywaydb.core.internal.jdbc.JdbcUtils.openConnection(JdbcUtils.java:60)
    at org.flywaydb.core.internal.jdbc.JdbcConnectionFactory.<init>(JdbcConnectionFactory.java:80)
    at org.flywaydb.core.Flyway.execute(Flyway.java:437)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:147)
    at io.quarkus.flyway.runtime.FlywayRecorder.migrate(FlywayRecorder.java:54)
    at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:35)
    at io.quarkus.deployment.steps.FlywayProcessor$configureRuntimeProperties61.deploy_0(FlywayProcessor$configureRuntimeProperties61.zig:79)
    at io.quarkus.deployment.steps.FlywayProcessor$configureRuntimeProperties61.deploy(FlywayProcessor$configureRuntimeProperties61.zig:98)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:234)
    at io.quarkus.runtime.Application.start(Application.java:87)
    at io.quarkus.runtime.Application.run(Application.java:210)
    at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=service1)(port=13306)(type=master) : Access denied for user 'root'@'172.17.42.1' (using password: NO)
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:239)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1241)
    at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:610)
    at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:142)
    at org.mariadb.jdbc.Driver.connect(Driver.java:86)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.sql.SQLException: Access denied for user 'root'@'172.17.42.1' (using password: NO)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authenticationHandler(AbstractConnectProtocol.java:729)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:507)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1236)
    ... 13 more

This only happens with Quarkys 1.1.1.Final. I have configured Mariadb to allow remote connect.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Quarkus application which uses a datasource.
  2. Provide the given environment variables when creating the docker container from the generated native image.

Configuration

quarkus.datasource.url = jdbc:mariadb://service1:13306
quarkus.datasource.driver = org.mariadb.jdbc.Driver
quarkus.datasource.username = root
quarkus.datasource.password = mypass
quarkus.hibernate-orm.database.default-schema=timepickle
#!/bin/bash

docker run --name container1 \
    --add-host=service1:172.17.42.1 \
    -e QUARKUS_PROFILE=prod \
    -e QUARKUS_DATASOURCE_PASSWORD='mypass' \
    -e QUARKUS_DATASOURCE_URL='jdbc:mariadb://service1:13306' -itd -p 18080:8080 myapp:1.1

Environment (please complete the following information):

  • Output of uname -a or ver: 4.15.0-1065-oem
  • Output of java -version: java version "1.8.0_191"
    Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
    Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
  • GraalVM version (if different from Java): openjdk version "1.8.0_232"
    OpenJDK Runtime Environment (build 1.8.0_232-20191008104205.buildslave.jdk8u-src-tar--b07)
    OpenJDK 64-Bit GraalVM CE 19.2.1 (build 25.232-b07-jvmci-19.2-b03, mixed mode)

  • Quarkus version or git rev: 1.1.1.Final

kinbug

Most helpful comment

Maybe 93668af introduced this regression?
Between mariadb-java-client version 2.4.4 and 2.5.2, "org.mariadb.jdbc.internal.util.Options" moved to "org.mariadb.jdbc.util.Options".

This line should be updated to refer to the new path of Options class?
https://github.com/quarkusio/quarkus/blob/master/extensions/jdbc/jdbc-mariadb/deployment/src/main/java/io/quarkus/jdbc/mariadb/deployment/MariaDBJDBCReflections.java#L19

All 13 comments

It looks like the database is not specified in the URL? Maybe that is required in the latest MariaDB driver updated in 1.1.1.Final?

Access denied for user 'root'@'172.17.42.1' (using password: NO)

It appears to me that the password isn't being used while getting the connection?

docker run --name container1 \
--add-host=service1:172.17.42.1 \
-e QUARKUS_PROFILE=prod \
-e QUARKUS_DATASOURCE_PASSWORD='mypass' \
-e QUARKUS_DATASOURCE_URL='jdbc:mariadb://service1:13306' -itd -p 18080:8080 myapp:1.1

I haven't yet caught up on recent config related changes in Quarkus, but how does that QUARKUS_DATASOURCE_PASSWORD environment variable translate in the value for quarkus.datasource.password property? I don't see that environment variable being used in the config file that you posted.

Access denied for user 'root'@'172.17.42.1' (using password: NO)

It appears to me that the password isn't being used while getting the connection?

docker run --name container1
--add-host=service1:172.17.42.1
-e QUARKUS_PROFILE=prod
-e QUARKUS_DATASOURCE_PASSWORD='mypass'
-e QUARKUS_DATASOURCE_URL='jdbc:mariadb://service1:13306' -itd -p 18080:8080 myapp:1.1

I haven't yet caught up on recent config related changes in Quarkus, but how does that QUARKUS_DATASOURCE_PASSWORD environment variable translate in the value for quarkus.datasource.password property? I don't see that environment variable being used in the config file that you posted.

It should work according to the convention.
https://quarkus.io/guides/config

So far it worked

Access denied for user 'root'@'172.17.42.1' (using password: NO)

It appears to me that the password isn't being used while getting the connection?

docker run --name container1
--add-host=service1:172.17.42.1
-e QUARKUS_PROFILE=prod
-e QUARKUS_DATASOURCE_PASSWORD='mypass'
-e QUARKUS_DATASOURCE_URL='jdbc:mariadb://service1:13306' -itd -p 18080:8080 myapp:1.1

I haven't yet caught up on recent config related changes in Quarkus, but how does that QUARKUS_DATASOURCE_PASSWORD environment variable translate in the value for quarkus.datasource.password property? I don't see that environment variable being used in the config file that you posted.

It should work according to the convention.
https://quarkus.io/guides/config

So far it worked

closed mistakenly.

It looks like the database is not specified in the URL? Maybe that is required in the latest MariaDB driver updated in 1.1.1.Final?

I tried providing the database in URL as well. But it doesn't solve the problem.

Further I tried building docker image based on JVM approach rather than building native image.

FROM fabric8/java-alpine-openjdk8-jre
EXPOSE 8080

ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Xmx128m"
ENV AB_ENABLED=jmx_exporter
COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar
ENTRYPOINT [ "/deployments/run-java.sh" ]

Then it works as expected with latest Quarkus version(1.1.1.Final). So I am pretty sure this problem occurs only with dockerized native image.

@kdkanishka do you a small reproducer (with the a docker command for running the database as well) that we can use to reproduce?

I have the same issue. It doesn鈥檛 use the password and username provided in the config.
It is also not working if I add them as parameter in the jdbc url.

The first exception regarding this issue I see is the following. After that the app tries to use root and no password.

DEBUG [io.qua.agr.run.AbstractDataSourceProducer] (main) Started data source io.agroal.pool.DataSource@7f14bcfc7760 connected to jdbc:mariadb://srv-mariadb-db:3306/app 2020-01-13T18:07:18.817411827Z java.lang.NoSuchFieldException: user 2020-01-13T18:07:18.817466270Z at java.lang.Class.getField(DynamicHub.java:992) 2020-01-13T18:07:18.817475342Z at org.mariadb.jdbc.util.DefaultOptions.parse(DefaultOptions.java:869) 2020-01-13T18:07:18.817486690Z at org.mariadb.jdbc.util.DefaultOptions.parse(DefaultOptions.java:853) 2020-01-13T18:07:18.817613766Z at org.mariadb.jdbc.UrlParser.defineUrlParserParameters(UrlParser.java:259) 2020-01-13T18:07:18.817628006Z at org.mariadb.jdbc.UrlParser.parseInternal(UrlParser.java:219) 2020-01-13T18:07:18.817632736Z at org.mariadb.jdbc.UrlParser.parse(UrlParser.java:174) 2020-01-13T18:07:18.817637029Z at org.mariadb.jdbc.Driver.connect(Driver.java:82) 2020-01-13T18:07:18.817647784Z at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200) 2020-01-13T18:07:18.817652147Z at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390) 2020-01-13T18:07:18.817656184Z at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372) 2020-01-13T18:07:18.817660564Z at java.util.concurrent.FutureTask.run(FutureTask.java:266) 2020-01-13T18:07:18.817667237Z at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65) 2020-01-13T18:07:18.817671537Z at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146) 2020-01-13T18:07:18.817675602Z at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2020-01-13T18:07:18.817679729Z at java.lang.Thread.run(Thread.java:748) 2020-01-13T18:07:18.817684844Z at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460) 2020-01-13T18:07:18.817746007Z at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)

@unsichtbarer do you perhaps have a small project that exhibits this behavior so we can try?

Maybe 93668af introduced this regression?
Between mariadb-java-client version 2.4.4 and 2.5.2, "org.mariadb.jdbc.internal.util.Options" moved to "org.mariadb.jdbc.util.Options".

This line should be updated to refer to the new path of Options class?
https://github.com/quarkusio/quarkus/blob/master/extensions/jdbc/jdbc-mariadb/deployment/src/main/java/io/quarkus/jdbc/mariadb/deployment/MariaDBJDBCReflections.java#L19

@pplr Interesting. Not sure it has anything to do with this issue but needs fixing in any case.

Would you like to create a PR for it?

I reproduced the bug by running quarkus integration tests using this commands:

./mvnw -DskipTests clean install
./mvnw -pl integration-tests/jpa-mariadb -Dtest-mariadb -Ddocker -Dnative clean install 
[INFO] --- maven-failsafe-plugin:2.22.1:integration-test (default) @ quarkus-integration-test-jpa-mariadb ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running io.quarkus.it.jpa.mariadb.JPAFunctionalityInGraalITCase
Executing [/home/pplr/dev/github/quarkus/integration-tests/jpa-mariadb/target/quarkus-integration-test-jpa-mariadb-999-SNAPSHOT-runner, -Dquarkus.http.port=8081, -Dtest.url=http://localhost:8081, -Dquarkus.log.file.path=target/quarkus.log]
2020-01-27 23:13:42,977 INFO  [io.agr.pool] (main) Datasource '<default>': Initial size smaller thanjava.lang.NoSuchFieldException: user
 min. Connections will be created when necessary
    at java.lang.Class.getField(DynamicHub.java:992)
    at org.mariadb.jdbc.util.DefaultOptions.parse(DefaultOptions.java:869)
    at org.mariadb.jdbc.util.DefaultOptions.parse(DefaultOptions.java:853)
    at org.mariadb.jdbc.UrlParser.defineUrlParserParameters(UrlParser.java:259)
    at org.mariadb.jdbc.UrlParser.parseInternal(UrlParser.java:219)
    at org.mariadb.jdbc.UrlParser.parse(UrlParser.java:174)
    at org.mariadb.jdbc.Driver.connect(Driver.java:82)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
2020-01-27 23:13:42,998 WARN  [io.agr.pool] (Agroal_15846332951) Datasource '<default>': Could not connect to address=(host=localhost)(port=3308)(type=master) : Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
2020-01-27 23:13:42,998 WARN  [org.hib.eng.jdb.spi.SqlExceptionHelper] (main) SQL Error: 1045, SQLState: 28000
2020-01-27 23:13:42,998 ERROR [org.hib.eng.jdb.spi.SqlExceptionHelper] (main) Could not connect to address=(host=localhost)(port=3308)(type=master) : Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
2020-01-27 23:13:42,998 ERROR [io.qua.application] (main) Failed to start application: javax.persistence.PersistenceException: [PersistenceUnit: templatePU] Unable to build Hibernate SessionFactory
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.persistenceException(FastBootEntityManagerFactoryBuilder.java:113)
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:67)
    at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:54)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:109)
    at io.quarkus.hibernate.orm.runtime.JPAConfig.startAll(JPAConfig.java:57)
    at io.quarkus.hibernate.orm.runtime.HibernateOrmRecorder.startAllPersistenceUnits(HibernateOrmRecorder.java:82)
    at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits59.deploy_0(HibernateOrmProcessor$startPersistenceUnits59.zig:51)
    at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits59.deploy(HibernateOrmProcessor$startPersistenceUnits59.zig:70)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:226)
    at io.quarkus.runtime.Application.start(Application.java:89)
    at io.quarkus.runtime.Application.run(Application.java:226)
    at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
Caused by: org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution
    at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:48)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
    at org.hibernate.resource.transaction.backend.jta.internal.DdlTransactionIsolatorJtaImpl.<init>(DdlTransactionIsolatorJtaImpl.java:62)
    at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl.buildDdlTransactionIsolator(JtaTransactionCoordinatorBuilderImpl.java:46)
    at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.getDdlTransactionIsolator(HibernateSchemaManagementTool.java:175)
    at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.buildGenerationTargets(HibernateSchemaManagementTool.java:135)
    at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:110)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:145)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:320)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:65)
    ... 12 more
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=localhost)(port=3308)(type=master) : Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:239)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1241)
    at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(U23:13:43.000 MariaDB:2020-01-27 22:13:42 10 [Warning] Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
tils.java:610)
    at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:142)
    at org.mariadb.jdbc.Driver.connect(Driver.java:86)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.sql.SQLException: Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authenticationHandler(AbstractConnectProtocol.java:729)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:507)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1236)
    ... 13 more

Exception in thread "main" java.lang.RuntimeException: Failed to start quarkus
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:304)
    at io.quarkus.runtime.Application.start(Application.java:89)
    at io.quarkus.runtime.Application.run(Application.java:226)
    at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: templatePU] Unable to build Hibernate SessionFactory
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.persistenceException(FastBootEntityManagerFactoryBuilder.java:113)
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:67)
    at io.quarkus.hibernate.orm.runtime.FastBootHibernatePersistenceProvider.createEntityManagerFactory(FastBootHibernatePersistenceProvider.java:54)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:80)
    at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    at io.quarkus.hibernate.orm.runtime.JPAConfig$LazyPersistenceUnit.get(JPAConfig.java:109)
    at io.quarkus.hibernate.orm.runtime.JPAConfig.startAll(JPAConfig.java:57)
    at io.quarkus.hibernate.orm.runtime.HibernateOrmRecorder.startAllPersistenceUnits(HibernateOrmRecorder.java:82)
    at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits59.deploy_0(HibernateOrmProcessor$startPersistenceUnits59.zig:51)
    at io.quarkus.deployment.steps.HibernateOrmProcessor$startPersistenceUnits59.deploy(HibernateOrmProcessor$startPersistenceUnits59.zig:70)
    at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:226)
    ... 3 more
Caused by: org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection for DDL execution
    at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:48)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
    at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
    at org.hibernate.resource.transaction.backend.jta.internal.DdlTransactionIsolatorJtaImpl.<init>(DdlTransactionIsolatorJtaImpl.java:62)
    at org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl.buildDdlTransactionIsolator(JtaTransactionCoordinatorBuilderImpl.java:46)
    at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.getDdlTransactionIsolator(HibernateSchemaManagementTool.java:175)
    at org.hibernate.tool.schema.internal.HibernateSchemaManagementTool.buildGenerationTargets(HibernateSchemaManagementTool.java:135)
    at org.hibernate.tool.schema.internal.SchemaDropperImpl.doDrop(SchemaDropperImpl.java:110)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:145)
    at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73)
    at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:320)
    at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462)
    at io.quarkus.hibernate.orm.runtime.boot.FastBootEntityManagerFactoryBuilder.build(FastBootEntityManagerFactoryBuilder.java:65)
    ... 12 more
Caused by: java.sql.SQLInvalidAuthorizationSpecException: Could not connect to address=(host=localhost)(port=3308)(type=master) : Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
    at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(ExceptionMapper.java:239)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1241)
    at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:610)
    at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:142)
    at org.mariadb.jdbc.Driver.connect(Driver.java:86)
    at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:200)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:390)
    at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:372)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:65)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:460)
    at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.sql.SQLException: Access denied for user 'pplr'@'172.17.0.1' (using password: NO)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.authenticationHandler(AbstractConnectProtocol.java:729)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.createConnection(AbstractConnectProtocol.java:507)
    at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:1236)
    ... 13 more
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.249 s <<< FAILURE! - in io.quarkus.it.jpa.mariadb.JPAFunctionalityInGraalITCase
[ERROR] io.quarkus.it.jpa.mariadb.JPAFunctionalityInGraalITCase  Time elapsed: 1.248 s  <<< ERROR!
org.junit.platform.commons.JUnitException: Quarkus native image start failed, original cause: java.lang.RuntimeException: Failed to start native image, process has exited

[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR]   JPAFunctionalityInGraalITCase 禄 JUnit Quarkus native image start failed, origi...
[INFO] 
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO] 
[INFO] 
Was this page helpful?
0 / 5 - 0 ratings