nf-core / ampliseq

Amplicon sequencing analysis workflow using DADA2 and QIIME2
https://nf-co.re/ampliseq
MIT License
182 stars 115 forks source link

Bad file descriptor #583

Closed weber8thomas closed 1 year ago

weber8thomas commented 1 year ago

Description of the bug

When running the test example profile using singularity, I get the issue below;

Command used and terminal output

nextflow run nf-core/ampliseq -r 2.5.0 -profile test,singularity --outdir nextflow-ampliseq

-[nf-core/ampliseq] Pipeline completed with errors-
ERROR ~ Error executing process > 'NFCORE_AMPLISEQ:AMPLISEQ:FASTQC (sampleID_1a)'

Caused by:
  Process `NFCORE_AMPLISEQ:AMPLISEQ:FASTQC (sampleID_1a)` terminated with an error exit status (255)

Command executed:

  printf "%s %s\n" sampleID_1a_1.fastq.gz sampleID_1a_1.gz sampleID_1a_2.fastq.gz sampleID_1a_2.gz | while read old_name new_name; do
      [ -f "${new_name}" ] || ln -s $old_name $new_name
  done
  fastqc --quiet --threads 2 sampleID_1a_1.gz sampleID_1a_2.gz

  cat <<-END_VERSIONS > versions.yml
  "NFCORE_AMPLISEQ:AMPLISEQ:FASTQC":
      fastqc: $( fastqc --version | sed -e "s/FastQC v//g" )
  END_VERSIONS

Command exit status:
  255

Command output:
  (empty)

Command error:
  INFO:    Environment variable SINGULARITYENV_TMPDIR is set, but APPTAINERENV_TMPDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_DEBUG is set, but APPTAINERENV_NXF_DEBUG is preferred
  WARNING: Skipping mount /var/apptainer/mnt/session/etc/resolv.conf [files]: /etc/resolv.conf doesn't exist in container
  FATAL:   aborting failed to close file descriptor: bad file descriptor

Work dir:
  /g/korbel2/weber/workspace/work/ea/54acf2847872bdc4bf8102cf4ad634

Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

 -- Check '.nextflow.log' file for details


### System information

Nextflow & ampliseq versions:

N E X T F L O W  ~  version 23.04.1
Launching `https://github.com/nf-core/ampliseq` [astonishing_mendel] DSL2 - revision: 78b7514cee [2.5.0]

* local execution (no slurm or HPC)

* OS specs
NAME="Rocky Linux"
VERSION="8.7 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.7"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.7 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.7"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.7"
* singularity profile selected (singularity pointing to apptainer) - apptainer version 1.1.8-1.el8
d4straub commented 1 year ago

Hi,

-profile test is tested frequently and should work, if it isnt, there is almost always a problem with the system/setup of the computational resources. I cannot recall coming across such an error message yet.

My only idea at the moment is about

  • singularity profile selected (singularity pointing to apptainer) - apptainer version 1.1.8-1.el8

that I am personally not aware of, but from nf-core tools version 2.8 "apptainer" is supported. This was a very recent addition. This addition (nf-core tools version 2.8) is implemented in the dev version, but isnt released yet. So you could try with -r dev instead and see whether that works.

weber8thomas commented 1 year ago

Thanks @d4straub for your fast answer!

It seems that the "bad file descriptor" disappeared but I now have another issue:

-[nf-core/ampliseq] Pipeline completed with errors-
ERROR ~ Error executing process > 'NFCORE_AMPLISEQ:AMPLISEQ:QIIME2_DIVERSITY:QIIME2_TREE'

Caused by:
  Process `NFCORE_AMPLISEQ:AMPLISEQ:QIIME2_DIVERSITY:QIIME2_TREE` terminated with an error exit status (1)

Command executed:

  export XDG_CONFIG_HOME="${PWD}/HOME"

  qiime alignment mafft \
      --i-sequences filtered-sequences.qza \
      --o-alignment aligned-rep-seqs.qza \
      --p-n-threads 2
  qiime alignment mask \
      --i-alignment aligned-rep-seqs.qza \
      --o-masked-alignment masked-aligned-rep-seqs.qza
  qiime phylogeny fasttree \
      --i-alignment masked-aligned-rep-seqs.qza \
      --p-n-threads 2 \
      --o-tree unrooted-tree.qza
  qiime phylogeny midpoint-root \
      --i-tree unrooted-tree.qza \
      --o-rooted-tree rooted-tree.qza
  qiime tools export \
      --input-path rooted-tree.qza  \
      --output-path phylogenetic_tree
  cp phylogenetic_tree/tree.nwk .

  cat <<-END_VERSIONS > versions.yml
  "NFCORE_AMPLISEQ:AMPLISEQ:QIIME2_DIVERSITY:QIIME2_TREE":
      qiime2: $( qiime --version | sed '1!d;s/.* //' )
  END_VERSIONS

Command exit status:
  1

Command output:
  (empty)

Command error:
  INFO:    Environment variable SINGULARITYENV_TMPDIR is set, but APPTAINERENV_TMPDIR is preferred
  INFO:    Environment variable SINGULARITYENV_NXF_DEBUG is set, but APPTAINERENV_NXF_DEBUG is preferred
  QIIME is caching your current deployment for improved performance. This may take a few moments and should only happen once per deployment.
  Plugin error from alignment:

    Command '['mafft', '--preservecase', '--inputorder', '--thread', '2', '/tmp/qiime2/tweber/data/7e3117ca-770d-4138-8423-b31867fb431f/data/dna-sequences.fasta']' returned non-zero exit status 1.

  Debug info has been saved to /tmp/qiime2-q2cli-err-7ln9jl5_.log

Work dir:
  /g/korbel2/weber/workspace/work/4e/be3a78691c8a79153b409f63e8c992

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

Any idea on how I could solve that? I think it might be related to the /tmp directory

d4straub commented 1 year ago

It seems that the "bad file descriptor" disappeared but I now have another issue:

could you leave a note how you solved it? Was it -r dev or something else? Sort of interesting if that issue comes up again!

Any idea on how I could solve that? I think it might be related to the /tmp directory

this error I came across before and it was discussed (and at least in that case solved) in https://github.com/nf-core/ampliseq/issues/516

weber8thomas commented 1 year ago

It seems that the "bad file descriptor" disappeared but I now have another issue:

could you leave a note how you solved it? Was it -r dev or something else? Sort of interesting if that issue comes up again!

Yes thanks, that's the -r dev that solved this issue! is it related to nf-core 2.8 itself then?

Any idea on how I could solve that? I think it might be related to the /tmp directory

this error I came across before and it was discussed (and at least in that case solved) in #516

Thanks, that helped me, I added singularity.runOptions = '-B /tmpdata/tweber:/tmpdata/tweber' in the pipeline config and solved the issue, our /tmp folder seems to be conflicting with QIIME2

Many thanks @d4straub !