burtcorp / athena-jdbc

A JDBC driver for AWS Athena
BSD 3-Clause "New" or "Revised" License
23 stars 17 forks source link

SdkClientException when using profile credentials #14

Closed DALDEI closed 1 month ago

DALDEI commented 4 years ago

When I configure profile credentials, every query gets a SdkClientException logged

2020-03-23T20:29:54,271 DEBUG [qtp2144965699-63] software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain - Unable to load credentials from SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId).
software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId).

The code then continues on and works. I dont know if this is something you can control or not. Stack trace is like this:

2020-03-23T20:29:54,271 DEBUG [qtp2144965699-63] software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain - Unable to load credentials from SystemPropertyCredentialsProvider(): Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId). software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from system settings. Access key must be specified either via environment variable (AWS_ACCESS_KEY_ID) or system property (aws.accessKeyId). at software.amazon.awssdk.core.exception.SdkClientException$BuilderImpl.build(SdkClientException.java:97) ~[sdk-core-2.5.37.jar:?] at software.amazon.awssdk.auth.credentials.internal.SystemSettingsCredentialsProvider.resolveCredentials(SystemSettingsCredentialsProvider.java:58) ~[auth-2.5.37.jar:?] at software.amazon.awssdk.auth.credentials.AwsCredentialsProviderChain.resolveCredentials(AwsCredentialsProviderChain.java:91) ~[auth-2.5.37.jar:?] at software.amazon.awssdk.auth.credentials.internal.LazyAwsCredentialsProvider.resolveCredentials(LazyAwsCredentialsProvider.java:52) ~[auth-2.5.37.jar:?] at software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider.resolveCredentials(DefaultCredentialsProvider.java:98) ~[auth-2.5.37.jar:?] at software.amazon.awssdk.awscore.client.handler.AwsClientHandlerUtils.createExecutionContext(AwsClientHandlerUtils.java:70) ~[aws-core-2.5.37.jar:?] at software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler.createExecutionContext(AwsAsyncClientHandler.java:64) ~[aws-core-2.5.37.jar:?] at software.amazon.awssdk.core.client.handler.BaseAsyncClientHandler.execute(BaseAsyncClientHandler.java:58) ~[sdk-core-2.5.37.jar:?] at software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler.execute(AwsAsyncClientHandler.java:51) ~[aws-core-2.5.37.jar:?] at software.amazon.awssdk.services.athena.DefaultAthenaAsyncClient.startQueryExecution(DefaultAthenaAsyncClient.java:1228) ~[athena-2.5.37.jar:?] at software.amazon.awssdk.services.athena.AthenaAsyncClient.startQueryExecution(AthenaAsyncClient.java:2076) ~[athena-2.5.37.jar:?] at io.burt.athena.AthenaStatement.startQueryExecution(AthenaStatement.java:109) ~[athena-jdbc-0.2.0.jar:?] at io.burt.athena.AthenaStatement.execute(AthenaStatement.java:82) ~[athena-jdbc-0.2.0.jar:?] at io.burt.athena.AthenaStatement.executeQuery(AthenaStatement.java:70) ~[athena-jdbc-0.2.0.jar:?]

grddev commented 4 years ago

This logging seems to be the default AWS behavior. We do not (currently) provide any mechanism for overriding the authentication settings, so you would either have to globally override the default credentials provider chain, or if that is not a possibility, I suppose you could configure your log framework to silence this message.

stenlarsson commented 1 month ago

The driver in this repo is no longer maintained, please have a look at the official Amazon Athena JDBC driver v3 instead.