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

Error: sheets_write() #90

Closed
sam-watts opened this issue Jan 15, 2020 · 8 comments
Closed

Error: sheets_write() #90

sam-watts opened this issue Jan 15, 2020 · 8 comments

Comments

@sam-watts
Copy link

Error writing to a googlesheet. Doesn't appear to be an auth problem. Any thoughts appreciated!

library(googlesheets4)

df <- data.frame(
     x = 1:3,
     y = letters[1:3]
)
   
sheets_write(data=df, ss="1ll5gaEG1LEDZI5jFgNUI3PfyDZ-cmUcyr7z4l9JPzKQ")
#> Using an auto-discovered, cached token.
#> To suppress this message, modify your code or options to clearly consent to the use of a cached token.
#> See gargle's "Non-interactive auth" vignette for more details:
#> https://gargle.r-lib.org/articles/non-interactive-auth.html
#> The googlesheets4 package is using a cached token for **email removed**
#> Writing to 'googlesheets4 test'
#> Writing to sheet "Sheet5"
#> Error: Client error: (400) INVALID_ARGUMENT
#>   * Client specified an invalid argument. Check error message and error details for more information.
#>   * Invalid value at 'requests[1].update_cells.rows[0].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), "x"
#> Invalid value at 'requests[1].update_cells.rows[0].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "y"
#> Invalid value at 'requests[1].update_cells.rows[1].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 1
#> Invalid value at 'requests[1].update_cells.rows[1].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "a"
#> Invalid value at 'requests[1].update_cells.rows[2].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 2
#> Invalid value at 'requests[1].update_cells.rows[2].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "b"
#> Invalid value at 'requests[1].update_cells.rows[3].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 3
#> Invalid value at 'requests[1].update_cells.rows[3].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "c"
#> 
#> Error details:
#>   * Invalid value at 'requests[1].update_cells.rows[0].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), "x"
#>   * Invalid value at 'requests[1].update_cells.rows[0].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "y"
#>   * Invalid value at 'requests[1].update_cells.rows[1].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 1
#>   * Invalid value at 'requests[1].update_cells.rows[1].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "a"
#>   * Invalid value at 'requests[1].update_cells.rows[2].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 2
#>   * Invalid value at 'requests[1].update_cells.rows[2].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "b"
#>   * Invalid value at 'requests[1].update_cells.rows[3].values[0]' (type.googleapis.com/google.apps.sheets.v4.CellData), 3
#>   * Invalid value at 'requests[1].update_cells.rows[3].values[1]' (type.googleapis.com/google.apps.sheets.v4.CellData), "c"

Created on 2020-01-15 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> - Session info ----------------------------------------------------------
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       Windows 7 x64 SP 1          
#>  system   x86_64, mingw32             
#>  ui       RTerm                       
#>  language (EN)                        
#>  collate  English_United Kingdom.1252 
#>  ctype    English_United Kingdom.1252 
#>  tz       Europe/London               
#>  date     2020-01-15                  
#> 
#> - Packages --------------------------------------------------------------
#>  package       * version    date       lib
#>  assertthat      0.2.1      2019-03-21 [1]
#>  backports       1.1.2      2017-12-13 [1]
#>  base64enc       0.1-3      2015-07-28 [1]
#>  callr           3.0.0      2018-08-24 [1]
#>  cellranger      1.1.0      2016-07-27 [1]
#>  cli             1.0.1      2018-09-25 [1]
#>  crayon          1.3.4      2017-09-16 [1]
#>  curl            3.2        2018-03-28 [1]
#>  desc            1.2.0      2018-05-01 [1]
#>  devtools        2.0.1      2018-10-26 [1]
#>  digest          0.6.18     2018-10-10 [1]
#>  dplyr           0.8.1      2019-05-14 [1]
#>  evaluate        0.12       2018-10-09 [1]
#>  fs              1.3.1      2019-05-06 [1]
#>  gargle          0.4.0.9002 2020-01-14 [1]
#>  glue            1.3.1      2019-03-12 [1]
#>  googledrive     1.0.0      2019-08-19 [1]
#>  googlesheets4 * 0.1.0.9000 2020-01-14 [1]
#>  htmltools       0.3.6      2017-04-28 [1]
#>  httr            1.4.1      2019-08-05 [1]
#>  jsonlite        1.5        2017-06-01 [1]
#>  knitr           1.20       2018-02-20 [1]
#>  lifecycle       0.1.0      2019-08-01 [1]
#>  magrittr        1.5        2014-11-22 [1]
#>  memoise         1.1.0      2017-04-21 [1]
#>  openssl         1.1        2018-11-15 [1]
#>  pillar          1.4.3      2019-12-20 [1]
#>  pkgbuild        1.0.2      2018-10-16 [1]
#>  pkgconfig       2.0.2      2018-08-16 [1]
#>  pkgload         1.0.2      2018-10-29 [1]
#>  prettyunits     1.0.2      2015-07-13 [1]
#>  processx        3.2.0      2018-08-16 [1]
#>  ps              1.2.1      2018-11-06 [1]
#>  purrr           0.2.5      2018-05-29 [1]
#>  R6              2.4.1      2019-11-12 [1]
#>  Rcpp            1.0.1      2019-03-17 [1]
#>  remotes         2.0.2      2018-10-30 [1]
#>  rlang           0.4.2      2019-11-23 [1]
#>  rmarkdown       1.10       2018-06-11 [1]
#>  rprojroot       1.3-2      2018-01-03 [1]
#>  sessioninfo     1.1.1      2018-11-05 [1]
#>  stringi         1.2.4      2018-07-20 [1]
#>  stringr         1.3.1      2018-05-10 [1]
#>  tibble          2.1.3      2019-06-06 [1]
#>  tidyselect      0.2.5      2018-10-11 [1]
#>  usethis         1.4.0      2018-08-14 [1]
#>  withr           2.1.2      2018-03-15 [1]
#>  yaml            2.2.0      2018-07-25 [1]
#>  source                                  
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.0)                          
#>  CRAN (R 3.5.0)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  Github (r-lib/gargle@13c2549)           
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.3)                          
#>  Github (tidyverse/googlesheets4@b86b6f7)
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.3)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#>  CRAN (R 3.5.1)                          
#> 
#> [1] C:/packages
#> [2] C:/Program Files/R/R-3.5.1/library
@jennybc
Copy link
Member

jennybc commented Jan 15, 2020

That's definitely a malformed request (so an internal problem, not a user problem).

Unfortunately I can't replicate it. I suppose my first-line advice is to re-install googlesheets4 from GitHub, in case you somehow installed from a broken state (though your session info indicates a very recent install).

library(googlesheets4)
df <- data.frame(
  x = 1:3,
  y = letters[1:3]
)

x <- sheets_create()
#> Spreadsheet name: lilywhite-tuatara
#>                 ID: 1ZfRPOCm6bkdnT4NZ17Jpj0K1AgLPRcMj9Oitnv-1g5w
#>             Locale: en_US
#>          Time zone: Etc/GMT
#>        # of sheets: 1
#> 
#> (Sheet name): (Nominal extent in rows x columns)
#>       Sheet1: 1000 x 26
sheets_write(data=df, ss=x)
#> Writing to 'lilywhite-tuatara'
#> Writing to sheet "df"
#> Spreadsheet name: lilywhite-tuatara
#>                 ID: 1ZfRPOCm6bkdnT4NZ17Jpj0K1AgLPRcMj9Oitnv-1g5w
#>             Locale: en_US
#>          Time zone: Etc/GMT
#>        # of sheets: 2
#> 
#> (Sheet name): (Nominal extent in rows x columns)
#>       Sheet1: 1000 x 26
#>           df: 4 x 2

Created on 2020-01-15 by the reprex package (v0.3.0.9001)

@sam-watts
Copy link
Author

sam-watts commented Jan 23, 2020 via email

@jennybc
Copy link
Member

jennybc commented Jan 23, 2020

Ok great. BTW you can always close an issue that you opened.

@jennybc jennybc closed this as completed Jan 23, 2020
@jntrcs
Copy link

jntrcs commented Jul 22, 2022

Still seeing this in 2022 - anyone else?

@lscluvanni
Copy link

I am also seeing it in 2022

@jennybc
Copy link
Member

jennybc commented Nov 2, 2022

For this to go anywhere, we'd need a new issue opened with a reprex or basically just anything that gives some hope of replicating the problem.

@emilyerdos
Copy link

Just ran into this also

@benyamindsmith
Copy link

Just ran into this now.

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

6 participants