Help troubleshooting rm: can't remove '/tmp/nfsx/nxf.XXXXhq43dI/*': Read-only file system

Hi. I am trying to run a process that using Star. I am runnig it in AWS batch. This is my current script

process starAlign {
        container 'public.ecr.aws/biocontainers/star:2.7.10b--h6b7c446_1'
        publishDir 's3://nextflow-ram/output_bam/'
        cpus 10
        debug true
        scratch '/tmp/nfsx'
        memory '64 GB'  
        disk '100 GB' 
        errorStrategy 'ignore'
    input:
    path ind
    tuple val(sra_name),path(fastq)


    // output:
    // tuple val(sra_name),path("*.sortedByCoord.out.bam") 
    // tuple val(sra_name),path("*.bg") 
    // tuple val(sra_name),path("*.wig")
    // tuple val(sra_name),path("*SJ.out.tab")
    // tuple val(sra_name),path("*.sam")
    // tuple val(sra_name),path("*Log.out")
    // tuple val(sra_name),path("*Log.final.out")
    // tuple val(sra_name),path("*Log.progress.out")



    script:
    
    """
    mkdir -p /tmp/nfsx
      STAR --runThreadN ${task.cpus} \
	    --runMode  alignReads \
         --genomeDir ${ind} \
         --readFilesIn ${fastq.join(' ')} \
         --outFileNamePrefix ${sra_name} \
         --outSAMtype BAM SortedByCoordinate
 
    """
}

However, I get the following error message

[15/ddbfa0] starAlign (1) | 1 of 1, failed: 1 ✘
ERROR ~ Error executing process > ‘starAlign (1)’

Caused by:
** Essential container in task exited**

Command executed:

** mkdir -p /tmp/nfsx**
** STAR --runThreadN 10 nfsx/nx --runMode alignReads --genomeDir star_genome_index --readFilesIn HD_MCF7_siCTR_Rep1_1_paired.fastq HD_MCF7_siCTR_Rep1_2_paired.fastq --outFileNamePrefix HD_MCF7_siCTR_Rep1 --outSAMtype BAM SortedByCoordinate**

Command exit status:
** 1**

Command output:
** s3://n/usr/local/bin/STAR-avx2 --runThreadN 10 --runMode alignReads --genomeDir star_genome_index --readFilesIn HD_MCF7_siCTR_Rep1_1_paired.fastq HD_MCF7_siCTR_Rep1_2_paired.fastq --outFileNamePrefix HD_MCF7_siCTR_Rep1 --outSAMtype BAM SortedByCoordinate**
** STAR version: 2.7.10b compiled: 2023-05-25T06:56:23+0000 :/opt/conda/conda-bld/star_1684997536154/work/source**
** Sep 14 20:31:17 … started STAR run**
** Sep 14 20:31:17 … loading genome**
** Sep 14 20:32:07 … started mapping**

Command error:
** (more omitted…)**
** rm: can’t remove ‘/tmp/nfsx/nxf.XXXXgQ9CvR/HD_MCF7_siCTR_Rep1_STARtmp/BAMsort/8/3’: Read-only file system**
** rm: can’t remove ‘/tmp/nfsx/nxf.XXXXgQ9CvR/HD_MCF7_siCTR_Rep1_STARtmp/BAMsort/8/30’: Read-only file system**
** rm: can’t remove ‘/tmp/nfsx/nxf.XXXXgQ9CvR/HD_MCF7_siCTR_Rep1_STARtmp/BAMsort/8/17’: Read-only file system**



**** rm: can’t remove ‘/tmp/nfsx/nxf.XXXXgQ9CvR/.command.out’: Read-only file system****
**** tee: .command.log: I/O error****

Work dir:
**** s3://nextflow-ram/test/15/ddbfa00d09beef12ba5e9ce2d41602****

Tip: view the complete command output by changing to the process work dir and entering the command cat .command.out

**** – Check ‘.nextflow.log’ file for details****

I thought its the memory and disk issue but that seems to not be the case

Do you really need the temporary folder to be exactly this path /tmp/nfsx? In cloud-based executors, such as AWS Batch, scratch is set to true by default. You shouldn’t have to worry about it.