Sagemake couldn't access S3 vis athena query

0

I have access denied issue when running AWS sagemaker and running a script that will access AWS Athena I can execute the Athena query directly via the AWS console But when using sagemaker executing the query, I got following error

Permission denied on S3 path: s3://...
This query ran against the "mydatabse" database, unless qualified by the query. Please post the error message on our forum  or contact customer support  with Query Id: 3a825c36-7389-409c-be1e-34d4bcd4256a

I'm pretty sure I provide the sagemaker execution role all the s3:* permission on my bucket but still couldn't access it. Please help me solving the issue.

1 Answer
1

Looks like it's a permission issue. Take a look at the blog below and review step 2 of the "Data analysis and management using Amazon SageMaker" section... https://aws.amazon.com/blogs/machine-learning/run-sql-queries-from-your-sagemaker-notebooks-using-amazon-athena/

I suspect something's missing in this step: "Under Notebook Instance settings populate the Notebook instance name, choose an instance type, and a role for the notebook instances in Amazon SageMaker to interact with Amazon S3. The SageMaker execution role needs to have necessary permission to Athena, the S3 buckets where the data resides, and KMS if encrypted."

I'm also sharing the following resource which can help troubleshoot "Access Denied" errors related to Athena... https://aws.amazon.com/premiumsupport/knowledge-center/access-denied-athena/

Hopefully these resources help you resolving the error.

AWS
answered 2 years ago
AWS
EXPERT
reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions