Skip to content

Unexpected error [ConcurrentModificationException] #5719

@SalvadorGJ

Description

@SalvadorGJ

Bug report

My pipeline finishes abruptly with a non-detailed error when I try to resume it.

Expected behavior and actual behavior

I have the following channel definition

// Map reads to the genome
truncated_fastq_ch.fastq
        .combine(genome_index_ch)
        .map { sample_info, read1, read2, genome_info, index -> 
            sample_info.put('genomeName', "${genome_info['genomeName']}")
            return [sample_info, read1, read2, index]}
        .set { map_input_ch }

If I use .view() I get the expected behavior. Here is an example of the items in the channel map_input_ch

[[sampleName:CAUR4ANXX_2, sampleDataset:CAUR4ANXX, restrictionEnzime:^GATC,DpnII, genomeName:AmexG_v6], /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/6f/bd069037a1cfbe22ac571d5029df60/CAUR4ANXX_2_20170825B_20170830_left.part_003.fastq.trimmed_1P.trunc.fastq.gz, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/6f/bd069037a1cfbe22ac571d5029df60/CAUR4ANXX_2_20170825B_20170830_left.part_003.fastq.trimmed_2P.trunc.fastq.gz, [/scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.1.bt2l, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.2.bt2l, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.3.bt2l, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.4.bt2l, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.rev.1.bt2l, /scratch-cbe/users/salvador.gonzales/1_AmexGenomeAnnotation/0_AmexGenomeUpgrade/4_HiC_Processing/e9/1689a4d49ae7342d8b7de59e27d493/genome_index.rev.2.bt2l]]

Steps to reproduce the problem

Then when I run the following process the pipeline stops almost immediately,

process map_reads {
    executor = 'slurm' 
    cpus = 8
    time = { 1.hour * task.attempt }
    memory = { task.attempt < 2 ? 100.GB : 150.GB }
    errorStrategy = { 'retry' }
    maxRetries = 1
    maxForks = 1000
    clusterOptions = { '--qos=short --partition=c' }
    container = 'docker://docker.artifactory.imp.ac.at/tanakalab/hicup:master'

    input:
    tuple val(sample_info), path(read1), path(read2), path(index)

    output:
    tuple val(sample_info), path("*.pair.bam"), emit: bam
    tuple val(sample_info), path('hicup_mapper_summary*'), emit: summary

    script:
    """
    # Align read pairs independently to a reference genome
    hicup_mapper \\
        --bowtie2 /usr/bin/bowtie2 \\
        --index genome_index \\
        --threads ${task.cpus} \\
        --minlen 20 \\
        --mapq 30 \\
        --scorediff 10 \\
        --zip \\
        ${read1} ${read2}

    # Generate summary
    SUMMARY_FILE=\$(find . -name "hicup_mapper_summary*.txt")
    head -n 1 \${SUMMARY_FILE} > tmp
    grep ${read1} \${SUMMARY_FILE} >> tmp
    grep ${read2} \${SUMMARY_FILE} >> tmp
    rm \${SUMMARY_FILE}
    mv tmp \${SUMMARY_FILE}
    """
}

mapped_reads_ch = map_reads(map_input_ch)

Program output

ERROR ~ Unexpected error [ConcurrentModificationException]

issue_250128.nextflow.log

Environment

  • Nextflow version: 23.10.1.5893
  • Java version: [?]
  • Operating system: Linux
  • Bash version: GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

Additional context

nextflow.enable.dsl = 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions