Error with dada2 while running Parkinson’s Mouse Tutorial

Hi, everyone. I'm new to qiime2 and I have a technical issue. I have the same problem with https://forum.qiime2.org/t/plugin-error-from-dada2-an-error-was-encountered-while-running-dada2-in-r-return-code-255/21016 when I ran Parkinson’s Mouse Tutorial, but I noticed the problem didn't solved in the website above.
That's my error info:

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

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

Then I checked log file,

Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_dada.R --input_directory /tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data --output_path /tmp/tmpr8phq6ge/output.tsv.biom --output_track /tmp/tmpr8phq6ge/track.tsv --filtered_directory /tmp/tmpr8phq6ge --truncation_length 150 --trim_left 0 --max_expected_errors 2.0 --truncation_quality_score 2 --max_length Inf --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16

Rscript execution error: No such file or directory
Traceback (most recent call last):
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 220, in _denoise_single
    run_commands([cmd])
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data', '--output_path', '/tmp/tmpr8phq6ge/output.tsv.biom', '--output_track', '/tmp/tmpr8phq6ge/track.tsv', '--filtered_directory', '/tmp/tmpr8phq6ge', '--truncation_length', '150', '--trim_left', '0', '--max_expected_errors', '2.0', '--truncation_quality_score', '2', '--max_length', 'Inf', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000', '--homopolymer_gap_penalty', 'NULL', '--band_size', '16']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-54>", line 2, in denoise_single
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 244, in denoise_single
    return _denoise_single(
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 229, in _denoise_single
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

Then I read the website in the first paragraph, and run env as suggested,

RSTUDIO_WHICH_R=/data/condaEnv_HuaLab/qiime2-2023.2/bin/R
XDG_SESSION_ID=6932
JAVA_LD_LIBRARY_PATH=/data/condaEnv_HuaLab/qiime2-2023.2/lib/jvm/lib/server
HOSTNAME=node1
TERM=xterm-256color
SHELL=/bin/bash
PYTHONNOUSERSITE=/data/condaEnv_HuaLab/qiime2-2023.2/lib/python*/site-packages/
HISTSIZE=1000
CHECKVDB=/data/database/checkv-db-v1.1
SSH_CLIENT=210.45.116.220 64340 22
CONDA_SHLVL=2
CONDA_PROMPT_MODIFIER=(/data/condaEnv_HuaLab/qiime2-2023.2) 
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP=
QTDIR=/usr/lib64/qt-3.3
OLDPWD=/data/lizw/qiime_test
QTINC=/usr/lib64/qt-3.3/include
SSH_TTY=/dev/pts/0
LC_ALL=en_US.utf-8
QT_GRAPHICSSYSTEM_CHECKED=1
USER=lizw
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/lib64:/usr/lib64:
LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
CONDA_EXE=/home/lizw/anaconda3/bin/conda
_CE_CONDA=
CONDA_PREFIX_1=/home/lizw/anaconda3
MAIL=/var/spool/mail/lizw
PATH=/data/condaEnv_HuaLab/qiime2-2023.2/bin:/home/lizw/anaconda3/condabin:/data/raoyz/software/DeepVirFinder-master:/data/hzhengsh/software/prequal-master:/data/software/ncbi-blast-2.13.0+/bin:/data/software/MaxBin-2.2.7:/data/software/metabat:/data/software/DAS_Tool/src:/data/software/DAS_Tool:/data/software/bowtie2-2.4.5-linux-x86_64:/data/software/bedtools2/bin:/data/software/fastp:/data/software/bbmap_v38.92:/data/software/SPAdes-3.15.2-Linux/bin:/usr/local/bin:/usr/lib64/qt-3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/home/lizw/.local/bin:/home/lizw/bin
GSETTINGS_SCHEMA_DIR=/data/condaEnv_HuaLab/qiime2-2023.2/share/glib-2.0/schemas
XML_CATALOG_FILES=file:///data/condaEnv_HuaLab/qiime2-2023.2/etc/xml/catalog file:///etc/xml/catalog
CONDA_PREFIX=/data/condaEnv_HuaLab/qiime2-2023.2
PWD=/data/lizw/qiime_test/mouse
JAVA_HOME=/data/condaEnv_HuaLab/qiime2-2023.2/lib/jvm
MPLBACKEND=Agg
LANG=en_US.utf-8
KDEDIRS=/usr
GTDBTK_DATA_PATH=/data/database/gtdb207
_CE_M=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/lizw
CONDA_PYTHON_EXE=/home/lizw/anaconda3/bin/python
LOGNAME=lizw
QTLIB=/usr/lib64/qt-3.3/lib
XDG_DATA_DIRS=/home/lizw/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
SSH_CONNECTION=210.45.116.220 64340 210.45.116.55 22
JAVA_HOME_CONDA_BACKUP=
CONDA_DEFAULT_ENV=/data/condaEnv_HuaLab/qiime2-2023.2
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/1007
QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
JAVA_LD_LIBRARY_PATH_BACKUP=
R_LIBS_USER=/data/condaEnv_HuaLab/qiime2-2023.2/lib/R/library/
_=/usr/bin/env

I wonder how to fix that problem. Thank you!

Hi @ZeWLi,

Can you please re-run your command with the --verbose flag enabled? This will provide us with more information regarding the source of this error. Thanks! :lizard:

Hi @lizgehret,
Thank you for your time! I reran my command with --verbose flag, and I got error information below.

Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_dada.R --input_directory /tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data --output_path /tmp/tmp5chp2vwe/output.tsv.biom --output_track /tmp/tmp5chp2vwe/track.tsv --filtered_directory /tmp/tmp5chp2vwe --truncation_length 150 --trim_left 0 --max_expected_errors 2.0 --truncation_quality_score 2 --max_length Inf --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16

Rscript execution error: No such file or directory
Traceback (most recent call last):
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 220, in _denoise_single
    run_commands([cmd])
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data', '--output_path', '/tmp/tmp5chp2vwe/output.tsv.biom', '--output_track', '/tmp/tmp5chp2vwe/track.tsv', '--filtered_directory', '/tmp/tmp5chp2vwe', '--truncation_length', '150', '--trim_left', '0', '--max_expected_errors', '2.0', '--truncation_quality_score', '2', '--max_length', 'Inf', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000', '--homopolymer_gap_penalty', 'NULL', '--band_size', '16']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-54>", line 2, in denoise_single
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 244, in denoise_single
    return _denoise_single(
  File "/data/condaEnv_HuaLab/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 229, in _denoise_single
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

See above for debug info.

Hi @ZeWLi,

Thanks for providing this output! The base of the error is this line:

Rscript execution error: No such file or directory

This implies that something is wrong with your conda/execution environment's configuration, perhaps you have multiple versions of R that are being mixed up here. Let's start with the following, please run this command and copy-and-paste the complete results here:

conda deactivate
conda activate qiime2-2023.2
env

Thanks! :lizard:

Hi @lizgehret,
Thank you for your reply. I assigned a directory for environment, so I couldn't run conda activate qiime2-2023.2 because it's not installed to default path. Instead I ran conda activate ./qiime2-2023.2/ and env. The output is listed below.

(/data/condaEnv_HuaLab/qiime2-2023.2) (/data/condaEnv_HuaLab/qiime2-2023.2)[wangxy@node1 condaEnv_HuaLab]$ env
RSTUDIO_WHICH_R=/data/condaEnv_HuaLab/qiime2-2023.2/bin/R
XDG_SESSION_ID=7632
JAVA_LD_LIBRARY_PATH=/data/condaEnv_HuaLab/qiime2-2023.2/lib/jvm/lib/server
HOSTNAME=node1
TERM=xterm-256color
SHELL=/bin/bash
PYTHONNOUSERSITE=/data/condaEnv_HuaLab/qiime2-2023.2/lib/python*/site-packages/
HISTSIZE=1000
CHECKVDB=/data/database/checkv-db-v1.1
SSH_CLIENT=210.45.116.220 61033 22
CONDA_SHLVL=1
CONDA_PROMPT_MODIFIER=(/data/condaEnv_HuaLab/qiime2-2023.2) 
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP=
QTDIR=/usr/lib64/qt-3.3
OLDPWD=/data/lizw
QTINC=/usr/lib64/qt-3.3/include
SSH_TTY=/dev/pts/2
LC_ALL=en_US.utf-8
QT_GRAPHICSSYSTEM_CHECKED=1
USER=lizw
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/lib64:/usr/lib64:
LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:
CONDA_EXE=/home/lizw/anaconda3/bin/conda
_CE_CONDA=
MAIL=/var/spool/mail/lizw
PATH=/data/condaEnv_HuaLab/qiime2-2023.2/bin:/home/lizw/anaconda3/condabin:/data/raoyz/software/DeepVirFinder-master:/data/hzhengsh/software/prequal-master:/data/software/ncbi-blast-2.13.0+/bin:/data/software/MaxBin-2.2.7:/data/software/metabat:/data/software/DAS_Tool/src:/data/software/DAS_Tool:/data/software/bowtie2-2.4.5-linux-x86_64:/data/software/bedtools2/bin:/data/software/fastp:/data/software/bbmap_v38.92:/data/software/SPAdes-3.15.2-Linux/bin:/usr/local/bin:/usr/lib64/qt-3.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/data/lizw/software/sratoolkit.3.0.5-centos_linux64/bin:/home/lizw/.local/bin:/home/lizw/bin
GSETTINGS_SCHEMA_DIR=/data/condaEnv_HuaLab/qiime2-2023.2/share/glib-2.0/schemas
XML_CATALOG_FILES=file:///data/condaEnv_HuaLab/qiime2-2023.2/etc/xml/catalog file:///etc/xml/catalog
CONDA_PREFIX=/data/condaEnv_HuaLab/qiime2-2023.2
PWD=/data/condaEnv_HuaLab
JAVA_HOME=/data/condaEnv_HuaLab/qiime2-2023.2/lib/jvm
MPLBACKEND=Agg
LANG=en_US.utf-8
KDEDIRS=/usr
GTDBTK_DATA_PATH=/data/database/gtdb207
_CE_M=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/lizw
CONDA_PYTHON_EXE=/home/lizw/anaconda3/bin/python
LOGNAME=lizw
QTLIB=/usr/lib64/qt-3.3/lib
XDG_DATA_DIRS=/home/lizw/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
SSH_CONNECTION=210.45.116.220 61033 210.45.116.55 22
JAVA_HOME_CONDA_BACKUP=
CONDA_DEFAULT_ENV=/data/condaEnv_HuaLab/qiime2-2023.2
LESSOPEN=||/usr/bin/lesspipe.sh %s
XDG_RUNTIME_DIR=/run/user/1007
QT_PLUGIN_PATH=/usr/lib64/kde4/plugins:/usr/lib/kde4/plugins
JAVA_LD_LIBRARY_PATH_BACKUP=
R_LIBS_USER=/data/condaEnv_HuaLab/qiime2-2023.2/lib/R/library/
_=/usr/bin/env

Thanks!

Hello @ZeWLi,

Can you run $which Rscript and $which R with this environment activated and share the output?

Hi @colinvwood,
I ran command as you suggested, and I got output below.

(/data/condaEnv_HuaLab/qiime2-2023.2) (/data/condaEnv_HuaLab/qiime2-2023.2)[wangxy@node1 ~]$ which Rscript
/data/condaEnv_HuaLab/qiime2-2023.2/bin/Rscript
(/data/condaEnv_HuaLab/qiime2-2023.2) (/data/condaEnv_HuaLab/qiime2-2023.2)[wangxy@node1 ~]$ which R
/data/condaEnv_HuaLab/qiime2-2023.2/bin/R

Hello @ZeWLi,

One thing that's weird are the two sets of parentheses in your terminal prompt. What happens when you run conda deactivate? Does just one go away or do both go away? What about when you reactivate the environment afterwards?

Hi @colinvwood,
When I use other conda environments, I didn't think that bothered so I believe that's caused by my wrong linux bash file setting.

Hello @ZeWLi,

Did de- and reactivating the environment change anything? If it's not too much hassle the simplest next step would probably be to create a new qiime environment and see if things resolve themselves.

From reading stack overflow posts about this error, it seems to happen when the R interpreter, the Rscript executable, and R libraries are moved around and separated from one another, but it could be a lot of work to track down what got moved where.

Hi @colinvwood,
Thank you for your suggestion. I de- and reactvate my qiime2 environment and reran the tutorial, and found nothing changed.

(/data/condaEnv_HuaLab/qiime2-2023.2) (/data/condaEnv_HuaLab/qiime2-2023.2)[wangxy@node1 mouse]$ qiime dada2 denoise-single \
>   --i-demultiplexed-seqs ./demux_seqs.qza \
>   --p-trunc-len 150 \
>   --o-table ./dada2_table.qza \
>   --o-representative-sequences ./dada2_rep_set.qza \
>   --o-denoising-stats ./dada2_stats.qza
Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

Debug info has been saved to /tmp/qiime2-q2cli-err-3zlfr6k0.log

I wonder that could happen because the qiime environment was not installed to the default path. Do you think it's a good way to install the environment to default path?
Thank you for your time!

Alright, that doesn't work too...

Hello @ZeWLi,

It's likely that nothing changed, but we can't be sure because you didn't use the --verbose flag. You should re-run with the --verbose flag to confirm it's the same error.

I wonder that could happen because the qiime environment was not installed to the default path. Do you think it's a good way to install the environment to default path?

This is possible, yes. Did you use the --prefix option when you installed this environment? You should try installing a new qiime environment from scratch in the default location, following the instructions on the qiime website.

Hello @colinvwood,
I reran command with flag --verbose, and I don't think anything changed...The same error happened again.

(qiime2-2023.2) (qiime2-2023.2)[wangxy@node1 mouse]$ qiime dada2 denoise-single \
>   --i-demultiplexed-seqs ./demux_seqs.qza \
>   --p-trunc-len 150 \
>   --o-table ./dada2_table.qza \
>   --o-representative-sequences ./dada2_rep_set.qza \
>   --o-denoising-stats ./dada2_stats.qza --verbose
Running external command line application(s). This may print messages to stdout and/or stderr.
The command(s) being run are below. These commands cannot be manually re-run as they will depend on temporary files that no longer exist.

Command: run_dada.R --input_directory /tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data --output_path /tmp/tmpzmp5heac/output.tsv.biom --output_track /tmp/tmpzmp5heac/track.tsv --filtered_directory /tmp/tmpzmp5heac --truncation_length 150 --trim_left 0 --max_expected_errors 2.0 --truncation_quality_score 2 --max_length Inf --pooling_method independent --chimera_method consensus --min_parental_fold 1.0 --allow_one_off False --num_threads 1 --learn_min_reads 1000000 --homopolymer_gap_penalty NULL --band_size 16

Rscript execution error: No such file or directory
Traceback (most recent call last):
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 220, in _denoise_single
    run_commands([cmd])
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 36, in run_commands
    subprocess.run(cmd, check=True)
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['run_dada.R', '--input_directory', '/tmp/qiime2/lizw/data/db0efe3f-d361-4e8b-a47e-baa7f656768a/data', '--output_path', '/tmp/tmpzmp5heac/output.tsv.biom', '--output_track', '/tmp/tmpzmp5heac/track.tsv', '--filtered_directory', '/tmp/tmpzmp5heac', '--truncation_length', '150', '--trim_left', '0', '--max_expected_errors', '2.0', '--truncation_quality_score', '2', '--max_length', 'Inf', '--pooling_method', 'independent', '--chimera_method', 'consensus', '--min_parental_fold', '1.0', '--allow_one_off', 'False', '--num_threads', '1', '--learn_min_reads', '1000000', '--homopolymer_gap_penalty', 'NULL', '--band_size', '16']' returned non-zero exit status 255.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2cli/commands.py", line 352, in __call__
    results = action(**arguments)
  File "<decorator-gen-54>", line 2, in denoise_single
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 234, in bound_callable
    outputs = self._callable_executor_(scope, callable_args,
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/qiime2/sdk/action.py", line 381, in _callable_executor_
    output_views = self._callable(**view_args)
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 244, in denoise_single
    return _denoise_single(
  File "/home/lizw/anaconda3/envs/qiime2-2023.2/lib/python3.8/site-packages/q2_dada2/_denoise.py", line 229, in _denoise_single
    raise Exception("An error was encountered while running DADA2"
Exception: An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

Plugin error from dada2:

  An error was encountered while running DADA2 in R (return code 255), please inspect stdout and stderr to learn more.

See above for debug info.

And due to bad connection with our server, I installed the environment with a packed linux version (use conda-pack). I think the environment was installed to the default path.

(base)[wangxy@node1 ~]$ conda env list
# conda environments:
#
base                  *  /home/lizw/anaconda3
iRep_wangxy              /home/lizw/anaconda3/envs/iRep_wangxy
qiime2-2023.2            /home/lizw/anaconda3/envs/qiime2-2023.2

Thank you for your reply!

Hello @ZeWLi,

Is this a new environment that you installed since having the issue? If not, this is still your best next step.

If it is, please do each of these steps and post the output to further troubleshoot:

  • whereis R
  • ls -l $(which R)
  • head -40 $(which R)

Hi @colinvwood,
This is the new environment I installed and still met the same problem. I ran your steps as followed.

(base)[wangxy@node1 ~]$ conda activate qiime2-2023.2
(qiime2-2023.2) (qiime2-2023.2)[wangxy@node1 ~]$ whereis R
R: /usr/bin/R /usr/lib64/R /usr/include/R /usr/share/R /home/lizw/anaconda3/envs/qiime2-2023.2/bin/R /usr/share/man/man1/R.1.gz
(qiime2-2023.2) (qiime2-2023.2)[wangxy@node1 ~]$ ls -l $(which R)
-rwxrwxr-x. 1 lizw lizw 11466 Dec 15  2022 /home/lizw/anaconda3/envs/qiime2-2023.2/bin/R
(qiime2-2023.2) (qiime2-2023.2)[wangxy@node1 ~]$ head -40 $(which R)
#!/bin/sh
# Shell wrapper for R executable.

R_HOME_DIR=/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R
if test "${R_HOME_DIR}" = "/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R"; then
   case "linux-gnu" in
   linux*)
     run_arch=`uname -m`
     case "$run_arch" in
        x86_64|mips64|ppc64|powerpc64|sparc64|s390x)
          libnn=lib64
          libnn_fallback=lib
        ;;
        *)
          libnn=lib
          libnn_fallback=lib64
        ;;
     esac
     if [ -x "/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/${libnn}/R/bin/exec/R" ]; then
        R_HOME_DIR="/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/${libnn}/R"
     elif [ -x "/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/${libnn_fallback}/R/bin/exec/R" ]; then
        R_HOME_DIR="/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/${libnn_fallback}/R"
     ## else -- leave alone (might be a sub-arch)
     fi
     ;;
  esac
fi

if test -n "${R_HOME}" && \
   test "${R_HOME}" != "${R_HOME_DIR}"; then
  echo "WARNING: ignoring environment value of R_HOME"
fi
R_HOME="${R_HOME_DIR}"
export R_HOME
R_SHARE_DIR=/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R/share
export R_SHARE_DIR
R_INCLUDE_DIR=/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R/include
export R_INCLUDE_DIR
R_DOC_DIR=/home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R/doc
export R_DOC_DIR

Thank you!

Hello @ZeWLi,

What does Rscript -e "q()" --verbose output?

Also, what does ls -l /home/conda/feedstock_root/build_artifacts/r-base-split_1671162973535/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/R output?

1 Like