cloudyr / aws.signature

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

Access denied with use_credentials() #29

Closed mriosopi closed 6 years ago

mriosopi commented 6 years ago

Hi, I been having a problem with use_credentials().

My variables in /.aws/credentialsare fine: "AWS_ACCESS_KEY_ID" "AWS_SECRET_ACCESS_KEY" "AWS_DEFAULT_REGION"

I also set the Region to us-west-2, changing the default.

If I make use of aws s3 ls in the terminal it works fine, but R its not working,

Any ideas of what could be the problem?

This is the code I'm running:

use_credentials(profile = Sys.getenv("AWS_PROFILE", "default"),
                file = default_credentials_file())
bucketlist(verbose=TRUE)

And I get this:

Checking for credentials in user-supplied values
Checking for credentials in Environment Variables
Using Environment Variable 'AWS_ACCESS_KEY_ID' for AWS Access Key ID
Using Environment Variable 'AWS_SECRET_ACCESS_KEY' for AWS Secret Access Key
Using Environment Variable 'AWS_DEFAULT_REGION' for AWS Region ('us-west-2')
S3 Request URL: https://s3-us-west-2.amazonaws.com/
Executing request with AWS credentials
Parsing AWS API response
Client error: (403) Forbidden

Thanks for your help!

leeper commented 6 years ago

Can you give me the output of sessionInfo()? And does locate_credentials() give the values you expect?

jamesdalg commented 5 years ago

I'm having a similar issue. Here is my sessioninfo:

sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

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

other attached packages: [1] DT_0.4 GenomicInteractions_1.14.0 InteractionSet_1.8.0 SummarizedExperiment_1.10.1 DelayedArray_0.6.1 BiocParallel_1.14.2
[7] matrixStats_0.53.1 GenomicFeatures_1.32.0 AnnotationDbi_1.42.1 Biobase_2.40.0 foreach_1.4.4 RCurl_1.95-4.11
[13] bitops_1.0-6 data.table_1.11.4 logging_0.7-103 shinyjs_1.0 plotly_4.7.1 jointseg_1.0.1
[19] htmlwidgets_1.2 htmltools_0.3.6 magrittr_1.5 reshape2_1.4.3 ggplot2_3.0.0 arules_1.6-1
[25] Matrix_1.2-14 visNetwork_2.0.4 igraph_1.2.1 circlize_0.4.4 shinycssloaders_0.2.0 shinythemes_1.1.1
[31] shiny_1.1.0 GenomicRanges_1.32.4 GenomeInfoDb_1.16.0 IRanges_2.14.10 S4Vectors_0.18.3 BiocGenerics_0.26.0

loaded via a namespace (and not attached): [1] colorspace_1.3-2 biovizBase_1.28.1 htmlTable_1.12 XVector_0.20.0 GlobalOptions_0.1.0 base64enc_0.1-3 dichromat_2.0-0
[8] rstudioapi_0.7 bit64_0.9-7 xml2_1.2.0 codetools_0.2-15 splines_3.5.1 knitr_1.20 Formula_1.2-3
[15] jsonlite_1.5 Rsamtools_1.32.2 cluster_2.0.7-1 compiler_3.5.1 httr_1.3.1 backports_1.1.2 assertthat_0.2.0
[22] lazyeval_0.2.1 later_0.7.3 acepack_1.4.1 prettyunits_1.0.2 tools_3.5.1 bindrcpp_0.2.2 gtable_0.2.0
[29] glue_1.2.0 GenomeInfoDbData_1.1.0 dplyr_0.7.6 Rcpp_0.12.17 Biostrings_2.48.0 rtracklayer_1.40.3 crosstalk_1.0.0
[36] iterators_1.0.10 stringr_1.3.1 mime_0.5 ensembldb_2.4.1 devtools_1.13.6 XML_3.98-1.11 zlibbioc_1.26.0
[43] scales_0.5.0 BSgenome_1.48.0 VariantAnnotation_1.26.1 BiocInstaller_1.30.0 ProtGenerics_1.12.0 hms_0.4.2 promises_1.0.1
[50] AnnotationFilter_1.4.0 RColorBrewer_1.1-2 yaml_2.2.0 curl_3.2 memoise_1.1.0 aws.signature_0.4.4 gridExtra_2.3
[57] biomaRt_2.36.1 rpart_4.1-13 latticeExtra_0.6-28 stringi_1.1.7 RSQLite_2.1.1 checkmate_1.8.5 shape_1.4.4
[64] rlang_0.2.1 pkgconfig_2.0.1 lattice_0.20-35 purrr_0.2.5 acnr_1.0.0 bindr_0.1.1 GenomicAlignments_1.16.0 [71] bit_1.1-14 tidyselect_0.2.4 plyr_1.8.4 R6_2.2.2 Hmisc_4.1-1 DBI_1.0.0 pillar_1.3.0
[78] foreign_0.8-70 withr_2.1.2 survival_2.42-6 nnet_7.3-12 tibble_1.4.2 crayon_1.3.4 aws.s3_0.3.12
[85] progress_1.2.0 grid_3.5.1 blob_1.1.1 git2r_0.23.0 digest_0.6.18 xtable_1.8-2 tidyr_0.8.1
[92] httpuv_1.4.4.2 munsell_0.5.0 viridisLite_0.3.0 Gviz_1.24.0