Dave Jones
07/28/2025, 8:33 AMexecutor 'local' and ${workflow.resume ? '-resume' : ''} to surpress a warning about not being able to use the slurm executor and to allow for resumability. The issue I'm about to describe arises with or without those changes. I've also reordered some of the code in order to stop my language server from complaining:
process NEXTFLOW_RUN {
tag "${pipeline_name}"
executor 'local'
input:
val pipeline_name // String
val nextflow_opts // String
val params_file // pipeline params-file
val samplesheet // pipeline samplesheet
val additional_config // custom configs
val cache_dir // cache directory
output:
path "results", emit: output
val stdout, emit: log
when:
task.ext.when == null || task.ext.when
exec:
// Set cache directory so workflow can `-resume`
def cache_path = file(cache_dir)
assert cache_path.mkdirs()
// Construct nextflow command
def nxf_cmd = [
"nextflow run ${workflow.resume ? '-resume' : ''}",
pipeline_name,
nextflow_opts ? nextflow_opts : "",
params_file ? "-params-file ${params_file}" : '',
additional_config ? "-c ${additional_config}" : '',
samplesheet ? "--input ${samplesheet}" : '',
"--outdir ${task.workDir}/results",
].join(" ")
// Copy command to shell script in work dir for reference/debugging.
file("${task.workDir}/nf-cmd.sh").text = nxf_cmd
// Run nextflow command locally in cache directory
def process = nxf_cmd.execute(null, cache_path.toFile())
process.waitFor()
stdout = process.text
assert process.exitValue() == 0 : stdout
// Copy nextflow log to work directory
cache_path.resolve(".nextflow.log").copyTo("${task.workDir}/.nextflow.log")
}
My issue is that when running the pipeline with the following command:
HIC_PRO(
"nf-core/hic",
"-profile ${workflow.profile}",
ch_hic_pro_params_file,
ch_hic_pro_samplesheet,
params.nfcore_hic_pro_add_config ? Channel.fromPath(params.nfcore_hic_pro_add_config, checkIfExists: true) : Channel.value([]),
workflow.workDir.resolve('nf-core/hic').toUriString(),
)
the subpipeline consistently proceeds to midway through execution, until hanging after completion of a random process. I haven't been able to identify any common charicteristics of the processes that hang, but checking .nextflow.log does confirm that all all prosesses which have started have also completed, and checking active slurm jobs confirms that there are no new or ongoing jobs. Cancelling and resuming the pipeline causes it to pick up from thr cached results of previous work and proceed with subsequent processes. I've been able to make the pipeline as a whole complete in this way, but I would like to determine a proper solution for this problem.
I'm not sure which of my logs or which other data are going to be useful here, but I'm happy to provide any info that may help diagnose the issue.