0
I am new to programming in R and am trying to run a code R where access google drive and google Earth engine. However, two situations are happening: first on my personal laptop at home I run the code and it works perfectly and doesn’t even open a browser to ask for access permission. In the second case, when I use the remote desktop connection and access the company’s computer, the code cannot get google credentials.
What could it be? will it be related to remote access, package version or something else? follow the data below :
On my personal laptop:
> ## Initialize GEE ----
> ee_Initialize(email = gee_email, drive = TRUE)
-- rgee 1.0.9 ------------------------------------------------------------ earthengine-api 0.1.248 --
√ email: [email protected]
√ Google Drive credentials: FOUND
√ Initializing Google Earth Engine: DONE!
√ Earth Engine user: users/rcode
-----------------------------------------------------------------------------------------------------
Same code on company computer via remote desktop connection:
> ## Initialize GEE ----
> ee_Initialize(email = gee_email, drive = TRUE)
-- rgee 1.0.9 ------------------------------------------------------------------------------- earthengine-api 0.1.263 --
√ email: [email protected]
√ Google Drive credentials:Erro: 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.
* Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html
after executing the commands:
options(gargle_quiet = FALSE)
googledrive::drive_auth("[email protected]")
> trying `token_fetch()`
> trying `credentials_service_account()`
> Error caught by `token_fetch()`:
Argument 'txt' must be a JSON string, URL or file.
> trying `credentials_app_default()`
> trying `credentials_gce()`
> trying `credentials_byo_oauth()`
> Error caught by `token_fetch()`:
inherits(token, "Token2.0") is not TRUE
> trying `credentials_user_oauth2()`
> Gargle2.0 initialize
> attempt to access internal gargle data from: googledrive
> adding 'userinfo.email' scope
> loading token from the cache
> no matching token in the cache
> initiating new token
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
> Error caught by `token_fetch()`:
Failed to connect to accounts.google.com port 443: Timed out
Erro: 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.
* Read more in: https://gargle.r-lib.org/articles/non-interactive-auth.html
Tries to run the same code on your company’s computer, but adds the line
options(gargle_quiet = FALSE)
, before.– John P. S.
Thank you, but it didn’t work. Unfortunately the problem persists. I don’t know what else to do. On github also I did not have much success, people keep saying that the error is in another package. So I’ve passed the Gargle, tydiverse, rgee and googledrive and nothing. tidyverse/googledrive/issues/328 r-Spatial/rgee/issues/152 r-Spatial/rgee/issues/139 r-lib/Gargle/issues/177
– APSFM
when Voce says "remote desktop", it is actually a remote desktop connection (for example, Voce can see the desktop), or it is via SSH?
– John P. S.
Yes, it is a remote connection by windows 10 application " Remote Desktop Connection". On the PC of the company I run Rstudio, it opens the browser, I accept the step by step login, then appears the message to return the R window. But then gives the initial error that I reported.
– APSFM