Gmailr, authendication problem in one host but not others

85 Views Asked by At

gmailr authentication fails, after a fresh installation of Debian, only on one of my systems.

I have a script that run fine on two remote machines, but fails on my local machine.

I use this for authentication:

gm_auth_configure(path  = "~/.credentials_main_mail.json")
gm_auth(email = "[email protected]",
        cache = "~/.secret_main_mail")

print(gm_profile())

On my local machine, I get the error:

Error: Can't get Google credentials.
Are you running gmailr in a non-interactive session? Consider:
  * Call `gm_auth()` directly with all necessary specifics.

I have tried interactive with Rstudio and R console, with the same result.

All scripts and credentials are always on sync between machines using unison. And all worked fine as cron jobs, before the new installation.

Does anyone have any idea on how to investigate further the problem or solve it?

1

There are 1 best solutions below

0
On

I made it to work again, but I don't understand why, as I didn't have to do that on my other systems.

I used an answer from this stackoverflow question.

I used:

rappdirs::user_cache_dir("gargle")
library("gargle")
gargle_oauth_sitrep()

If someone has a short explanation, please enlighten me!