Possible bug in put_object. Using a brand-new AWS (free) account I'm attempting basic operations with S3 storage. The following code results in the error: "Error: Argument object must be of type character or raw vector if serialize is FALSE"
Put your code here:
library(shiny)
library(gpx)
library(aws.s3)
library(digest
s3_bucket_name <- "XXX"
Sys.setenv("AWS_ACCESS_KEY_ID" = "XXX",
"AWS_SECRET_ACCESS_KEY" = "XXX",
"AWS_DEFAULT_REGION" = "us-east-2")
###Functions
# Function to convert uploaded .gpx file to dataframe
ReadGPX <- function(filepath) {
data <- read_gpx(filepath)
data <- data$waypoints
data <- subset(data, select = c(Latitude, Longitude, Name, Description))
}
# Function to define human time
get_time_human <- function() {
format(Sys.time(), "%Y%m%d-%H%M%OS")
}
###Import Data
data <- ReadGPX("C:/Users/ragary/Desktop/Travel/BUL.gpx")
###Create unique file_name and upload to bucket
file_name <-paste0(
paste(
get_time_human(),
digest(data, algo = "md5"),
sep = "_"
),
".rda")
put_object(file = data, object = file_name, bucket = s3_bucket_name)
Session Info:
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32
Running under: Windows >= 8 x64 (build 9200)
httr::with_verbose(put_object(file = data, object = file_name, bucket = bucket_name, verbose = TRUE))
Locating credentials
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-east-2')
S3 Request URL: https://s3-us-east-2.amazonaws.com/XXX/20220425-095906_b658313a466b37dffba28cac2faa7c90.rda
Executing request with AWS credentials
Locating credentials
Checking for credentials in user-supplied values
Using user-supplied value for AWS Access Key ID
Using user-supplied value for AWS Secret Access Key
Using user-supplied value for AWS Region ('us-east-2')
Error: Argument object must be of type character or raw vector if serialize is FALSE
Possible bug in put_object. Using a brand-new AWS (free) account I'm attempting basic operations with S3 storage. The following code results in the error: "Error: Argument object must be of type character or raw vector if serialize is FALSE"
Put your code here:
Session Info:
R version 4.1.1 (2021-08-10) Platform: x86_64-w64-mingw32 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 [4] LC_NUMERIC=C LC_TIME=English_United States.1252
other attached packages: [1] aws.s3_0.3.21 [2] gpx 1.1.0 [3] shiny 1.7.1 [4] digest 0.6.29
I ran:
httr::with_verbose(put_object(file = data, object = file_name, bucket = bucket_name, verbose = TRUE))
Console output: