Punter Vicky
Punter Vicky

Reputation: 16992

boto3 UnrecognizedClientException when querying Athena

I am creating an Athena client using the code listed below -

client = boto3.client('athena',aws_access_key_id='<access key id>',aws_secret_access_key='<secret access key>',region_name='us-east-1')

Then I am using this client to query Athena -

response = client.start_query_execution(QueryString=query_string,QueryExecutionContext={'Database': database},WorkGroup=workgroup)

I see the below error. Can you please let me know what I may be missing?

botocore.exceptions.ClientError: An error occurred (UnrecognizedClientException) when calling the StartQueryExecution operation: The security token included in the request is invalid.

Upvotes: 0

Views: 7822

Answers (1)

sivakumar
sivakumar

Reputation: 76

Could you check your aws keys detail ?. Error indicates that aws keys are invalid.

Upvotes: 3

Related Questions