Skip to content
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

put_object error: Argument object must be of type character or raw vector #425

Open
msmith1695 opened this issue Nov 8, 2022 · 0 comments

Comments

@msmith1695
Copy link

Encountering an error while using the put_object function while attempting a basic CSV file upload to S3 via R, using the aws.s3 package. Code:

library(aws.s3)
library(tcltk)

Sys.setenv(
  "AWS_ACCESS_KEY_ID" = "xxxxxxxxxxxxxxxxxxxx",
  "AWS_SECRET_ACCESS_KEY" = "xxxxxxxxxxxxxxxxxxxx",
  "AWS_DEFAULT_REGION" = "us-east-1"
)

file_to_upload <- read.csv(tk_choose.files(caption = "Choose CSV file to upload"))

put_object(file = file_to_upload,
           object = "test.csv",
           bucket = "bucket_name",
           folder = "folder_name",
           )

Which results in an error message of:

Error: Argument object must be of type character or raw vector if serialize is FALSE

With the verbose = TRUE parameter included in the function call, output is:

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-1')
S3 Request URL: https://s3.amazonaws.com/bucket_name/folder_name/test.csv
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-1')
Error: Argument object must be of type character or raw vector if serialize is FALSE

This seems closely related to Issue #243.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant