biomaRt : No lock file for BiocFileCache
0
0
Entering edit mode
ZheFrench ▴ 60
@zhefrench-11689
Last seen 3 months ago
France
     library(biomaRt)
     biomartCacheInfo()

> Erreur dans lock(.sql_lock_path(dbfile), exclusive = FALSE) :   
> Cannot lock file:
> '/home/villemin/.cache/biomaRt/BiocFileCache.sqlite.LOCK': Aucun
> verrou disponible Erreur dans h(simpleError(msg, call)) :    erreur
> d'�valuation de l'argument 'conn' lors de la s�lection d'une
> m�thode pour la fonction 'dbDisconnect' : objet 'info' introuvable
>

Message in french sorry, but it says no lock file...I have no clue.

It should return something like :
biomaRt cache

  • Location: ~/.cache/biomaRt
  • No. of files: 1
  • Total size: 338.4 Kb
> R version 4.1.3 (2022-03-10) Platform: x86_64-conda-linux-gnu (64-bit)
> Running under: Ubuntu 18.04.6 LTS
> 
> Matrix products: default BLAS/LAPACK:
> /data/USERS/villemin/anaconda3/envs/r4.1.3/lib/libopenblasp-r0.3.20.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] biomaRt_2.50.3
> 
> loaded via a namespace (and not attached):  [1] KEGGREST_1.34.0       
> progress_1.2.2         tidyselect_1.1.2        [4] purrr_0.3.4        
> tcltk_4.1.3            vctrs_0.4.0             [7] generics_0.1.2     
> stats4_4.1.3           BiocFileCache_2.2.1    [10] utf8_1.2.2         
> blob_1.2.3             XML_3.99-0.9           [13] rlang_1.0.2        
> pillar_1.7.0           glue_1.6.2             [16] DBI_1.1.2          
> rappdirs_0.3.3         BiocGenerics_0.40.0    [19] bit64_4.0.5        
> dbplyr_2.1.1           GenomeInfoDbData_1.2.7 [22] lifecycle_1.0.1    
> stringr_1.4.0          zlibbioc_1.40.0        [25] Biostrings_2.62.0  
> memoise_2.0.1          Biobase_2.54.0         [28] IRanges_2.28.0     
> fastmap_1.1.0          GenomeInfoDb_1.30.1    [31] curl_4.3.2         
> AnnotationDbi_1.56.2   fansi_1.0.3            [34] Rcpp_1.0.8.3       
> filelock_1.0.2         BiocManager_1.30.16    [37] cachem_1.0.6       
> S4Vectors_0.32.4       XVector_0.34.0         [40] bit_4.0.4          
> hms_1.1.1              png_0.1-7              [43] digest_0.6.29      
> stringi_1.7.6          dplyr_1.0.8            [46] cli_3.2.0          
> tools_4.1.3            bitops_1.0-7           [49] magrittr_2.0.3     
> RCurl_1.98-1.6         RSQLite_2.2.12         [52] tibble_3.1.6       
> crayon_1.5.1           pkgconfig_2.0.3        [55] ellipsis_0.3.2     
> xml2_1.3.3             prettyunits_1.1.1      [58] assertthat_0.2.1   
> httr_1.4.2             R6_2.5.1               [61] compiler_4.1.3
BiocFileCache biomaRt • 3.2k views
ADD COMMENT
0
Entering edit mode

Error is coming from the call to lock from https://github.com/Bioconductor/BiocFileCache/blob/master/R/sql.R

  .lock2 <- function(dbfile, exclusive) {
        if (is.na(lock.env$status)) {
            lock.env$status <- exclusive
            **lock(.sql_lock_path(dbfile), exclusive = exclusive)**
        } else if (lock.env$status || !exclusive) {
            # Exclusive lock held by a caller is compatible
            # with a subsequent request for a shared lock;
            # we're not escalating privileges here.
            NULL
        } else {
            stop("requested an exclusive lock when caller only holds a shared lock")
        }
    }
ADD REPLY
0
Entering edit mode

This has also been reported at https://github.com/grimbough/biomaRt/issues/55 but lets try and keep the discussion here for now.

A slightly nicer formatted version of the error message is:

Error in lock(.sql_lock_path(dbfile), exclusive = FALSE) :
  Cannot lock file: '/home/villemin/.cache/biomaRt/BiocFileCache.sqlite.LOCK': Aucun verrou disponible
Appels : findOrthologs ... tryCatch -> tryCatchList -> .sql_connect_RW -> lock
Error in h(simpleError(msg, call)) :
  error in evaluating the argument 'conn' in selecting a method for function 'dbDisconnect': object 'info' not found
Calls: <Anonymous> ... .sql_disconnect -> dbDisconnect -> .handleSimpleError -> h
Execution halted

To me this looks like a BiocFileCache problem, do you agree shepherl ?

ADD REPLY
0
Entering edit mode

Also reported https://github.com/Bioconductor/BiocFileCache/issues/39 -- Please try to only have in one place so there are not multiple tickets open for the same item.
I will have to investigate more but yes it seems like it is BiocFileCache. There is a locking mechanism in place to try to avoid corruptions of the database. Is this a local computer or on a server? are you trying to run things in parallel?

ADD REPLY
0
Entering edit mode

Yeah sorry for the many messages everywhere. It's on ubuntu server 18.04. nfs mount version 3 with local_lock=none. That can be related,no ? Working well on same ubuntu version on docker container also or my linux...It's not R version related. There is no parallel stuffs . I'm just calling biomartCacheInfo() after loading biomart in R. I 'm using an R install in a conda environement if that can play a role...I think it's really filesystem related. and related to filelock package. From their doc :

File locking needs support from the file system, and some non-standard file systems do not support it. For example on network file systems like NFS or CIFS, user mode file systems like sshfs or ftpfs, etc., support might vary. Recent Linux versions and recent NFS versions (from version 3) do support file locking, if enabled.

ADD REPLY
0
Entering edit mode

Could there be a permissions issue? See Group Access

ADD REPLY
0
Entering edit mode

I tried also to change .LOCK with 660 or 700 and not work either. Both files are rw and still get no lock. 20K -rw-rw---- 1 villemin bioinfo 20K sept. 27 2021 BiocFileCache.sqlite 0 -rw-rw---- 1 villemin bioinfo 0 sept. 27 2021 BiocFileCache.sqlite.LOCK

ADD REPLY
0
Entering edit mode

This seems challenging. The first thing to do is to make this reproducible. The code biomaRt:: biomartCacheInfo() 'works for me' on both my native (macOS) and docker (as you note) environment under R-4.1.3 and similar package versions, so how does your environment differ (especially from the docker container)?

I see you have a conda environment. Have you installed all packages (in particular, BiocFileCache, biomaRt, filelock) under this conda environment, or are you mixing conda and 'native' installations?

ADD REPLY
2
Entering edit mode

https://github.com/r-lib/filelock/issues/39

biomaRt error: database disk image is malformed

These two helped a lot. It's definitely filesystem related. I moved the cache file under ext4 partition on my cluster.

> Sys.setenv(BIOMART_CACHE="/data2/biomart_cache")
> biomartCacheInfo()

biomaRt cache uninitialized
- Location: /data2/biomart_cache
ADD REPLY

Login before adding your answer.

Traffic: 530 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