Skip to content

When maxRetries > 0, and the job fails, the cli_log is overwritten, hiding useful error messages #787

@hexylena

Description

@hexylena

Hi! I noticed recently when I had a job fail, and I went looking for the reason, that the cli_log:

cli_log_filename = os.path.join(self.host_dir, f"{self.cli_name}.log.txt")
cli_log = cleanup.enter_context(open(cli_log_filename, "wb"))

is overwritten by default. Here is the current state of a workflow:

$ ls analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/std*
analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/stderr2.txt
analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/stdout2.txt
analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/stderr.txt
analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/stdout.txt

$ ls analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/slurm_singularity*
analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/slurm_singularity.log.txt

$ cat analysis/02-lrrnaseq/20250616_095354_LongReadRnaSeq/call-flairCollapse/slurm_singularity.log.txt 
srun: job 21258585 queued and waiting for resources

$

It would be nice if the cli_log could either be appended to, or use a numeric suffix like

Here's the relevant portion of my miniwdl.cfg:

[task_runtime]
defaults = {
        "maxRetries": 2,
        "threads": 4,
        "docker": "ubuntu:20.04"
    }

It is indeed slurm (via the https://github.com/miniwdl-ext/miniwdl-slurm) and I could find out why the job failed via my DRM, but in general it would be nice to not overwrite the log.

Perhaps this is as simple as change w for a in the logger, but perhaps there's a nice way to do the numerical append like with stdout/err so I can keep a good association between them

Thanks for the consideration

Metadata

Metadata

Assignees

No one assigned

    Labels

    devexDevelopers, developers, developers (developer experience)starternew contributors might start here

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions