biomaRT connexion problem make failed my unit tests
0
0
Entering edit mode
ilysR • 0
@ilyessr-23513
Last seen 2.9 years ago
France

Dear community,

I am developing a bioconductor package using biomart. If I want to follow the conventions of bioconductor, I can't download local databases because it would take too much space.

However, I found biomaRt to fail connecting often:

Error in curl::curlfetchmemory(url, handle = handle) : Peer's Certificate issuer is not recognized. This is problematic to pass the R CMD check. What would be your advice to deal with this issue?

Thanks a lot in advance.

biomaRt Peer's Certificate Ensembl • 5.9k views
ADD COMMENT
1
Entering edit mode

To help, can you add the biomaRt commands that you are running

ADD REPLY
1
Entering edit mode

Can you also add the details of sessionInfo() I've noticed that the version of OpenSSL shipped with some Linux distributions doesn't seem to work well with www.ensembl.org and requires some extra configuration, otherwise it generates errors like you're seeing.

ADD REPLY
0
Entering edit mode
> sessionInfo()
R Under development (unstable) (2020-04-29 r78335)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS:   /g/lancrin/People/Ilyess/tools/R-devel-april2020/lib64/R/lib/libRblas.so
LAPACK: /g/lancrin/People/Ilyess/tools/R-devel-april2020/lib64/R/lib/libRlapack.so

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] conclus_0.99.0

loaded via a namespace (and not attached):
  [1] bitops_1.0-6                matrixStats_0.56.0         
  [3] bit64_4.0.5                 doParallel_1.0.15          
  [5] RColorBrewer_1.1-2          progress_1.2.2             
  [7] httr_1.4.2                  prabclus_2.3-2             
  [9] GenomeInfoDb_1.25.11        tools_4.1.0                
 [11] R6_2.4.1                    irlba_2.3.3                
 [13] vipor_0.4.5                 DBI_1.1.0                  
 [15] BiocGenerics_0.35.4         colorspace_1.4-1           
 [17] nnet_7.3-14                 tidyselect_1.1.0           
 [19] gridExtra_2.3               prettyunits_1.1.1          
 [21] bit_4.0.4                   curl_4.3                   
 [23] compiler_4.1.0              factoextra_1.0.7           
 [25] Biobase_2.49.1              BiocNeighbors_1.7.0        
 [27] DelayedArray_0.15.7         diptest_0.75-7             
 [29] scales_1.1.1                DEoptimR_1.0-8             
 [31] robustbase_0.93-6           askpass_1.1                
 [33] rappdirs_0.3.1              stringr_1.4.0              
 [35] digest_0.6.25               dbscan_1.1-5               
 [37] XVector_0.29.3              scater_1.17.4              
 [39] pkgconfig_2.0.3             limma_3.45.13              
 [41] dbplyr_1.4.4                rlang_0.4.7                
 [43] rstudioapi_0.11             RSQLite_2.2.0              
 [45] DelayedMatrixStats_1.11.1   generics_0.0.2             
 [47] mclust_5.4.6                BiocParallel_1.23.2        
 [49] dplyr_1.0.2                 RCurl_1.98-1.2             
 [51] magrittr_1.5                BiocSingular_1.5.0         
 [53] modeltools_0.2-23           GenomeInfoDbData_1.2.3     
 [55] scuttle_0.99.13             Matrix_1.2-18              
 [57] Rcpp_1.0.5                  ggbeeswarm_0.6.0           
 [59] munsell_0.5.0               S4Vectors_0.27.12          
 [61] viridis_0.5.1               lifecycle_0.2.0            
 [63] edgeR_3.31.4                stringi_1.5.3              
 [65] MASS_7.3-52                 SummarizedExperiment_1.19.6
 [67] zlibbioc_1.35.0             flexmix_2.3-15             
 [69] Rtsne_0.15                  BiocFileCache_1.13.1       
 [71] grid_4.1.0                  blob_1.2.1                 
 [73] dqrng_0.2.1                 parallel_4.1.0             
 [75] ggrepel_0.8.2               crayon_1.3.4               
 [77] lattice_0.20-41             hms_0.5.3                  
 [79] locfit_1.5-9.4              pillar_1.4.6               
 [81] igraph_1.2.5                GenomicRanges_1.41.6       
 [83] fpc_2.2-7                   codetools_0.2-16           
 [85] biomaRt_2.45.2              stats4_4.1.0               
 [87] XML_3.99-0.5                glue_1.4.2                 
 [89] scran_1.17.15               vctrs_0.3.4                
 [91] foreach_1.5.0               gtable_0.3.0               
 [93] openssl_1.4.2               purrr_0.3.4                
 [95] kernlab_0.9-29              assertthat_0.2.1           
 [97] ggplot2_3.3.2               rsvd_1.0.3                 
 [99] viridisLite_0.3.0           class_7.3-17               
[101] SingleCellExperiment_1.11.6 tibble_3.0.3               
[103] pheatmap_1.0.12             iterators_1.0.12           
[105] AnnotationDbi_1.51.3        beeswarm_0.2.3             
[107] memoise_1.1.0               IRanges_2.23.10            
[109] cluster_2.1.0               statmod_1.4.34             
[111] bluster_0.99.1              ellipsis_0.3.1 `enter code here`
ADD REPLY
0
Entering edit mode

Hey Mike / ilyessr, I was actually able to replicate the error (well a similar one):

ensembl <- useEnsembl(biomart="genes", dataset="mmusculus_gene_ensembl")
Ensembl site unresponsive, trying useast mirror
Error in curl::curl_fetch_memory(url, handle = handle) : 
  server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

However, I re-ran the command a few moments later, and it connected successfully.

ADD REPLY
0
Entering edit mode

Here are the commands :

ensembl <- useEnsembl(biomart="genes", dataset="mmusculus_gene_ensembl")

db1 <- getBM(attributes=c("uniprot_gn_symbol",  
                "external_gene_name", 
                "description",       
                "entrezgene_description",
                "gene_biotype",       
                "go_id" ),           
        values=genes$geneName,
        filters = "uniprot_gn_symbol", mart=ensembl)

db2 <- getBM(attributes=c("uniprot_gn_symbol", 
                "external_gene_name", 
                "chromosome_name",    
                "ensembl_gene_id",    
                "entrezgene_id", 
                "uniprot_gn_id"),     
        values=genes$geneName,
        filters = "uniprot_gn_symbol", mart=ensembl)
ADD REPLY
0
Entering edit mode

Hi guys,

I had the same problem and the following commands solved the issue, at least for me:

library(httr)

setconfig(config(sslverifypeer = 0L))

https://www.r-bloggers.com/2016/09/fixing-peer-certificate-cannot-be-authenticated/

ADD REPLY
0
Entering edit mode

Thanks for the info. That's actually the solution I've currently gone for in biomaRt (https://github.com/grimbough/biomaRt/blob/a34e372b2c9ab74095b9ae65f9ca00d8f8ad1a7c/R/zzz.R#L25)

If you're still experiencing this problem with the latest version of biomaRt please let me know, as that means my fix isn't working.

ADD REPLY
0
Entering edit mode

Hi Mike,

Sorry but I still have the same problem, sometimes it works, sometimes not.

> biomaRt::useMart("ensembl", dataset="mmusculus_gene_ensembl")
Ensembl site unresponsive, trying uswest mirror
Error in curl::curl_fetch_memory(url, handle = handle) : 
  SSL certificate problem: unable to get local issuer certificate
ADD REPLY
0
Entering edit mode

Can you provide the output from sessionInfo() so I can check what version of R and biomaRt you're using?

ADD REPLY
0
Entering edit mode

Hello, there my sessionInfo() :


    > sessionInfo()
    R Under development (unstable) (2021-01-09 r79815)
    Platform: x86_64-pc-linux-gnu (64-bit)
    Running under: Ubuntu 18.04.5 LTS

    Matrix products: default
    BLAS:   /home/ilyess/tools/R-devel-12-01-2021/lib/R/lib/libRblas.so
    LAPACK: /home/ilyess/tools/R-devel-12-01-2021/lib/R/lib/libRlapack.so

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

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

    other attached packages:
    [1] conclus_0.99.13 httr_1.4.2     

    loaded via a namespace (and not attached):
      [1] tidyselect_1.1.0            RSQLite_2.2.2              
      [3] AnnotationDbi_1.53.0        grid_4.1.0                 
      [5] BiocParallel_1.25.2         Rtsne_0.15                 
      [7] scatterpie_0.1.5            munsell_0.5.0              
      [9] ScaledMatrix_0.99.1         codetools_0.2-18           
     [11] statmod_1.4.35              scran_1.19.9               
     [13] withr_2.3.0                 colorspace_2.0-0           
     [15] GOSemSim_2.17.1             Biobase_2.51.0             
     [17] filelock_1.0.2              stats4_4.1.0               
     [19] SingleCellExperiment_1.13.3 robustbase_0.93-7          
     [21] DOSE_3.17.0                 MatrixGenerics_1.3.0       
     [23] labeling_0.4.2              GenomeInfoDbData_1.2.4     
     [25] polyclip_1.10-0             bit64_4.0.5                
     [27] farver_2.0.3                pheatmap_1.0.12            
     [29] downloader_0.4              vctrs_0.3.6                
     [31] treeio_1.15.1               generics_0.1.0             
     [33] BiocFileCache_1.15.1        diptest_0.75-7             
     [35] R6_2.5.0                    doParallel_1.0.16          
     [37] GenomeInfoDb_1.27.3         ggbeeswarm_0.6.0           
     [39] graphlayouts_0.7.1          rsvd_1.0.3                 
     [41] locfit_1.5-9.4              flexmix_2.3-17             
     [43] bitops_1.0-6                fgsea_1.17.0               
     [45] DelayedArray_0.17.7         assertthat_0.2.1           
     [47] scales_1.1.1                ggraph_2.0.4               
     [49] nnet_7.3-14                 enrichplot_1.11.2          
     [51] beeswarm_0.2.3              gtable_0.3.0               
     [53] beachmat_2.7.5              org.Mm.eg.db_3.12.0        
     [55] tidygraph_1.2.0             rlang_0.4.10               
     [57] splines_4.1.0               lazyeval_0.2.2             
     [59] GEOquery_2.59.0             BiocManager_1.30.10        
     [61] reshape2_1.4.4              qvalue_2.23.0              
     [63] clusterProfiler_3.19.0      tools_4.1.0                
     [65] ggplot2_3.3.3               ellipsis_0.3.1             
     [67] RColorBrewer_1.1-2          BiocGenerics_0.37.0        
     [69] Rcpp_1.0.6                  plyr_1.8.6                 
     [71] sparseMatrixStats_1.3.2     progress_1.2.2             
     [73] zlibbioc_1.37.0             purrr_0.3.4                
     [75] RCurl_1.98-1.2              prettyunits_1.1.1          
     [77] openssl_1.4.3               dbscan_1.1-5               
     [79] viridis_0.5.1               cowplot_1.1.1              
     [81] S4Vectors_0.29.6            SummarizedExperiment_1.21.1
     [83] ggrepel_0.9.0               cluster_2.1.0              
     [85] factoextra_1.0.7            magrittr_2.0.1             
     [87] data.table_1.13.6           DO.db_2.9                  
     [89] ResidualMatrix_1.1.0        matrixStats_0.57.0         
     [91] hms_1.0.0                   patchwork_1.1.1            
     [93] XML_3.99-0.5                mclust_5.4.7               
     [95] IRanges_2.25.6              gridExtra_2.3              
     [97] compiler_4.1.0              biomaRt_2.47.1             
     [99] scater_1.19.7               tibble_3.0.5               
    [101] crayon_1.3.4                shadowtext_0.0.7           
    [103] tidyr_1.1.2                 aplot_0.0.6                
    [105] DBI_1.1.1                   tweenr_1.0.1               
    [107] dbplyr_2.0.0                MASS_7.3-53                
    [109] fpc_2.2-9                   rappdirs_0.3.1             
    [111] Matrix_1.3-2                readr_1.4.0                
    [113] parallel_4.1.0              metapod_0.99.5             
    [115] igraph_1.2.6                GenomicRanges_1.43.1       
    [117] pkgconfig_2.0.3             rvcheck_0.1.8              
    [119] scuttle_1.1.5               xml2_1.3.2                 
    [121] foreach_1.5.1               ggtree_2.5.1               
    [123] vipor_0.4.5                 dqrng_0.2.1                
    [125] XVector_0.31.1              stringr_1.4.0              
    [127] digest_0.6.27               fastmatch_1.1-0            
    [129] tidytree_0.3.3              edgeR_3.33.1               
    [131] DelayedMatrixStats_1.13.3   curl_4.3                   
    [133] kernlab_0.9-29              modeltools_0.2-23          
    [135] lifecycle_0.2.0             nlme_3.1-151               
    [137] jsonlite_1.7.2              BiocNeighbors_1.9.4        
    [139] viridisLite_0.3.0           askpass_1.1                
    [141] limma_3.47.3                pillar_1.4.7               
    [143] lattice_0.20-41             DEoptimR_1.0-8             
    [145] GO.db_3.12.1                glue_1.4.2                 
    [147] prabclus_2.3-2              iterators_1.0.13           
    [149] bluster_1.1.4               bit_4.0.4                  
    [151] ggforce_0.3.2               class_7.3-17               
    [153] stringi_1.5.3               blob_1.2.1                 
    [155] BiocSingular_1.7.1          memoise_1.1.0              
    [157] dplyr_1.0.3                 irlba_2.3.3                
    [159] ape_5.4-1
ADD REPLY
0
Entering edit mode

That version of biomaRt was supposed to test both the main site and the uswest mirror on package load, and set the appropriate settings for the session. I guess that wasn't sufficient.

I've made some major changes to this in devel, and it should now determine the required settings when you first run useEnsembl(), and then save them for future sessions.

You'll need biomaRt version 2.47.4 to test that. I'd be interested to know if it works any better. It might be easier to open an issue at https://github.com/grimbough/biomaRt/issues to track any changes.

ADD REPLY

Login before adding your answer.

Traffic: 942 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6