Skip to content

"Snakefile not found" when path contains a space, using run directive #3235

@kjohnsen

Description

@kjohnsen

Snakemake version
8.25.5

Describe the bug

Snakemake fails with "Snakefile /path/that/includes/a/space" (part after space truncated) not found.

Logs

$ snakemake
Assuming unrestricted shared filesystem usage.
host: ___________
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 16
Rules claiming more threads will be scaled down.
Job stats:
job        count
-------  -------
default        1
total          1

Select jobs to execute...
Execute 1 jobs...

[Thu Dec 19 11:54:53 2024]
localrule default:
    jobid: 0
    reason: Rules with neither input nor output files are always executed.
    resources: tmpdir=/tmp

Error: Snakefile "/home/kyle/scratch/test-smk-bug/smk" not found.
[Thu Dec 19 11:54:55 2024]
Error in rule default:
    jobid: 0

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-12-19T115453.901323.snakemake.log
WorkflowError:
At least one job did not complete successfully.

Minimal example

mkdir smk\ space\ bug && cd smk\ space\ bug
echo 'rule default:\n    run:\n        print("hello")' > Snakefile
snakemake

Additional context

  • The same thing happens in a symlinked folder to the folder with spaces in it
  • The same thing happens in a subdirectory without spaces. i.e., a space anywhere in the path seems to break things
  • It only happens when using the run directive, not shell
  • It doesn't happen with --dry-run, but rather in the execution phase

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions