Spaces in full paths causing problems?

A couple of days ago I updated Nexstrain (actually deleted and re-installed it) and updated the ncov build. I don’t remember when I had installed my previous environment, but everything had been working perfectly till then. Now, any attempts at running the same builds I was previously running fail, seemingly at different steps in the workflow. The command I run from the ncov folder is nextstrain build . --cores all --configfile my_profiles/haiti/builds.yaml

It exits with “Exiting because a job execution failed. Look above for error message”. The only error message I see above is:

/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `cd /Users/path/to/a folder name containing spaces and (parentheses)/ncov && /Users/username/opt/anaconda3/envs/nextstrain/bin/python3.8 -m snakemake --snakefile '/Users/path/to/folder name containing spaces and (parentheses)/ncov/Snakefile' 'results/haiti/' --allowed-rules 'build_description' --cores 8 --attempt 1 --force-use-threads  --quiet all --force --keep-target-files --keep-remote --max-inventory-time 0 --nocolor --notemp --no-hooks --nolock --ignore-incomplete --rerun-triggers 'code' 'input' 'params' 'software-env' 'mtime' --skip-script-cleanup  --conda-frontend 'mamba' --wrapper-prefix '' --local-groupid 'local' --configfiles '/Users/path/to/folder name containing spaces and (parentheses)/ncov/my_profiles/haiti/builds.yaml' --printshellcmds  --latency-wait 5 --scheduler 'ilp' --scheduler-solver-path '/Users/username/opt/anaconda3/envs/nextstrain/bin' --default-resources 'tmpdir=system_tmpdir' --mode 1'

(edited the paths to remove other people’s identifying information)

My interpretation of this is that the problem is that the full path contains a folder where the name contains spaces and parentheses. I cannot change this – it’s a lab-wide shared OneDrive folder where we keep all our shared analyses. Whichever previous version of Nextstrain/ncov I was using did not have a problem with this. Is there something I can tweak somewhere that will make it able to run again? (Or, is the problem something else and I’m misinterpreting? Let me know if there are any logs or anything else I should look at.)

Thank you!

Your interpretation is correct, AFAICT. This appears to be a bug in Snakemake that was introduced in 7.3.0 and “fixed” but not fully in 7.3.6. I’ve added a comment to the upstream bug report.

I thought that using symlinks might let you workaround the bug, but unfortunately Snakemake seems to fully resolve the working dir, negating that.

Your best workaround is probably to downgrade Snakemake in your Conda environment for now, something like:

mamba install -n nextstrain 'snakemake<7.3.0'

(replace mamba with conda if you don’t have mamba).

I’ve confirmed this works for me locally.

thank you! this seems to have worked.

1 Like