BioinformaticsFMRP / TCGAbiolinks

TCGAbiolinks
http://bioconductor.org/packages/devel/bioc/vignettes/TCGAbiolinks/inst/doc/index.html
293 stars 112 forks source link

GDCquery failes due to GnuTLS error #220

Closed katosh closed 6 years ago

katosh commented 6 years ago

The call GDCquery_clinic("TCGA-PRAD") fails with the message

Error in getURL(url, GET, timeout(600)) : 'getURL()' failed:                                                                                                                                    
  URL: https://gdc-api.nci.nih.gov/cases/?pretty=true&expand=diagnoses,diagnoses.treatments,annotations,family_histories,demographic,exposures&size=500&filters=%7B%22op%22:%22and%22,%22content%22:[%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22cases.project.project_id%22,%22value%22:[%22TCGA-PRAD%22]%7D%7D,%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22files.data_category%22,%22value%22:[%22Clinical%22]%7D%7D]%7D&format=json                                                                                                       
  error: GnuTLS recv error (-110): The TLS connection was non-properly terminated.

@SethosII and I replaced libcurl4-gnutls-dev with libcurl4-openssl-dev, recompiled curl (--with-ssl), RCurl and TCGAbiolinks but still receive the same error.

We use R version 3.4.3 (2017-11-30) compiled with

CFLAGS="-O3 -march=corei7 -mtune=core-avx-i" CPPFLAGS=$CFLAGS CXXFLAGS=$CFLAGS FFLAGS=$CFLAGS FCFLAGS=$CFLAGS ./configure --prefix=/modules/R/3.4.3-0 --with-lapack --with-blas --enable-R-shlib --enable-R-static-lib --without-recommended-packages

and sessionInfo() gives

R version 3.4.3 (2017-11-30)                                                                                                                                                                                                                                                    
Platform: x86_64-pc-linux-gnu (64-bit)                                                                                                                                                                                                                                          
Running under: Ubuntu 16.04.3 LTS            

Matrix products: default                       
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0  
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.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

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

other attached packages:
[1] TCGAbiolinks_2.9.0 prettycode_1.0.1  

loaded via a namespace (and not attached):
  [1] colorspace_1.3-2            selectr_0.3-2              
  [3] rjson_0.2.15                hwriter_1.3.2              
  [5] circlize_0.4.3              XVector_0.18.0             
  [7] GenomicRanges_1.30.2        GlobalOptions_0.0.13       
  [9] ggpubr_0.1.6                matlab_1.0.2               
 [11] ggrepel_0.8.0               bit64_0.9-7                
 [13] AnnotationDbi_1.40.0        xml2_1.2.0                 
 [15] codetools_0.2-15            splines_3.4.3              
 [17] R.methodsS3_1.7.1           mnormt_1.5-5               
 [19] doParallel_1.0.11           DESeq_1.30.0               
 [21] geneplotter_1.56.0          knitr_1.20                 
 [23] jsonlite_1.5                Rsamtools_1.30.0           
 [25] km.ci_0.5-2                 broom_0.4.3                
 [27] annotate_1.56.1             cluster_2.0.6              
 [29] R.oo_1.21.0                 readr_1.1.1                
 [31] compiler_3.4.3              httr_1.3.1                 
 [33] assertthat_0.2.0            Matrix_1.2-12              
 [35] lazyeval_0.2.1              limma_3.34.8               
 [37] prettyunits_1.0.2           tools_3.4.3                
 [39] bindrcpp_0.2                gtable_0.2.0               
 [41] glue_1.2.0                  GenomeInfoDbData_1.0.0     
 [43] reshape2_1.4.3              dplyr_0.7.4                
 [45] ggthemes_3.5.0              ShortRead_1.36.0           
 [47] Rcpp_0.12.15                Biobase_2.38.0             
 [49] Biostrings_2.46.0           nlme_3.1-131.1             
 [51] rtracklayer_1.38.3          iterators_1.0.9            
 [53] psych_1.7.8                 stringr_1.3.0              
 [55] rvest_0.3.2                 XML_3.98-1.10              
 [57] edgeR_3.20.8                zoo_1.8-1                  
 [59] zlibbioc_1.24.0             scales_0.5.0               
 [61] aroma.light_3.8.0           hms_0.4.1                  
 [63] parallel_3.4.3              SummarizedExperiment_1.8.1 
 [65] RColorBrewer_1.1-2          ComplexHeatmap_1.17.1      
 [67] memoise_1.1.0               gridExtra_2.3              
 [69] KMsurv_0.1-5                ggplot2_2.2.1              
 [71] downloader_0.4              biomaRt_2.34.2             
 [73] latticeExtra_0.6-28         stringi_1.1.6              
 [75] RSQLite_2.0                 genefilter_1.60.0          
 [77] S4Vectors_0.16.0            foreach_1.4.4              
 [79] RMySQL_0.10.13              GenomicFeatures_1.30.3     
 [81] BiocGenerics_0.24.0         BiocParallel_1.12.0        
 [83] shape_1.4.4                 GenomeInfoDb_1.14.0        
 [85] rlang_0.2.0                 pkgconfig_2.0.1            
 [87] matrixStats_0.53.1          bitops_1.0-6               
 [89] lattice_0.20-35             purrr_0.2.4                
 [91] bindr_0.1                   cmprsk_2.2-7               
 [93] GenomicAlignments_1.14.1    bit_1.1-12                 
 [95] plyr_1.8.4                  magrittr_1.5               
 [97] R6_2.2.2                    IRanges_2.12.0             
 [99] DelayedArray_0.4.1          DBI_0.7                    
[101] mgcv_1.8-23                 foreign_0.8-69             
[103] pillar_1.1.0                withr_2.1.1                
[105] survival_2.41-3             RCurl_1.95-4.10            
[107] tibble_1.4.2                EDASeq_2.12.0              
[109] crayon_1.3.4                survMisc_0.5.4             
[111] GetoptLong_0.1.6            progress_1.1.2             
[113] locfit_1.5-9.1              grid_3.4.3                 
[115] sva_3.26.0                  data.table_1.10.4-3        
[117] blob_1.1.0                  ConsensusClusterPlus_1.42.0
[119] digest_0.6.15               xtable_1.8-2               
[121] tidyr_0.8.0                 R.utils_2.6.0              
[123] stats4_3.4.3                munsell_0.4.3              
[125] survminer_0.4.2            

Debugging reveled that the error originates from this C function call:

debugging in: curl::curl_fetch_memory(url, handle = handle)
debug: {
    nonblocking <- isTRUE(getOption("curl_interrupt", TRUE))
    output <- .Call(R_curl_fetch_memory, enc2utf8(url), handle,
        nonblocking)
    res <- handle_data(handle)
    res$content <- output
    res
}
Browse[14]> nonblocking <- isTRUE(getOption("curl_interrupt", TRUE))
Browse[14]> output <- .Call(R_curl_fetch_memory, enc2utf8(url), handle, nonblocking)
Error: GnuTLS recv error (-110): The TLS connection was non-properly terminated.

inspecting the parameters:

Browse[14]> enc2utf8(url)
[1] "https://gdc-api.nci.nih.gov/cases/?pretty=true&expand=diagnoses,diagnoses.treatments,annotations,family_histories,demographic,exposures&size=500&filters=%7B%22op%22:%22and%22,%22content%22:[%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22cases.project.project_id%22,%22value%22:[%22TCGA-PRAD%22]%7D%7D,%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22files.data_category%22,%22value%22:[%22Clinical%22]%7D%7D]%7D&format=json"                                                                                                        
Browse[14]> handle
<curl handle> (https://gdc-api.nci.nih.gov/cases/?pretty=true&expand=diagnoses,diagnoses.treatments,annotations,family_histories,demographic,exposures&size=500&filters=%7B%22op%22:%22and%22,%22content%22:[%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22cases.project.project_id%22,%22value%22:[%22TCGA-PRAD%22]%7D%7D,%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22files.data_category%22,%22value%22:[%22Clinical%22]%7D%7D]%7D&format=json)                                                                                              
Browse[14]> nonblocking
[1] TRUE

How can we resolve this issue?

Edit: The configure call above and also:

> library(RCurl)
> getURL("https://gdc-api.nci.nih.gov/cases/?pretty=true&expand=diagnoses,diagnoses.treatments,annotations,family_histories,demographic,exposures&size=500&filters=%7B%22op%22:%22and%22,%22content%22:[%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22cases.project.project_id%22,%22value%22:[%22TCGA-PRAD%22]%7D%7D,%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22files.data_category%22,%22value%22:[%22Clinical%22]%7D%7D]%7D&format=json")
[1] ""

returns nothing but setting the parameter followlocation = TRUE it works:

> getURL("https://gdc-api.nci.nih.gov/cases/?pretty=true&expand=diagnoses,diagnoses.treatments,annotations,family_histories,demographic,exposures&size=500&filters=%7B%22op%22:%22and%22,%22content%22:[%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22cases.project.project_id%22,%22value%22:[%22TCGA-PRAD%22]%7D%7D,%7B%22op%22:%22in%22,%22content%22:%7B%22field%22:%22files.data_category%22,%22value%22:[%22Clinical%22]%7D%7D]%7D&format=json", followlocation = TRUE)
<the correct json output>
katosh commented 6 years ago

Yes, it works! Thank you for the fix.