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
drive_auth throws odd error #109
Comments
I'm getting the same error as Tareef here, trying to use googlesheets4 by way of googledrive. I have tried restarting my session (no luck). I cleared out my pre-existing When I use I'm doing this in an interactive session, and have tried both from within a project, and as my global self. Happy to write up a troubleshooting guide if/once I figure out how I got stuck! |
What exactly does that mean? @batpigandme Can you show me the exact code you're running? A regular user shouldn't be calling |
Yep. Here it is (same as in the interactive session). library(googledrive)
library(googlesheets4)
#>
#> Attaching package: 'googlesheets4'
#> The following objects are masked from 'package:googledrive':
#>
#> request_generate, request_make
results <- drive_get("bobs_burgers_survey_results")
#> Error: Can't get Google credentials.
#> Are you running googledrive in a non-interactive session? Consider:
#> * `drive_deauth()` to prevent the attempt to get credentials.
#> * Call `drive_auth()` directly with all necessary specifics. Created on 2019-09-10 by the reprex package (v0.3.0) Session infodevtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.1 (2019-07-05)
#> os macOS Mojave 10.14.6
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz America/New_York
#> date 2019-09-10
#>
#> ─ Packages ──────────────────────────────────────────────────────────────
#> package * version date lib
#> askpass 1.1 2019-01-13 [1]
#> assertthat 0.2.1 2019-03-21 [1]
#> backports 1.1.4 2019-04-10 [1]
#> callr 3.3.1 2019-07-18 [1]
#> cellranger 1.1.0 2016-07-27 [1]
#> cli 1.1.0 2019-03-19 [1]
#> crayon 1.3.4 2019-08-02 [1]
#> curl 4.0 2019-07-22 [1]
#> desc 1.2.0 2019-08-02 [1]
#> devtools 2.1.0.9000 2019-08-27 [1]
#> digest 0.6.20 2019-07-04 [1]
#> dplyr 0.8.3.9000 2019-08-15 [1]
#> evaluate 0.14 2019-05-28 [1]
#> fs 1.3.1.9000 2019-08-02 [1]
#> gargle 0.3.1.9000 2019-08-21 [1]
#> glue 1.3.1.9000 2019-08-05 [1]
#> googledrive * 1.0.0 2019-08-19 [1]
#> googlesheets4 * 0.0.0.9001 2019-09-10 [1]
#> highr 0.8 2019-03-20 [1]
#> htmltools 0.3.6 2017-04-28 [1]
#> httr 1.4.1 2019-08-05 [1]
#> jsonlite 1.6 2018-12-07 [1]
#> knitr 1.24 2019-08-08 [1]
#> magrittr 1.5 2014-11-22 [1]
#> memoise 1.1.0 2017-04-21 [1]
#> openssl 1.4.1 2019-08-02 [1]
#> pillar 1.4.2 2019-06-29 [1]
#> pkgbuild 1.0.5 2019-08-26 [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.4.1.9000 2019-08-02 [1]
#> ps 1.3.0 2018-12-21 [1]
#> purrr 0.3.2.9000 2019-08-14 [1]
#> R6 2.4.0 2019-02-14 [1]
#> Rcpp 1.0.2 2019-07-25 [1]
#> remotes 2.1.0 2019-06-24 [1]
#> rlang 0.4.0.9002 2019-09-10 [1]
#> rmarkdown 1.15 2019-08-21 [1]
#> rprojroot 1.3-2 2018-01-03 [1]
#> sessioninfo 1.1.1 2018-11-05 [1]
#> stringi 1.4.3 2019-03-12 [1]
#> stringr 1.4.0 2019-02-10 [1]
#> testthat 2.2.1 2019-07-25 [1]
#> tibble 2.1.3 2019-06-06 [1]
#> tidyselect 0.2.5.9000 2019-08-15 [1]
#> usethis 1.5.1.9000 2019-08-21 [1]
#> withr 2.1.2.9000 2019-09-09 [1]
#> xfun 0.9 2019-08-21 [1]
#> yaml 2.2.0 2018-07-25 [1]
#> source
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> standard (@1.1.0)
#> Github (r-lib/crayon@84be620)
#> CRAN (R 3.6.0)
#> Github (r-lib/desc@c860e7b)
#> Github (r-lib/devtools@2778b0d)
#> CRAN (R 3.6.0)
#> Github (tidyverse/dplyr@85faf79)
#> CRAN (R 3.6.0)
#> Github (r-lib/fs@00e2de8)
#> Github (r-lib/gargle@e81cf7d)
#> Github (tidyverse/glue@7ac044a)
#> CRAN (R 3.6.0)
#> Github (tidyverse/googlesheets4@094063e)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.1)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (jeroen/openssl@f01feab)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.1)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (r-lib/processx@8843706)
#> CRAN (R 3.6.0)
#> Github (tidyverse/purrr@c755bb9)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (r-lib/rlang@cf0a8c9)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (tidyverse/tidyselect@4de95ee)
#> Github (r-lib/usethis@bcef417)
#> Github (r-lib/withr@07bfc68)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library |
Will you do |
Yep. I tried this both with and without email specified (again, runs the same in interactive, so I'm using reprex). I'm not clear on whether the token is something I'm supposed to keep secret, so I library(googledrive)
library(googlesheets4)
#>
#> Attaching package: 'googlesheets4'
#> The following objects are masked from 'package:googledrive':
#>
#> request_generate, request_make
options(gargle_quiet = FALSE)
drive_auth()
#> trying token_fetch()
#> trying credentials_service_account()
#> Error: Argument 'txt' must be a JSON string, URL or file.
#> trying credentials_app_default()
#> trying credentials_gce()
#> trying credentials_byo_oauth()
#> Error: inherits(token, "Token2.0") is not TRUE
#> trying credentials_user_oauth2()
#> Gargle2.0 initialize
#> attempt from: googledrive
#> adding 'userinfo.email' scope
#> loading token from the cache
#> Error: Cache contains tokens with names that do not match their hash:
#> * Token stored as '********************************_mara@rstudio.com'
#> but hash is '********************************_mara@rstudio.com'
#> Error: Can't get Google credentials.
#> Are you running googledrive in a non-interactive session? Consider:
#> * `drive_deauth()` to prevent the attempt to get credentials.
#> * Call `drive_auth()` directly with all necessary specifics.
drive_auth(email = "maraaverick@gmail.com")
#> trying token_fetch()
#> trying credentials_service_account()
#> Error: Argument 'txt' must be a JSON string, URL or file.
#> trying credentials_app_default()
#> trying credentials_gce()
#> trying credentials_byo_oauth()
#> Error: inherits(token, "Token2.0") is not TRUE
#> trying credentials_user_oauth2()
#> Gargle2.0 initialize
#> attempt from: googledrive
#> adding 'userinfo.email' scope
#> loading token from the cache
#> Error: Cache contains tokens with names that do not match their hash:
#> * Token stored as '***************************************_mara@rstudio.com'
#> but hash is '***************************************_mara@rstudio.com'
#> Error: Can't get Google credentials.
#> Are you running googledrive in a non-interactive session? Consider:
#> * `drive_deauth()` to prevent the attempt to get credentials.
#> * Call `drive_auth()` directly with all necessary specifics. Created on 2019-09-10 by the reprex package (v0.3.0) Session infodevtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#> setting value
#> version R version 3.6.1 (2019-07-05)
#> os macOS Mojave 10.14.6
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz America/New_York
#> date 2019-09-10
#>
#> ─ Packages ──────────────────────────────────────────────────────────────
#> package * version date lib
#> askpass 1.1 2019-01-13 [1]
#> assertthat 0.2.1 2019-03-21 [1]
#> backports 1.1.4 2019-04-10 [1]
#> callr 3.3.1 2019-07-18 [1]
#> cellranger 1.1.0 2016-07-27 [1]
#> cli 1.1.0 2019-03-19 [1]
#> crayon 1.3.4 2019-08-02 [1]
#> curl 4.0 2019-07-22 [1]
#> desc 1.2.0 2019-08-02 [1]
#> devtools 2.1.0.9000 2019-08-27 [1]
#> digest 0.6.20 2019-07-04 [1]
#> dplyr 0.8.3.9000 2019-08-15 [1]
#> evaluate 0.14 2019-05-28 [1]
#> fs 1.3.1.9000 2019-08-02 [1]
#> gargle 0.3.1.9000 2019-08-21 [1]
#> glue 1.3.1.9000 2019-08-05 [1]
#> googledrive * 1.0.0 2019-08-19 [1]
#> googlesheets4 * 0.0.0.9001 2019-09-10 [1]
#> highr 0.8 2019-03-20 [1]
#> htmltools 0.3.6 2017-04-28 [1]
#> httr 1.4.1 2019-08-05 [1]
#> jsonlite 1.6 2018-12-07 [1]
#> knitr 1.24 2019-08-08 [1]
#> magrittr 1.5 2014-11-22 [1]
#> memoise 1.1.0 2017-04-21 [1]
#> openssl 1.4.1 2019-08-02 [1]
#> pillar 1.4.2 2019-06-29 [1]
#> pkgbuild 1.0.5 2019-08-26 [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.4.1.9000 2019-08-02 [1]
#> ps 1.3.0 2018-12-21 [1]
#> purrr 0.3.2.9000 2019-08-14 [1]
#> R6 2.4.0 2019-02-14 [1]
#> Rcpp 1.0.2 2019-07-25 [1]
#> remotes 2.1.0 2019-06-24 [1]
#> rlang 0.4.0.9002 2019-09-10 [1]
#> rmarkdown 1.15 2019-08-21 [1]
#> rprojroot 1.3-2 2018-01-03 [1]
#> sessioninfo 1.1.1 2018-11-05 [1]
#> stringi 1.4.3 2019-03-12 [1]
#> stringr 1.4.0 2019-02-10 [1]
#> testthat 2.2.1 2019-07-25 [1]
#> tibble 2.1.3 2019-06-06 [1]
#> tidyselect 0.2.5.9000 2019-08-15 [1]
#> usethis 1.5.1.9000 2019-08-21 [1]
#> withr 2.1.2.9000 2019-09-09 [1]
#> xfun 0.9 2019-08-21 [1]
#> yaml 2.2.0 2018-07-25 [1]
#> source
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> standard (@1.1.0)
#> Github (r-lib/crayon@84be620)
#> CRAN (R 3.6.0)
#> Github (r-lib/desc@c860e7b)
#> Github (r-lib/devtools@2778b0d)
#> CRAN (R 3.6.0)
#> Github (tidyverse/dplyr@85faf79)
#> CRAN (R 3.6.0)
#> Github (r-lib/fs@00e2de8)
#> Github (r-lib/gargle@e81cf7d)
#> Github (tidyverse/glue@7ac044a)
#> CRAN (R 3.6.0)
#> Github (tidyverse/googlesheets4@094063e)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.1)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (jeroen/openssl@f01feab)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.1)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (r-lib/processx@8843706)
#> CRAN (R 3.6.0)
#> Github (tidyverse/purrr@c755bb9)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (r-lib/rlang@cf0a8c9)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#> Github (tidyverse/tidyselect@4de95ee)
#> Github (r-lib/usethis@bcef417)
#> Github (r-lib/withr@07bfc68)
#> CRAN (R 3.6.0)
#> CRAN (R 3.6.0)
#>
#> [1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library |
Interesting. Looks a lot like tidyverse/googledrive#274 No, you don't need to worry about the hash. It doesn't disclose anything specific to your token. That is, everywhere you did Repeating from the googledrive thread:
If you delete the offending token (or just clean out the whole gargle cache or even delete that directory) and start afresh, what happens? Directions for that are in the googledrive thread, but it really is just file or folder deletion. |
Resolved by manually clearing out |
So... i was continually getting the following error with drive_auth(). After restarting my R process, everything worked beautifully and I was able to get authenticated and use googlesheets4.
drive_deauth()
to prevent the attempt to get credentials.drive_auth()
directly with all necessary specifics.Here is the session_info() I had. I am suspecting that rlang or vctrs getting refreshed while they were loaded may have had something to do with it, but that is pure conjecture.
─ Packages ───────────────────────────────────────────────────────────────────────────────────────────
! package * version date lib source
askpass 1.1 2019-01-13 [1] CRAN (R 3.5.2)
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.5.2)
backports 1.1.4 2019-04-10 [1] CRAN (R 3.5.2)
broom 0.5.2 2019-04-07 [1] CRAN (R 3.5.2)
callr 3.2.0 2019-03-15 [1] CRAN (R 3.5.2)
cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.5.0)
checkmate 1.9.4 2019-07-04 [1] CRAN (R 3.5.2)
cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.2)
colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.5.2)
config 0.3 2018-03-27 [1] CRAN (R 3.5.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.0)
crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.5.0)
V curl 3.3 2019-07-22 [1] CRAN (R 3.5.2)
data.table 1.12.2 2019-04-07 [1] CRAN (R 3.5.2)
desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.0)
devtools * 2.0.2 2019-04-08 [1] CRAN (R 3.5.2)
digest 0.6.20 2019-07-04 [1] CRAN (R 3.5.2)
dplyr * 0.8.3 2019-07-04 [1] CRAN (R 3.5.2)
DT * 0.6 2019-05-09 [1] CRAN (R 3.5.2)
fansi 0.4.0 2018-10-05 [1] CRAN (R 3.5.0)
forcats * 0.4.0 2019-02-17 [1] CRAN (R 3.5.2)
fs 1.3.1 2019-05-06 [1] CRAN (R 3.5.2)
gargle 0.3.1 2019-07-26 [1] CRAN (R 3.5.2)
generics 0.0.2 2018-11-29 [1] CRAN (R 3.5.0)
ggplot2 * 3.2.0 2019-06-16 [1] CRAN (R 3.5.2)
glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.2)
googledrive * 1.0.0 2019-08-19 [1] CRAN (R 3.5.2)
googlesheets4 * 0.0.0.9001 2019-08-22 [1] Github (tidyverse/googlesheets4@094063e)
gt * 0.1.0 2019-07-18 [1] Github (rstudio/gt@1e9ef2b)
gtable 0.3.0 2019-03-25 [1] CRAN (R 3.5.2)
haven 2.1.0 2019-02-19 [1] CRAN (R 3.5.2)
hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.0)
htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.0)
htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.5.0)
httpuv 1.5.1 2019-04-05 [1] CRAN (R 3.5.2)
V httr 1.4.0 2019-08-05 [1] CRAN (R 3.5.2)
jsonlite 1.6 2018-12-07 [1] CRAN (R 3.5.0)
labeling 0.3 2014-08-23 [1] CRAN (R 3.5.0)
later 0.8.0 2019-02-11 [1] CRAN (R 3.5.2)
lattice 0.20-38 2018-11-04 [1] CRAN (R 3.5.2)
lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.5.2)
lubridate * 1.7.4 2018-04-11 [1] CRAN (R 3.5.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.0)
memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.0)
V mime 0.6 2019-06-11 [1] CRAN (R 3.5.2)
modelr 0.1.4 2019-02-18 [1] CRAN (R 3.5.2)
munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.0)
nlme 3.1-140 2019-05-12 [1] CRAN (R 3.5.2)
openssl 1.4.1 2019-07-18 [1] CRAN (R 3.5.2)
packrat 0.5.0 2018-11-14 [1] CRAN (R 3.5.1)
pillar 1.4.2 2019-06-29 [1] CRAN (R 3.5.2)
pkgbuild 1.0.3 2019-03-20 [1] CRAN (R 3.5.2)
pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.0)
pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.0)
plotly * 4.9.0 2019-04-10 [1] CRAN (R 3.5.2)
prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.0)
processx 3.3.1 2019-05-08 [1] CRAN (R 3.5.2)
promises 1.0.1 2018-04-13 [1] CRAN (R 3.5.0)
ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.0)
purrr * 0.3.2 2019-03-15 [1] CRAN (R 3.5.2)
R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.2)
V Rcpp 1.0.1 2019-07-25 [1] CRAN (R 3.5.2)
readr * 1.3.1 2018-12-21 [1] CRAN (R 3.5.0)
readxl 1.3.1 2019-03-13 [1] standard (@1.3.1)
remotes 2.0.4 2019-04-10 [1] CRAN (R 3.5.2)
V rlang 0.4.0.9000 2019-08-22 [1] Github (r-lib/rlang@09fbc86)
rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.0)
rscloud 0.0.0.9000 2019-07-08 [1] local
rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.5.2)
rvest 0.3.4 2019-05-15 [1] CRAN (R 3.5.2)
sass 0.1.1 2019-07-05 [1] Github (rstudio/sass@57c6e58)
scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.0)
shiny 1.3.2 2019-04-22 [1] CRAN (R 3.5.2)
stringi 1.4.3 2019-03-12 [1] CRAN (R 3.5.2)
stringr * 1.4.0 2019-02-10 [1] CRAN (R 3.5.2)
testthat * 2.1.1 2019-04-23 [1] CRAN (R 3.5.2)
tibble * 2.1.3 2019-06-06 [1] CRAN (R 3.5.2)
tidyr * 0.8.3 2019-03-01 [1] CRAN (R 3.5.2)
tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.0)
tidyverse * 1.2.1 2017-11-14 [1] CRAN (R 3.5.0)
usethis * 1.5.0 2019-04-07 [1] CRAN (R 3.5.2)
utf8 1.1.4 2018-05-24 [1] CRAN (R 3.5.0)
V vctrs 0.2.0.9000 2019-08-22 [1] Github (r-lib/vctrs@6701f78)
viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.5.0)
vroom * 1.0.1 2019-05-14 [1] CRAN (R 3.5.2)
withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.0)
xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.0)
xtable 1.8-4 2019-04-21 [1] CRAN (R 3.5.2)
yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.0)
zeallot 0.1.0 2018-01-28 [1] CRAN (R 3.5.0)
[1] /Library/Frameworks/R.framework/Versions/3.5/Resources/library
V ── Loaded and on-disk version mismatch.
The text was updated successfully, but these errors were encountered: