In Python I can access AWS and list files in bucket fine. But in R I get an error when trying to access AWS with the same credentials. Please help me debug the error.
R with error:
library(paws)
s3 <- paws::s3()
Sys.setenv(
AWS_ACCESS_KEY_ID = "<key>",
AWS_SECRET_ACCESS_KEY = "<secret_key>",
AWS_DEFAULT_REGION = "us-east-1"
)
s3$list_objects('<path>')
Error: SignatureDoesNotMatch (HTTP 403). The request signature we calculated does not match the signature you provided. Check your key and signing method.
Python with no error:
import s3fs
s3 = s3fs.S3FileSystem(
key='<key>',
secret='<secret_key>',
client_kwargs={
'endpoint_url': 'https://s3.amazonaws.com',
'region_name':'us-east-1'
}
)
s3.ls("<path>")