Athena Query Failed

Got this error
QueryFailed: GENERIC_INTERNAL_ERROR: com.amazonaws.services.s3.model.AmazonS3Exception: The specified bucket does not exist (Service: Amazon S3; Status Code: 404; Error Code: NoSuchBucket; Request ID: 09325PJSSQN4XKG2; S3 Extended Request ID: fQOHzCw/FNCFP2V5Ji3fKPmcU5TnKXSeR3gnPGaFb4YHCqFL4ONShu0oxDb2AbynIfUL/YmzzYU=; Proxy: null), S3 Extended Request ID: fQOHzCw/FNCFP2V5Ji3fKPmcU5TnKXSeR3gnPGaFb4YHCqFL4ONShu0oxDb2AbynIfUL/YmzzYU= (Path: s3://aws-athena-query-results-222836531472-us-east-1/temp_table_049eb39cbe1341d9b408ed0f149ccfd6). You may need to manually clean the data at location ‘s3://aws-athena-query-results-222836531472-us-east-1/tables/f82eef0b-ca62-40df-bb3d-e4c1c1d6a589’ before retrying. Athena will not delete data in your account.

the error happed in the code below
df_count_by_sentiment = wr.athena.read_sql_query(
sql=statement_count_by_sentiment,
database=database_name
)

awswrangler shows the athena S3 bucket name
wr.athena.create_athena_bucket()
‘s3://aws-athena-query-results-222836531472-us-east-1/’
When I go to S3 console, I don’t see this bucket !

Hello @ashiq,

I ran into the same problem working on the week 1 lab. I made a note of the S3 bucket name under section 2.2 (or cell #22 on my notebook). I went into the S3 console and created the bucket manually.

After the bucket was created, the script proceeded without any further complication. Give this a try.

4 Likes

Hi @davidlowe it worked! Thank you so much for the tip.

Excellent! Glad it worked for you as well.

1 Like

Thanks for reporting this - and for finding a workaround!

We are modifying the notebook with the suggested workaround.

And we have logged an issue with awswrangler open source project here: `wr.athena.create_athena_bucket()` sometimes does not create the S3 query-results/staging bucket · Issue #735 · awslabs/aws-data-wrangler · GitHub

5 Likes

Hi @davidlowe , thanks for the suggestions.

However I don’t really understand how to make it work; what do you mean by “I made a note of the S3 bucket name under section 2.2”? I copied the name of the bucket that would have been created by wr.athena.create_athena_bucket() (which does create the bucket in my case).

However, I get the same error message, am I doing something wrong?

Thanks for any help!

Hello @mangusta, If the bucket was created in your case, the problem could be something else.

Perhaps opening a new thread with some code snippets and error messages might help shed lights on what is bothering your script execution?

Encountered the same problem and the workaround proposed by @davidlowe worked, thank you very much!

I found multiple posts on the forum and it seems that the problem persists. It caused a lot of frustrations to students. Hope it’s resolved sometime.

My situation: The first time I worked on the lab it worked, but the lab session got expired. When I started the second time it didn’t work. I searched on the forum and tried multiple suggestions and they didn’t work for me. The github issue raised by @cfregly (#735) is closed by aws but I have no idea how to use “wait_until_exists” for our context.

@Yue_Huang thank you for the message. Could you please give us some more details about the problem you are facing? Is it in the Course 1, week 1 lab? What is your coursera username?

Hi @esanina, yes it’s course 1 week 1 lab. the problem is exactly the same as @ashiq posted at the beginning of this thread. My coursera user name is daphnehuang2006@gmail.com. Thanks!

@Yue_Huang thank you for the information. Please try again and let me know how it goes.

facing the same issue here and worked after following the recommendation, took a while.

@nickmuchi thank you for the message. Could you please send the printscreens of the error. Thank you!

Hello, the bucket is created in S3 console. Still facing the same issue. Can someone please help me with this case??




Could you share your query?