moj-analytical-services / Rdbtools

Accessing Athena on the Analytical Platform
Other
4 stars 0 forks source link

Conntection to Athena via container seems to break after about an hour. #31

Closed jforster75 closed 3 months ago

jforster75 commented 3 months ago

Hi

I am trying to access data on Athena via a dev version of my dashboard and this no longer works correctly following an R Studio update. The error on the logs is below is below and the repo is

Warning: Error in db_query_fields.DBIConnection: Can't query fields.
ℹ Using SQL: SELECT * FROM
  "bold_rr_case_info_dashboard_dev"."delius_fct_offender" "q01" WHERE (0 = 1)
Caused by error:
! Access denied when writing output to url: s3://mojap-athena-query-dump/AROAYUIXP4BW7SBOAOWEV:alpha_app_bold-case-info-dashboard-dev_1718118860.02764/26c7fc72-11f0-4920-890b-bf2eb78e5432.csv . Please ensure you are allowed to access the S3 bucket. If specifying an expected bucket owner, confirm the bucket is owned by the expected account. If you are encrypting query results with KMS key, please ensure you are allowed to access your KMS key

Data Engineering has suggested it may be related to AWS credentials not correctly refreshing as I am able to use the dashboard fine for the first few minutes but the errors begin after a certain period of time, definitely less than an hour.

Any advice would be greatly appreciated.

Thanks

jforster75 commented 3 months ago

Sorry, the repo is https://github.com/ministryofjustice/bold-case-info-dashboard

pjrh-moj commented 3 months ago

Hi - we came across a similar issue to this yesterday, and fixed it in v0.5.2. Could you try upgrading Rdbtools to that and see if that helps?

jforster75 commented 3 months ago

Thanks, I have tried this and it appears to have worked. I will continue to check and let you know if I have any more issues.