rdrop2 icon indicating copy to clipboard operation
rdrop2 copied to clipboard

drop_delete with saved token fails in cloud

Open samfield opened this issue 9 years ago • 1 comments

Encountered unexpected behavior with running the following code:

#token_drop <- drop_auth() #initialized in first run
#saveRDS(token_drop, "/path/to/droptoken.rds")
token_drop <- readRDS("/path/to/droptoken.rds")
drop_acc(dtoken=token_drop, verbose = TRUE)
#get a list of items in the directory
data <- drop_dir("/list/items", dtoken = token_drop)
#get the first item on the drop box list
drop_get(as.character(data[1,1]),local_file = "dt_items.Rdata" ,dtoken = token_drop, overwrite = TRUE)
#load the data.table to environment
load(paste0(getwd(),"/dt_items.Rdata"))
#remove the local file
file.remove(paste0(getwd(),"/dt_items.Rdata"))
#remove the dropbox file
drop_delete(as.character(data[1,1]), dtoken = token_drop)

The drop_dir and drop_get run without starting the oauth flow Expected.

drop_delete always causes browser to open a window for oauth flow. Unexpected. Shouldn't this follow suit with drop_get and not start the oauth because token is provided?

Happens with dev and cran version. EDIT:And added bonus is that I run R in Google Cloud


> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Debian GNU/Linux 8 (jessie)
> 
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8       
>  [4] LC_COLLATE=en_US.UTF-8     LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
> [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
> 
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base     
> 
> other attached packages:
> [1] dplyr_0.4.3          rdrop2_0.7           data.table_1.9.6     bigrquery_0.1.0.9000
> [5] httr_1.1.0.9000      PKI_0.1-3            base64enc_0.1-3     
> 
> loaded via a namespace (and not attached):
>  [1] Rcpp_0.12.4     digest_0.6.9    withr_1.0.1     assertthat_0.1  chron_2.3-47    R6_2.1.2       
>  [7] jsonlite_0.9.19 DBI_0.4         git2r_0.13.1    magrittr_1.5    lazyeval_0.1.10 curl_0.9.7     
> [13] devtools_1.11.1 tools_3.2.3     httpuv_1.3.3    parallel_3.2.3  memoise_1.0.0   openssl_0.9.2  
> > library(devtools)
> > session_info()
> Session info ----------------------------------------------------------------------------------------------
>  setting  value                       
>  version  R version 3.2.3 (2015-12-10)
>  system   x86_64, linux-gnu           
>  ui       RStudio (0.99.491)          
>  language (EN)                        
>  collate  en_US.UTF-8                 
>  tz       <NA>                        
>  date     2016-05-02                  
> 
> Packages --------------------------------------------------------------------------------------------------
>  package    * version    date       source                              
>  assertthat   0.1        2013-12-06 CRAN (R 3.2.3)                      
>  base64enc  * 0.1-3      2015-07-28 CRAN (R 3.2.3)                      
>  bigrquery  * 0.1.0.9000 2016-02-27 Github (rstats-db/bigrquery@2866909)
>  chron        2.3-47     2015-06-24 CRAN (R 3.2.3)                      
>  curl         0.9.7      2016-04-10 CRAN (R 3.2.3)                      
>  data.table * 1.9.6      2015-09-19 CRAN (R 3.2.3)                      
>  DBI          0.4        2016-05-02 CRAN (R 3.2.3)                      
>  devtools   * 1.11.1     2016-04-21 CRAN (R 3.2.3)                      
>  digest       0.6.9      2016-01-08 CRAN (R 3.1.1)                      
>  dplyr      * 0.4.3      2015-09-01 CRAN (R 3.2.3)                      
>  git2r        0.13.1     2015-12-10 CRAN (R 3.2.3)                      
>  httpuv       1.3.3      2015-08-04 CRAN (R 3.2.3)                      
>  httr       * 1.1.0.9000 2016-04-28 Github (hadley/httr@7261a52)        
>  jsonlite     0.9.19     2015-11-28 CRAN (R 3.2.3)                      
>  lazyeval     0.1.10     2015-01-02 CRAN (R 3.2.3)                      
>  magrittr     1.5        2014-11-22 CRAN (R 3.1.1)                      
>  memoise      1.0.0      2016-01-29 CRAN (R 3.2.3)                      
>  openssl      0.9.2      2016-02-26 CRAN (R 3.2.3)                      
>  PKI        * 0.1-3      2015-07-28 CRAN (R 3.2.3)                      
>  R6           2.1.2      2016-01-26 CRAN (R 3.2.3)                      
>  Rcpp         0.12.4     2016-03-26 CRAN (R 3.2.3)                      
>  rdrop2     * 0.7        2016-05-02 Github (karthik/rdrop2@15e59ef)     
>  withr        1.0.1      2016-02-04 CRAN (R 3.2.3)  

samfield avatar May 02 '16 13:05 samfield

Hi @samfield, I am facing the same issue with drop_create() on RStudio Server. drop_get() and other functions work fine but drop_create() starts oauth. However, this doesn't happen with RStudio desktop. Let me know if you have found any solution around this. TIA.

nadeem-mojo avatar Jul 12 '17 12:07 nadeem-mojo