DyfanJones / noctua

Connect R to Athena using paws SDK (DBI Interface)
https://dyfanjones.github.io/noctua/
Other
45 stars 5 forks source link

Connecting using long-term-creds returns Error 400 #202

Closed fabhans closed 1 year ago

fabhans commented 1 year ago

Issue Description

I created an IAM user using Terraform to use for Athena queries. But connecting using this long-term-creds returns an Error 400. I wonder if this has something to do with noctua expecting aws_access_key_id, aws_secret_access_key, and aws_session_token, but the IAM user only having an aws_access_key_id and an aws_secret_access_key.

Querying via CLI works fine.

DyfanJones commented 1 year ago

Hi @fabhans sorry to hear that, does it work using directly from paws?

fabhans commented 1 year ago

How would I test that? Connecting with RAthena fails with the same error if that helps.

fabhans commented 1 year ago

Btw the error 400 explicitly mentions the token:

An error occurred while the 'noctua' package was updating the RStudio Connections pane:
Error in NULL: ExpiredTokenException (HTTP 400). The security token included in the request is expired
If necessary, these warnings can be squelched by setting `options(rstudio.connectionObserver.errorsSuppressed = TRUE)`.
fabhans commented 1 year ago

I just came back and re-tried - error resolved itself. Maybe there was still some short-term creds cached or something like that.

DyfanJones commented 1 year ago

Interesting, but really glad it is working :)