Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 30] Read-only file system #73

Open
cmkobel opened this issue Aug 20, 2023 · 3 comments
Open

OSError: [Errno 30] Read-only file system #73

cmkobel opened this issue Aug 20, 2023 · 3 comments

Comments

@cmkobel
Copy link

cmkobel commented Aug 20, 2023

Hi

I wish to run checkm2 database from apptainer in a large reproducible pipeline that automatically downloads necessary databases. Checkm2 is installed with conda inside the container.

When i call the download command:

export CHECKM2DB="{params.download_path}"
checkm2 database --download --path {params.download_path}

I get the following error, because the conda prefix is in a read-only file system.

[Sun Aug 20 23:23:20 2023]                                                                                                                                                                                                                                    
localrule checkm2_download:                                                                                                                                                                                                                                   
    output: /glittertind/home/carl/asscom2/databases/checkm2/ac2_checkm2_database_representative.flag                                                                                                                                                         
    jobid: 18                                                                                                                                                                                                                                                 
    reason: Missing output files: /glittertind/home/carl/asscom2/databases/checkm2/ac2_checkm2_database_representative.flag                                                                                                                                   
    resources: tmpdir=/tmp                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                                              
Activating singularity image /glittertind/home/carl/.asscom2/apptainer-prefix/583c239bf25c6eb4eebe08b1620c0a06.simg                                                                                                                                           
Activating conda environment: ../../../../../../conda-envs/679a46a27a9c8f5ec775838a5d75a05d                                                                                                                                                                   
Flag doesn't exist: Download the database and touch the flag ...                                                                                                                                                                                              
[08/20/2023 11:23:27 PM] INFO: Command: Download database. Checking internal path information.                                                                                                                                                                
[08/20/2023 11:23:28 PM] INFO: Downloading https://zenodo.org/api/files/fd3bc532-cd84-4907-b078-2e05a1e46803/checkm2_database.tar.gz to /glittertind/home/carl/asscom2/tests/MAGs/databases/checkm2_database.tar.gz.                                          
100%|█████████████████████████████████████████████████████████████████████████████████████| 1.74G/1.74G [00:19<00:00, 87.3MiB/s]                                                                                                                              
[08/20/2023 11:23:48 PM] INFO: Extracting files from archive...                                                                                                                                                                                               
[08/20/2023 11:24:04 PM] INFO: Verifying version and checksums...                                                                                                                                                                                             
[08/20/2023 11:24:04 PM] INFO: Verification success.                                                                              
Traceback (most recent call last):                                                                                                                                                                                                                            
  File "/conda-envs/679a46a27a9c8f5ec775838a5d75a05d/bin/checkm2", line 280, in <module>                                          
    fileManager.DiamondDB().download_database(args.path)                                                                          
  File "/conda-envs/679a46a27a9c8f5ec775838a5d75a05d/lib/python3.8/site-packages/checkm2/fileManager.py", line 131, in download_database                                                                                                                      
    with open(diamond_location, 'w') as dd:                                                                                       
OSError: [Errno 30] Read-only file system: '/conda-envs/679a46a27a9c8f5ec775838a5d75a05d/lib/python3.8/site-packages/checkm2/version/diamond_path.json'

The thing is, I already set the CHECKM2DB system variable, so I don't need Checkm2 to write to the "diamond_path.json" file.

Is there a way to disable writing to the diamond_path.json file altogether and solely rely on the CHECKM2DB system variable? I tried removing the "--path" argument, but it doesn't affect the behaviour.

Cheers,
Carl 🤟

@cmkobel
Copy link
Author

cmkobel commented Aug 20, 2023

After checking out the culprit line:

with open(diamond_location, 'w') as dd:
I realize that this is the final action in the "download if-statement block", so I can possibly ignore this "OSError". The problem is that my pipeline relies on successful exit codes to make sure that everything runs smoothly. I could maybe formulate a pull request with an added "--skip-writing-to-diamond-path-dot-json"-like argument if you think that might turn out to be pullable?

Do you have a better solution in mind?

@chklovski
Copy link
Owner

chklovski commented Oct 3, 2023

Hi, if you wish to download the database but not set it within CheckM2, would downloading it externally to the program and using it to set the CHECKM2DB variable be an easier solution? Current database is available from the following link (I will keep this updated in the README):

https://zenodo.org/record/5571251/files/checkm2_database.tar.gz?download=1

@cmkobel
Copy link
Author

cmkobel commented Oct 11, 2023

I think that could be a solution. The reason why I like using checkm2 database --download is that you can then only download the correct version. If one is inadvertently using an older version of checkm2, a newer database might not be compatible?

cmkobel added a commit to cmkobel/CompareM2 that referenced this issue Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants