cloudyr / aws.s3

Amazon Simple Storage Service (S3) API Client
https://cloud.r-project.org/package=aws.s3
381 stars 147 forks source link

Bug: save_object returns a SignatureDoesNotMatch #399

Open lollo-higg opened 2 years ago

lollo-higg commented 2 years ago

I am trying to save an object from s3. When I run save_object on certain items, I get an error "SignatureDoesNotMatch". Other times I am successful.

I have looked into my AWS credentials and permissions, but those should be OK.

When researching this message, I found this related issue: https://github.com/aws/aws-sdk-go-v2/issues/883

Which makes me think that the issue may be with the serializer.

Screen Shot 2021-09-24 at 10 22 15 AM

The object is a string with /path/to/object. The diff characters between the string that works and the strings that don't are: % : {}

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

## code goes here
save_object(object =ids[[1]], 
            bucket = my_bucket,
            file = str_c("subfolder/", ids[[1]]))

## session info for your system
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: aarch64-apple-darwin20.5.0 (64-bit)
Running under: macOS Big Sur 11.6

Matrix products: default
LAPACK: /opt/homebrew/Cellar/r/4.1.1/lib/R/lib/libRlapack.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    
[5] datasets  methods   base     

other attached packages:
 [1] aws.s3_0.3.22   forcats_0.5.1   stringr_1.4.0  
 [4] dplyr_1.0.7     purrr_0.3.4     readr_2.0.1    
 [7] tidyr_1.1.3     tibble_3.1.4    ggplot2_3.3.5  
[10] tidyverse_1.3.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7          lubridate_1.7.10   
 [3] listenv_0.8.0       assertthat_0.2.1   
 [5] digest_0.6.28       utf8_1.2.2         
 [7] aws.signature_0.6.0 parallelly_1.28.1  
 [9] R6_2.5.1            cellranger_1.1.0   
[11] backports_1.2.1     reprex_2.0.1       
[13] evaluate_0.14       httr_1.4.2         
[15] pillar_1.6.2        rlang_0.4.11       
[17] curl_4.3.2          readxl_1.3.1       
[19] rstudioapi_0.13     data.table_1.14.0  
[21] furrr_0.2.3         rmarkdown_2.11     
[23] bit_4.0.4           munsell_0.5.0      
[25] broom_0.7.9         compiler_4.1.1     
[27] modelr_0.1.8        xfun_0.26          
[29] pkgconfig_2.0.3     base64enc_0.1-3    
[31] globals_0.14.0      htmltools_0.5.2    
[33] tidyselect_1.1.1    codetools_0.2-18   
[35] fansi_0.5.0         future_1.22.1      
[37] crayon_1.4.1        tzdb_0.1.2         
[39] dbplyr_2.1.1        withr_2.4.2        
[41] grid_4.1.1          jsonlite_1.7.2     
[43] gtable_0.3.0        lifecycle_1.0.0    
[45] DBI_1.1.1           magrittr_2.0.1     
[47] scales_1.1.1        cli_3.0.1          
[49] stringi_1.7.4       vroom_1.5.5        
[51] fs_1.5.0            xml2_1.3.2         
[53] ellipsis_0.3.2      generics_0.1.0     
[55] vctrs_0.3.8         tools_4.1.1        
[57] bit64_4.0.5         glue_1.4.2         
[59] hms_1.1.0           yaml_2.2.1         
[61] parallel_4.1.1      fastmap_1.1.0      
[63] colorspace_2.0-2    rvest_1.0.1        
[65] knitr_1.34          haven_2.4.3