Problem with authentication with drive_auth for googledrive library

I posted the same issue also here: https://github.com/tidyverse/googledrive/issues/276

I have some code that it used to run correctly until one week ago but not when I try to get data from googledrive I get the following error:

createTcpServer: address already in use 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.

Therefore I run the following again:
drive_auth(use_oob=TRUE)
but when I restart the session or knit a rmd document then I get again the above error.

Then I run the following:
options(gargle_quiet = FALSE)
drive_auth(use_oob=TRUE)
and this is the result:

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
no matching token in the cache

putting token into the cache

I also tried the same in Rstudio with a mac and the result is the same.

Do you have any suggestions how to solve it?

I was doing a similar thing recently. I tried googlesheets but ended up using dropbox (rdrop2). I seem to remember there was some interactive way to get the credentials.

Shiny - Persistent data storage in Shiny apps

Did you save the credentials in your project working directory?

The issue was solved here:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.