Skip to content

Checkpoint with uncreatable input cannot goes on #3870

@Hocnonsense

Description

@Hocnonsense

Snakemake version
test on snakemake 9.5.0 and 9.14.2

Describe the bug
I have a checkpoint in my workflow whose input file is not produced anywhere in the workflow.
Now the input file has been deleted, and only the checkpoint's output file remains (without metadata).

In this situation, any rule or input function referencing this checkpoint fails silently and Snakemake reports: "Nothing to be done".
This happens even though downstream rules depend on the checkpoint result and should therefore be executed.
After adding a dummy rule that produces the missing checkpoint input, things goes well

Logs

$ /bin/rm -rf test1
$ pixi run --environment py312 snakemake -s Snakefile -d test1 -c all -n
host: Matebook14
Building DAG of jobs...
Nothing to be done (all requested files are present and up to date).
$ tree test1
test1
└── a.txt

0 directories, 1 file
$ printf "\nrule fake:\n  output: touch(\"not-even-exists\")\n" >> Snakefile
$ /bin/rm -rf test1
$ pixi run --environment py312 snakemake -s Snakefile -d test1 -c all -n
host: Matebook14
Building DAG of jobs...
a.txt
Updating checkpoint dependencies.
Job stats:
job      count
-----  -------
all          1
i            2
total        3


[Mon Dec  8 21:18:12 2025]
rule i:
    output: file/b
    jobid: 5
    reason: Missing output files: file/b
    wildcards: i=b
    resources: tmpdir=<TBD>


[Mon Dec  8 21:18:12 2025]
rule i:
    output: file/a
    jobid: 4
    reason: Missing output files: file/a
    wildcards: i=a
    resources: tmpdir=<TBD>


[Mon Dec  8 21:18:12 2025]
rule all:
    input: file/a, file/b
    jobid: 0
    reason: Input files updated by another job: file/a, file/b
    resources: tmpdir=<TBD>

Job stats:
job      count
-----  -------
all          1
i            2
total        3

Reasons:
    (check individual jobs above for details)
    input files updated by another job:
        all
    output files have to be generated:
        i
This was a dry-run (flag -n). The order of jobs does not reflect the order of execution.

Minimal example

rule all:
  input:
    lambda wildcards: [f"file/{i}" for i in get_a_output(wildcards)]

with open("a.txt", "w") as f:
    f.write("a\nb\n")

checkpoint a:
  input:
    "not-even-exists"
  output:
    "a.txt"
  run:
    pass

def get_a_output(wildcards):
    chk = checkpoints.a.get(**wildcards).output[0]
    print(chk)
    return [i for i in open(chk).read().strip().split("\n")]

rule i:
  output:
    touch("file/{i}")

# with this line things will work fine
#rule fake:
#  output: touch("not-even-exists")

Additional context

I think in this case, the workflow should take the output as valid file whether the input of checkpoint exists or not. If it is not allowed, there should be a clear error message.

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