-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential issue with AWS default S3 region of us-east-1 #788
Comments
Hi @payam-delfi Question: I didn't see this in the docs, but is it true that the paws package itself functions from its sub packages? For example, is paws::s3() calling paws.storage::s3()?
It looks like we have a potential issue when we do some re-directly. Note: endpoints = list(
"us-gov-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"us-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"us-west-2" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"eu-west-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"ap-southeast-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"ap-southeast-2" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"ap-northeast-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"sa-east-1" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"us-east-1" = list(endpoint = "s3.amazonaws.com", global = FALSE),
"*" = list(endpoint = "s3.{region}.amazonaws.com", global = FALSE),
"cn-*" = list(endpoint = "s3.{region}.amazonaws.com.cn", global = FALSE),
"eu-isoe-*" = list(endpoint = "s3.{region}.cloud.adc-e.uk", global = FALSE),
"us-iso-*" = list(endpoint = "s3.{region}.c2s.ic.gov", global = FALSE),
"us-isob-*" = list(endpoint = "s3.{region}.sc2s.sgov.gov", global = FALSE),
"us-isof-*" = list(endpoint = "s3.{region}.csp.hci.ic.gov", global = FALSE)
) |
Thanks for explaining that. Right now this is my workaround: s3 <- paws.storage::s3()
# If default region is set to "us-east-1" or is empty, we need to re-initialize the
# S3 service and provide a region. This step is necessary or else the `get_object()` call
# gives us this error: Expecting a single string value: [type=list; extent=1].
if (get_region() == "us-east-1" || get_region() == "") {
bucket_region <- s3$get_bucket_location("my-example-bucket")[["LocationConstraint"]]
s3 <- paws.storage::s3(config = list(region = bucket_region))
} The get_region <- function() {
paws.common::locate_credentials()[["region"]]
} |
I wondered about this as well! |
Currently on holiday really sorry about my slow replies. Will investigate this properly when I get back. However in the meantime please feel free to raise any PR if you believe you have a solution for this. I do appreciate PRs as paws is a beast of a SDK package. |
No worries at all, enjoy your time off. The workaround I posted above works pretty well for us, if other want to try it out for now. I haven't dug deep into the code base, but I will try to take a look, see if I can make a PR. |
@payam-delfi just finished my holiday. What paws.common version do you have? |
Welcome back! I installed the 3 packages below individually:
|
@payam-delfi I believe I have a fix for this issue. Please try the dev version and let me know. remotes::install_github("dyfanjones/paws/paws.common", ref = "fix-redirect") |
I will leave this ticket open until paws.common 0.7.4 is released to the cran |
Thank you very much! I can confirm it's working now. Really appreciate your help and support on this package. Amazing work. |
Closing as paws.common 0.7.4 has been released to the cran |
Hello! First off, thank you for this amazing package. It has such a nice interface and very well documented.
I had a question and a potential bug.
Question: I didn't see this in the docs, but is it true that the
paws
package itself functions from its sub packages? For example, ispaws::s3()
callingpaws.storage::s3()
?Potential bug: When
region = us-east-1
is set in the~/.aws/config
file, there seems to be an issue with running this:Which gives this cryptic error:
The is the same error we'd get if the region was not set in the
config
file or through environment variable.But when I change the region to anything else, like
us-east-2
, it works just fine. Note that the bucket I'm trying to read is onus-west-1
.Looking at the logs with
options(paws.log_level = 3L)
, I see this difference:When
region = us-east-1
in config file:When region is something else in config file:
The text was updated successfully, but these errors were encountered: