r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
668 stars 146 forks source link

Evaluation error: google.auth.exceptions.RefreshError #346

Open barrakat opened 1 year ago

barrakat commented 1 year ago

At submit an issue, please attached the following information of your rgee session:

library(rgee)

# Initialize the Earth Engine module.
ee_Initialize()

── rgee 1.1.5 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── earthengine-api 0.1.367 ── 
 ✔ user: not_defined
 ✔ Initializing Google Earth Engine:Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})
Run `reticulate::py_last_error()` for details.

Attach your Python (reticulate) configuration:

library(reticulate)
py_config()

python:         /gpfs1/schlecker/home/barrasso/.local/share/r-miniconda/envs/r-reticulate/bin/python
libpython:      /gpfs1/schlecker/home/barrasso/.local/share/r-miniconda/envs/r-reticulate/lib/libpython3.9.so
pythonhome:     /gpfs1/schlecker/home/barrasso/.local/share/r-miniconda/envs/r-reticulate:/gpfs1/schlecker/home/barrasso/.local/share/r-miniconda/envs/r-reticulate
version:        3.9.18 | packaged by conda-forge | (main, Aug 30 2023, 03:49:32)  [GCC 12.3.0]
numpy:           [NOT FOUND]
ee:             /gpfs1/schlecker/home/barrasso/.local/share/r-miniconda/envs/r-reticulate/lib/python3.9/site-packages/ee

Description

ee_Authenticate() works but ee_Initialize() doesn't, and I don't know what's wrong

What I Did

library(rgee)
ee_Initialize()

── rgee 1.1.5 ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── earthengine-api 0.1.367 ── 
 ✔ user: not_defined
 ✔ Initializing Google Earth Engine:Error in py_call_impl(callable, call_args$unnamed, call_args$named) : 
  google.auth.exceptions.RefreshError: ('invalid_grant: Bad Request', {'error': 'invalid_grant', 'error_description': 'Bad Request'})
Run `reticulate::py_last_error()` for details.
ricds commented 11 months ago

After a few years without using rgee, I tried installing it to run some codes, and got the same error on my machine. See picture below.

image

csaybar commented 11 months ago

Hi seems like the credentials expired. you can easily get new ones with ee_Authenticate. Let me know if that works!

ricds commented 11 months ago

authenticate gives me this error

image

csaybar commented 11 months ago

Hi @ricds can u upgrade your rgee version using GH. New rgee version use 'notebook' rather than 'gcloud' to auth (similar to geemap).

remotes::install_github("r-spatial/rgee")