Amazon Athena - S3 location error

0 votes

While running an Amazon Athena query on an S3 bucket I am getting an error:

I am running this query on CloudFront access logs.

CREATE EXTERNAL TABLE IF NOT EXISTS cloudfront.cf_logs (
  `date` date,
  `time` string,
  `location` string,
  `bytes` int,
  `requestip` string,
  `method` string,
  `host` string,
  `uri` string,
  `status` int,
  `referrer` string,
  `os` string,
  `browser` string,
  `browserversion` string 
)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1'
) LOCATION 's3://cloudfront-access/test-sh/'
TBLPROPERTIES ('has_encrypted_data'='false');

Error:-

Your query has the following error(s):

The S3 location provided to save your query results is invalid. Please
check your S3 location is correct and is in the same region and try
again. If you continue to see the issue, contact customer support for
further assistance. (Service: AmazonAthena; Status Code: 400; Error
Code: InvalidRequestException; Request ID:
f8cd2762-1e7-a2f9-e5eb1d865406)
Jan 16, 2019 in AWS by Anjali
• 2,950 points
8,004 views

1 answer to this question.

0 votes

You must know this that Amazon Athena saves the output of each query in Amazon S3 bucket. 

The error message is saying that Athena is unable to access this bucket. So to change the settings and make the desired changes you can do the following things:-

  • Click the Settings link at the top of the screen
  • Verify that a bucket name is shown (feel free to change it if you wish)
  • Verify in the Amazon S3 management console that a bucket of that name exists in the same region. If not, create the bucket.
Now try doing the same it will work properly
answered Jan 16, 2019 by Sneha

Related Questions In AWS

+1 vote
2 answers
0 votes
1 answer

What is the difference between Amazon Athena and S3 Select?

Athena can be used by AWS Console, ...READ MORE

answered Jan 17, 2019 in AWS by Edureka
• 4,220 points
9,965 views
0 votes
1 answer

Error when uploading image using Amazon S3

You are using the php's default method POST ...READ MORE

answered Mar 25, 2019 in AWS by Archana
• 5,640 points
2,251 views
+4 votes
5 answers

Usage of Amazon Cloudfront or S3

When to use S3? S3 is like many ...READ MORE

answered Apr 3, 2018 in AWS by brat_1
• 7,200 points
2,028 views
0 votes
1 answer
+1 vote
2 answers
0 votes
1 answer

AWS Access Key error when uploading to S3

You can try getting creating a new ...READ MORE

answered Feb 6, 2019 in AWS by Priyaj
• 58,020 points
6,440 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP