API insufficient permission
inespereda opened this issue · 1 comments
Hi Mark,
I am completely new to Google Cloud Engine and fairly new to R. I just need more RAM to run some R scripts on remotely sensed ecological data. I've been following your guidelines but I'm getting this error when trying to set the VM.
This is my code so far.
#------------------------------------------
library(googleComputeEngineR)
key <- "C:/project/tordo.JSON"
zone <- "australia-southeast1-a"
project <- "tordo"
Sys.setenv(GCE_AUTH_FILE = key,
GCE_DEFAULT_ZONE = zone,
GCE_DEFAULT_PROJECT_ID = project )
gce_global_project(project) #ok
gce_global_zone(zone) #ok
vm <- gce_vm(template = "rstudio",
name = "inesrstudio",
username = "ines",
pasword = "flavus****",
predefined_type = "n1-highmem-2")
#--------------------------------------------------------
I've set the .Renviron at the R home directory as:
GCE_AUTH_FILE= "C:/project/tordo.JSON"
GCE_DEFAULT_ZONE = "australia-southeast1-a"
GCE_DEFAULT_PROJECT_ID = "tordo"
----------------------------------------------------
This is how I run it and the error.
library(googleComputeEngineR)
gce_global_project(project)
2020-04-26 17:30:21> Set default project name to 'tordo' #just checking
gce_global_zone(zone)
Set default zone name to 'australia-southeast1-a' #just checking
vm <- gce_vm(template = "rstudio",
-
name = "r-studio-server",
-
username = "ines",
-
pasword = "flavus***",
-
predefined_type = "n1-highmem-2")
2020-04-26 17:30:34> No authorization yet in this session!
2020-04-26 17:30:34> No .httr-oauth file exists in current working directory. Do library authentication steps to provide credentials.
Error: Invalid token
-
My session info -------------------------------------------------------------
setting value
version R version 3.6.3 (2020-02-29)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate English_Australia.1252
ctype English_Australia.1252
tz Australia/Perth
date 2020-04-26 -
Packages -----------------------------------------------------------------
package * version date lib
assertthat 0.2.1 2019-03-21 [1]
backports 1.1.5 2019-10-02 [1]
callr 3.4.2 2020-02-12 [1]
cli 2.0.2 2020-02-28 [1]
codetools 0.2-16 2018-12-24 [2]
crayon 1.3.4 2017-09-16 [1]
desc 1.2.0 2018-05-01 [1]
devtools 2.2.2 2020-02-17 [1]
digest 0.6.25 2020-02-23 [1]
ellipsis 0.3.0 2019-09-20 [1]
fansi 0.4.1 2020-01-08 [1]
fs 1.3.2 2020-03-05 [1]
future 1.17.0 2020-04-18 [1]
gargle 0.4.0 2019-10-04 [1]
globals 0.12.5 2019-12-07 [1]
glue 1.3.2 2020-03-12 [1]
googleAuthR 1.1.1 2019-09-09 [1]
googleComputeEngineR * 0.3.0.9000 2020-04-26 [1]
httr 1.4.1 2019-08-05 [1]
jsonlite 1.6.1 2020-02-02 [1]
listenv 0.8.0 2019-12-05 [1]
magrittr 1.5 2014-11-22 [1]
memoise 1.1.0 2017-04-21 [1]
pkgbuild 1.0.6 2019-10-09 [1]
pkgload 1.0.2 2018-10-29 [1]
prettyunits 1.1.1 2020-01-24 [1]
processx 3.4.2 2020-02-09 [1]
ps 1.3.2 2020-02-13 [1]
R6 2.4.1 2019-11-12 [1]
Rcpp 1.0.3 2019-11-08 [1]
remotes 2.1.1.9000 2020-03-25 [1]
rlang 0.4.5 2020-03-01 [1]
rprojroot 1.3-2 2018-01-03 [1]
rstudioapi 0.11 2020-02-07 [1]
sessioninfo 1.1.1 2018-11-05 [1]
testthat 2.3.2 2020-03-02 [1]
usethis 1.5.1 2019-07-04 [1]
withr 2.1.2 2018-03-15 [1]
source
CRAN (R 3.6.1)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
Github (cloudyr/googleComputeEngineR@5b23366)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
Github (r-lib/remotes@e8c60b4)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.3)
CRAN (R 3.6.1)
[1] C:/Users/ines_/Documents/R/win-library/3.6
[2] C:/Program Files/R/R-3.6.3/library
------------------------------------------------------------------
I don't understand If I need to get credentials and API for the GoogleAnalyticsR package before doing all of this or it has nothing to do with it. I'm just overwhelmed and lost at this point.
Hope you can help me and many thanks in advance.
Ines.
I'm sorry I missed this as its on my blog repo, if still an issue please reopen in the googleAnalyticsR issues.