Skip to content

Problem with gs4_auth() and gs4_deauth() #305

Open
@toxintoxin

Description

@toxintoxin

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 returns Authentication complete. Please close this page and return to R. Then, in the console, it returns

> library(googlesheets4)
> options(gargle_oauth_cache = ".secrets")
> gs4_auth()
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
Authentication complete.
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.
> rlang::last_trace()
<error/googlesheets4_error>
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>
---
Backtrace:
    ▆
 1. └─googlesheets4::gs4_auth()
Run rlang::last_trace(drop = FALSE) to see 3 hidden frames.
> rlang::last_trace(drop = FALSE)
<error/googlesheets4_error>
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>
---
Backtrace:
    ▆
 1. └─googlesheets4::gs4_auth()
 2.   └─googlesheets4:::gs4_abort(...)
 3.     └─cli::cli_abort(...)
 4.       └─rlang::abort(...)

I tried any answer on stackoverflow, all failed, nothing changed.

  1. update curl
  2. update gargle
  3. install googlesheets4 from github

Furthermore, gs_deauth() even also didn't work

> gs4_deauth()
> ss <- "https://docs.google.com/spreadsheets/d/1Cw9YSvzsGW5JDFptZ4-qVE0veNthwU3lxsZErk1So5E/edit?usp=sharing"
> dat <- read_sheet(ss)
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Timeout was reached: [sheets.googleapis.com] Failed to connect to sheets.googleapis.com port 443 after 10009 ms: Timeout was reached

Is it possible that this is due to the internet? I'm in China and I'm using SSR

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions