9

Are there particular requirements to the bucket for specifying the query result location? When I try to create a new table, I get a popup:

Before you run your first query, you need to set up a query result location in Amazon S3. Learn more

So I click the link and specify my query result location in the format specified s3://query-results-bucket/folder. But it always says

Invalid S3 folder location

I posted this in Superuser first but it was closed (not sure why...).

chris
  • 36,094
  • 53
  • 157
  • 237
tom
  • 1,331
  • 1
  • 15
  • 28
  • 4
    Try putting a trailing slash (`/`) at the end of the path, eg: `s3://query-results-bucket/folder/` – John Rotenstein Nov 17 '19 at 05:39
  • I had to add the trailing slash! Thanks – tom Nov 18 '19 at 01:00
  • 1
    trailing slash didn't work for me. I had to go Workgroups > View details > Edit workgroup and use the Select dialog to browse and select the folder, then Save – DaveO Dec 23 '19 at 02:27
  • Thank you @JohnRotenstein for the trailing slash comment. Would have been so simple for Amazon to handle that for us, or at least tells us more! – sfuqua Jun 04 '20 at 20:43

2 Answers2

39

The folder name needs to have a trailing slash:

s3://query-results-bucket/folder/
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 13
    Amazon should add this hint at document or the popup alert. Or should append the trailing slash for user automatically. – StoneLam Feb 19 '20 at 08:04
0

Ran into this earlier in the week.

First, make sure the bucket exists. There doesn't appear to be an option to create the bucket when setting the value in the athena console.

Next, make sure you have the bucket specified properly. In my case, I initially had s3:/// - there is no validation, so an extra character will cause this error. If you go to the athena settings, you can see what the bucket settings look like.

Finally check the workgroup - there is a default workgroup per account, make sure it's not disabled. You can create additional workgroups, each of which will need its own settings.

chris
  • 36,094
  • 53
  • 157
  • 237