cloudyr / aws.signature

Amazon Web Services Request Signatures
https://cloud.r-project.org/package=aws.signature
31 stars 32 forks source link

aws.signature::locate_credentials() reporting wrong region #58

Open andrewcstewart opened 4 years ago

andrewcstewart commented 4 years ago

Hey there. I may have encountered a bug.

While troubleshooting some access issues, I discovered that aws.signature::locate_credentials() is reporting my region as us-east-1, while I can verify that us-east-1 appears no where in my .aws profile, any stray environment variables, Renviorn, etc.

edit: I should stress that my profile config explicitly sets my default region to us-west-2, which is the region I'd expect to see reported.

Please specify whether your issue is about:

Put your code here:

## load package
library("aws.s3")

## code goes here
aws.signature::locate_credentials()

$key
[1] "xxx"

$secret
[1] "xxx"

$session_token
NULL

$region
[1] "us-east-1"

## session info for your system
sessionInfo()

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin17.7.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /usr/local/Cellar/openblas/0.3.9/lib/libopenblasp-r0.3.9.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.6.3        aws.ec2metadata_0.2.0 tools_3.6.3           base64enc_0.1-3       curl_4.3              aws.signature_0.5.2   jsonlite_1.6.1       
[8] digest_0.6.25         packrat_0.5.0    
jon-mago commented 4 years ago

Hi there, thanks for reporting this issue.

This is a known issue. As it stands right now aws.signature doesn't read in .aws/config (#53). At the moment, as a work around, you can either set the AWS_DEFAULT_REGION env variable, or set the option(cloudyr.aws.default_region = 'us-west-2') before you use a method.

I hope this helps?

nick-youngblut commented 2 years ago

This is a known issue.

Any progress on this issue?