Jdbc connection pool issue

When using HikariCP or DBCP2 connection pool with Dremio jdbc, the error log is printed as : ‘[dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed’

The jdbc driver is : 4.1.2-201912280006010755-014eceed-mapr. The hikaricp versio is 2.6.3. Also tried apache dbcp2 with version 2.2.1 but same issue.

Java code to initialize the db connection pool:
HikariConfig config = new HikariConfig();
config.setJdbcUrl(propstoreProperties.getDremioUrl());
config.setUsername(propstoreProperties.getDremioUsername());
config.setPassword(propstoreProperties.getDremioPassword());
config.setDriverClassName(“com.dremio.jdbc.Driver”);
config.setMaximumPoolSize(10);
config.setMaxLifetime(1800000);
config.setPoolName(“dremioHikariCP”);
config.setConnectionTimeout(30000);
config.setConnectionTestQuery(“SELECT 1 FROM INFORMATION_SCHEMA.CATALOGS”);
config.setValidationTimeout(30000);
config.setRegisterMbeans(false);
HikariDataSource dataSource = new HikariDataSource(config);

Can any one please help advise on the exception of ‘ConnectionState - Authentication failed’ when using the db connection pool with Dremio? Thanks!

I’m assuming you have no additional stack trace from the Authentication failure (usually the reasons are kept intentionally vague). Or do you have more info on that?

Apologies if this is an obvious question with and obvious answer, but did you double check the credentials?

What kind of user authentication are you using with Dremio?

Thank you Ben for the check!

The authentication type is LDAP. In the connection pool configuration, it’s using the service account. This account is available to log on the dremio portal and set up the jdbc connection for dremio query by jdbc zookeeper.url.

Here is the log when turning log level to trace for hikaricp and com.dremio:(init 10 connections in the pool) without any other stack trace. Please check.

[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.411 [USER-rpc-event-queue] DremioCursor$ResultsListener - [#2] Received query completion: COMPLETED.
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.528 [main] DremioCursor$ResultsListener - [#2] Query listener closing.
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.528 [main] DremioStatementRegistry - Removing from open-statements registry: com.dremio.jdbc.impl.DremioStatementImpl@7e83251e
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.529 [main] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@1d9f9c9d
[UUID:][TID:] [INFO ] 2020-06-04 10:11:33.529 [main] HikariDataSource - dremioHikariCP - Start completed.
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.629 [dremioHikariCP housekeeper] HikariPool - dremioHikariCP - Pool stats (total=1, active=0, idle=1, waiting=0)
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.647 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.698 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@398aece0
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.710 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.759 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@3b81a11
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.768 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.808 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@63e25fd1
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.820 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.868 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@3e857f1c
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.877 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.917 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@7799062e
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.927 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:33.966 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@22739bc9
[UUID:][TID:] [ERROR] 2020-06-04 10:11:33.974 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:34.013 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@69fde678
[UUID:][TID:] [ERROR] 2020-06-04 10:11:34.023 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:34.064 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@370fa36b
[UUID:][TID:] [ERROR] 2020-06-04 10:11:34.073 [dremioHikariCP connection adder-EventThread] ConnectionState - Authentication failed
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:34.314 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - Added connection com.dremio.jdbc.impl.DremioConnectionImpl@6cc8cb37
[UUID:][TID:] [DEBUG] 2020-06-04 10:11:34.314 [dremioHikariCP connection adder] HikariPool - dremioHikariCP - After adding stats (total=10, active=0, idle=10, waiting=0)

Actually the connection pool looks like perform properly but the ‘Authentication failed’ error log is annoying and confusing. It isn’t sown from local windows os. But on Linux server it is always showing these error logs repeatly.

PS this error is also shown if the connection pool changes to apache DBCP2.