Open toxintoxin opened 11 months ago
The experience and code you show above ... is that during the initial phase, where you are trying to get your first token? I.e. you are still working locally and interactively.
Or does it describe something that's happening on the server where you hope to deploy this app?
Regardless, you should read this article on some things you can do while troubleshooting auth, so that you get more information.
Yes, I ran into trouble almost at the beginning, and I run the above code locally.
I got these after set op <- options(gargle_verbosity = "debug")
, without open a browser
trying `token_fetch()`
Trying `credentials_byo_oauth()` ...
Error caught by `token_fetch()`:
inherits(token, "Token2.0") is not TRUE
trying `credentials_service_account()`
Error caught by `token_fetch()`:
Argument 'txt' must be a JSON string, URL or file.
trying `credentials_external_account()`
aws.ec2metadata not installed; can't detect whether running on EC2 instance
trying `credentials_app_default()`
Trying `credentials_gce()` ...
✖ We don't seem to be on GCE.
trying `credentials_user_oauth2()`
attempt to access internal gargle data from: googlesheets4
Gargle2.0 initialize
adding "userinfo.email" scope
loading token from the cache
Error caught by `token_fetch()`:
attempt to set an attribute on NULL
Error in `gs4_auth()`:
! Can't get Google credentials.
ℹ Are you running googlesheets4 in a non-interactive session? Consider:
• Call `gs4_deauth()` to prevent the attempt to get credentials.
• Call `gs4_auth()` directly with all necessary specifics.
ℹ See gargle's "Non-interactive auth" vignette for more details:
ℹ <https://gargle.r-lib.org/articles/non-interactive-auth.html>
Run `rlang::last_trace()` to see where the error occurred.
Yes, I ran into trouble almost at the beginning
Can you be extremely precise? Have you ever successfully gotten a token as an interactive user?
I'm trying to reconcile what you're saying with this:
loading token from the cache
which suggests a token is already in the cache (?)
This is the first time I've used your package and I've never been successful.
Because I learned that googlesheets4
is probably the most convenient persistent data storage work flow with shinyapps.io, and after much googling I found https://stackoverflow.com/a/70215575/22331901 this guide to be the most reliable. I started directly based on it. Then
> install.packages("googlesheets4")
> library(googlesheets4)
> options(gargle_oauth_cache = ".secrets")
> gs4_auth()
Then I ran into the trouble I mentioned and I started struggling with it.
I have checked, nothing in /.secrets
> list.files("/.secrets")
character(0)
And I have never got a token, that folder is empty
> gargle_oauth_sitrep()
ℹ Reporting the default cache location.
0 tokens found in this gargle OAuth cache:
C:/Users/someo/AppData/Local/gargle/gargle/Cache
I would recommend trying to use the package interactively, taking no control of auth, and seeing if the entry-level flow works. But I am beginning to suspect it's related to this:
Is it possible that this is due to the internet? I'm in China and I'm using SSR
Thank you for your help, it is indeed a network problem, I tried different nodes and they all failed until I switched to another service provider
I deployed the folder .secrets
to shinyapps.io along with my app.R
. Although I can access shinyapps.io in China but I can't seem to complete the authorization, which is really annoying and I can't ask all my colleagues to master the ability to access google. :(
Sorry, this is my first time using your package, and I found some guide for myself, but I meet a primary trouble that I can't get into my google sheet.
My ultimate goal is to deploy the app on shinyapps.io, and everyone without google account could edit my Google sheet.
First, I follow this guide https://stackoverflow.com/a/70215575/22331901, it seems to meets my requirement.
But, I failed in
gs4_auth()
, it did open my edge, and edge returnsAuthentication complete. Please close this page and return to R.
Then, in the console, it returnsI tried any answer on stackoverflow, all failed, nothing changed.
curl
gargle
googlesheets4
from githubFurthermore,
gs_deauth()
even also didn't workIs it possible that this is due to the internet? I'm in China and I'm using SSR