Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping token checks as the option googleAuthR.skip_token_checks is set #183

Closed
RightChain opened this issue Aug 30, 2023 · 5 comments · Fixed by #189
Closed

Skipping token checks as the option googleAuthR.skip_token_checks is set #183

RightChain opened this issue Aug 30, 2023 · 5 comments · Fixed by #189

Comments

@RightChain
Copy link

I've just started to get the above error as of yesterday. I had a stable setup before this. The issue appears inside a docker container built off of rocker/r-ver:4.2.1. I've attempted to update my version of R to the latest (4.3.1) and this seems to fix it for Windows RStudio but not the docker container. The docker container built off of rocker/r-ver:4.3.1 is having the exact same issue. All versions listed below are consistent between Windows and the Docker container.

My process/checklist:

  1. I authenticate using a service token.
  2. My .Renviron GCS_AUTH_FILE points to the correct location for the service token.
  3. I was running R version 4.2.1 and have now updated to 4.3.1.
  4. I install googleAuthR (v 2.0.1) successfully
  5. I am installing googleCloudStorageR (v 0.7.0.9000) using the following command
    remotes::install_github('cloudyr/googleCloudStorageR', upgrade='never')
  6. I receive the following message on package load (library(googleCloudStorageR)):
Loading required package: googleCloudStorageR
✔ Setting scopes to https://www.googleapis.com/auth/devstorage.full_control and https://www.googleapis.com/auth/cloud-platform
✔ Successfully auto-authenticated via ******.json

7). I attempt to download a file and receive the following messages while it tries to download:

ℹ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6
ℹ 2023-08-30 15:14:49.920507 > Skipping token checks as the option `googleAuthR.skip_token_checks` is set
ℹ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6
ℹ 2023-08-30 15:14:49.928946 > Skipping token checks as the option `googleAuthR.skip_token_checks` is set
ℹ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6
ℹ 2023-08-30 15:14:49.939348 > Skipping token checks as determined from the execution context and options
ℹ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6
ℹ 2023-08-30 15:14:50.107606 > Request Status Code:  401
ℹ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6
✖ Downloading 54133B5339B118D31687E774E6AF241CEC5B19209C373A9BAD1F9CEED9673BE6 …

Any thoughts as to where this is coming from?

@MarkEdmondson1234
Copy link
Collaborator

If it was stable before I guess a library update, could you report the sessionInfo() from the breaking version.

Short term fix would be to use a fixed earlier version (older Docker image?) if you could also report the sessionInfo() from the latest version that works ok it will help a lot to pin point the difference.

@MarkEdmondson1234
Copy link
Collaborator

I see you are installing from GitHub which is unstable, is the CRAN version ok?

@RightChain
Copy link
Author

The CRAN version is stable and gives the following session info

R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] tools     stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
 [1] RightChainAlgorithms_0.9.0 geosphere_1.5-18
 [3] RightChainUtils_0.1.0      jsTreeR_2.3.2
 [5] sortable_0.5.0             stringi_1.7.12
 [7] lubridate_1.9.2            jsonlite_1.8.7
 [9] googleCloudStorageR_0.7.0  DBI_1.1.3
[11] RPostgres_1.4.5            dplyr_1.1.2
[13] RColorBrewer_1.1-3         data.table_1.14.8
[15] shinybusy_0.3.1            shinyWidgets_0.7.6
[17] shinyBS_0.61.1             shinyjs_2.1.0
[19] shiny_1.7.5                writexl_1.4.2
[21] readxl_1.4.3               rlang_1.1.1

loaded via a namespace (and not attached):
 [1] xfun_0.40         bslib_0.5.1       learnr_0.11.4     htmlwidgets_1.6.2
 [5] lattice_0.21-8    gargle_1.5.2      vctrs_0.6.3       generics_0.1.3
 [9] curl_5.0.2        tibble_3.2.1      fansi_1.0.4       blob_1.2.4
[13] R.oo_1.25.0       pkgconfig_2.0.3   assertthat_0.2.1  lifecycle_1.0.3
[17] compiler_4.3.1    fontawesome_0.5.2 httpuv_1.6.11     htmltools_0.5.6
[21] sass_0.4.7        yaml_2.3.7        later_1.3.1       pillar_1.9.0
[25] jquerylib_0.1.4   R.utils_2.12.2    ellipsis_0.3.2    openssl_2.1.0
[29] cachem_1.0.8      mime_0.12         googleAuthR_2.0.1 tidyselect_1.2.0
[33] zip_2.3.0         digest_0.6.33     grid_4.3.1        rprojroot_2.0.3
[37] fastmap_1.1.1     cli_3.6.1         magrittr_2.0.3    base64enc_0.1-3
[41] utf8_1.2.3        withr_2.5.0       promises_1.2.1    sp_2.0-0
[45] bit64_4.0.5       timechange_0.2.0  httr_1.4.7        bit_4.0.5
[49] cellranger_1.1.0  R.methodsS3_1.8.2 askpass_1.1       hms_1.1.3
[53] memoise_2.0.1     evaluate_0.21     knitr_1.43        miniUI_0.1.1.1
[57] Rcpp_1.0.11       shinyAce_0.4.2    xtable_1.8-4      glue_1.6.2
[61] rstudioapi_0.15.0 R6_2.5.1          fs_1.6.3

The unstable session info is the following

R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] tools     stats     graphics  grDevices utils     datasets  methods
[8] base

other attached packages:
 [1] RightChainAlgorithms_0.9.0     geosphere_1.5-18
 [3] RightChainUtils_0.1.0          jsTreeR_2.3.2
 [5] sortable_0.5.0                 stringi_1.7.12
 [7] lubridate_1.9.2                jsonlite_1.8.7
 [9] googleCloudStorageR_0.7.0.9000 DBI_1.1.3
[11] RPostgres_1.4.5                dplyr_1.1.2
[13] RColorBrewer_1.1-3             data.table_1.14.8
[15] shinybusy_0.3.1                shinyWidgets_0.7.6
[17] shinyBS_0.61.1                 shinyjs_2.1.0
[19] shiny_1.7.5                    writexl_1.4.2
[21] readxl_1.4.3                   rlang_1.1.1

loaded via a namespace (and not attached):
 [1] xfun_0.40         bslib_0.5.1       learnr_0.11.4     htmlwidgets_1.6.2
 [5] lattice_0.21-8    gargle_1.5.2      vctrs_0.6.3       generics_0.1.3
 [9] curl_5.0.2        tibble_3.2.1      fansi_1.0.4       blob_1.2.4
[13] R.oo_1.25.0       pkgconfig_2.0.3   assertthat_0.2.1  lifecycle_1.0.3
[17] compiler_4.3.1    fontawesome_0.5.2 httpuv_1.6.11     htmltools_0.5.6
[21] sass_0.4.7        yaml_2.3.7        later_1.3.1       pillar_1.9.0
[25] jquerylib_0.1.4   R.utils_2.12.2    ellipsis_0.3.2    openssl_2.1.0
[29] cachem_1.0.8      mime_0.12         googleAuthR_2.0.1 tidyselect_1.2.0
[33] zip_2.3.0         digest_0.6.33     grid_4.3.1        rprojroot_2.0.3
[37] fastmap_1.1.1     cli_3.6.1         magrittr_2.0.3    base64enc_0.1-3
[41] utf8_1.2.3        withr_2.5.0       promises_1.2.1    sp_2.0-0
[45] bit64_4.0.5       timechange_0.2.0  httr_1.4.7        bit_4.0.5
[49] cellranger_1.1.0  R.methodsS3_1.8.2 askpass_1.1       hms_1.1.3
[53] memoise_2.0.1     evaluate_0.21     knitr_1.43        miniUI_0.1.1.1
[57] Rcpp_1.0.11       shinyAce_0.4.2    xtable_1.8-4      glue_1.6.2
[61] rstudioapi_0.15.0 R6_2.5.1          fs_1.6.3

@MarkEdmondson1234
Copy link
Collaborator

So this isn't an error message in itself, its telling you the authentication checks are not being done because a direct download is happening, that is necessary sometimes. But then because those checks are not being done, when you get a 401 unauthenticated error its later than would happen normally.

Could you report the logs and the command you are using with this option on:

options(googleAuthR.verbose=2)

@manuteleco
Copy link
Contributor

Hi @RightChain, I introduced the googleAuthR.skip_token_checks option recently (MarkEdmondson1234/googleAuthR#228) to support storage emulators in this library (#177).

Is it possible you are providing a STORAGE_EMULATOR_HOST environment variable somehow? That's what, in theory, turns off authentication checks (i.e., sets skip_token_checks to TRUE).

But if you are not, it sounds like a bug in the implementation. In that case, the extra information @MarkEdmondson1234 asked for can help us figure out what's wrong and come up with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants