I am using Snakemake from inside a Singularity container. Because of that, the directory that Snakemake wants to log to cannot be created, and I get an OSError [Errno 30] Read-only file system: '.snakemake
, more specifically the traceback
Traceback (most recent call last):
File "/usr/local/bin/snakemake", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.8/dist-packages/snakemake/__init__.py", line 2562, in main
success = snakemake(
File "/usr/local/lib/python3.8/dist-packages/snakemake/__init__.py", line 525, in snakemake
logger.setup_logfile()
File "/usr/local/lib/python3.8/dist-packages/snakemake/logging.py", line 137, in setup_logfile
os.makedirs(os.path.join(".snakemake", "log"), exist_ok=True)
File "/usr/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/usr/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
OSError: [Errno 30] Read-only file system: '.snakemake'
The Snakefile I am using is inside a Singularity-container (there's no way around that, I am on a hpc and don't have root, also using a --sandbox
ed container doesn't work), and I call it like this (I've also played around with binding other directories without success):
singularity run --bind $(realpath .) --bind ~/container.sif ~/container.sif test_simple --cores 4
The test_simple rule is a really simple one that only unzips a gzip, for testing - the problem however lies generally in Snakemake wanting to create the log at <snakemake_base>/.snakemake/log
(see https://github.com/snakemake/snakemake/blob/bd5a9239b2684b57ab0143bb709e77afa1493cdc/snakemake/logging.py#L308), which in my case is inside the container.
It doesn't help to use an overlay --overlay overlay.img
for some reason, and I've also tried using my own (empty) log-handle (--log-handler-script ~/loghandler.py
) without any success.
Any ideas on how to circumvent this or disable the logging or write it to somewhere else?
.snakemake
folder is created inside the current working directory, not in a read-only folder. It might help seeing the container definition file. $\endgroup$/tmp/
? $\endgroup$conda install -c conda-forge -c bioconda snakemake
doesn't need root). $\endgroup$