Git Product home page Git Product logo

Comments (3)

m-for-madness avatar m-for-madness commented on June 4, 2024

Hi, could you share the full error output?

from pyathena.

timnon avatar timnon commented on June 4, 2024

I reproduced it with only boto3, so its not a problem with pyathena. The full error output of is:

Traceback (most recent call last):
  File "athena.py", line 19, in <module>
    run_query(query,"clickstream","s3://<our athena staging bucket>")
  File "athena.py", line 12, in run_query
    'OutputLocation': s3_output,
  File "/opt/anaconda3/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/anaconda3/lib/python3.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.InvalidRequestException: An error occurred (InvalidRequestException) when calling the StartQueryExecution operation: Unable to verify/create output bucket <our athena staging bucket>

However, the strange this is that if i use another user (other AWS key-secret pair) to run this query straight afterwards, i dont get this errror but the query runs fine. Returning then immediately to the original user makes the query also work????

I guess this is definitely not a pyathena problem, so i will close this issue. However, strange things are happening here.

The script athena.py using boto3 looks as follows:

#!/usr/bin/env python3
import boto3
#Function for starting athena query
def run_query(query, database, s3_output):
    client = boto3.client('athena')
    response = client.start_query_execution(
        QueryString=query,
        QueryExecutionContext={
            'Database': database
            },
        ResultConfiguration={
            'OutputLocation': s3_output,
            }
        )
    print('Execution ID: ' + response['QueryExecutionId'])
    return response

query = "SELECT * FROM mydatabase.mytable LIMIT 10"
run_query(query,"mydatabase","s3://<our athena staging bucket>")

from pyathena.

timnon avatar timnon commented on June 4, 2024

This might even be a general S3 access problem independent of Athena. Pretty hard to debug, since i need to wait until the user fails again.

from pyathena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.