Skip to content

Error (lexical error: invalid char in json text) when uploading a dataframe from a Compute Engine VM #60

@prcbnt

Description

@prcbnt

Hello,

Thank you for the amazing work on the package !

I am trying to gcs_upload dataframes from a Compute Engine VM into a Cloud Storage bucket (obviously), and I constantly get the following error

Request Status Code: 400
Error: lexical error: invalid char in json text.
                                       <!DOCTYPE html> <html lang=en> 
                     (right here) ------^

Here is the code I used to test the function with a very simple dataframe

library(googleCloudStorageR)
gcs_auth()
proj <- "XXXXX"
buckets <- gcs_list_buckets(proj)
bucket <- gcs_get_bucket(buckets[[1]])

employee <- c('John Doe','Peter Gynn','Jolie Hope')
salary <- c(21000, 23400, 26800)
startdate <- as.Date(c('2010-11-1','2008-3-25','2007-3-14'))

employ.data <- data.frame(employee, salary, startdate)

gcs_upload(employ.data, bucket = bucket)

Auth works fine and I can't seem to find the solution. Any idea of what might be the problem ?

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions